Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2013-06-09 Thread Steve Liu
how about this patch, do we really need this patch


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-23 Thread Lee Jones
I have a few answers for you.

> >>root@ME:/ cat /sys/kernel/debug/boottime/bootgraph
> >>[0.185254] calling  splash+0x0/0x0
> >>[2.984335] initcall splash+0x0/0x0 returned 0 after 2799 msecs.
> >>[2.984335] calling  autoboot_delay+0x0/0x0
> >>[4.089513] initcall autoboot_delay+0x0/0x0 returned 0 after 1105 
> >>msecs.
> >>[4.089513] calling  load_kernel+0x0/0x0
> >>[4.239174] initcall load_kernel+0x0/0x0 returned 0 after 149 msecs.
> >>[4.239174] calling  boot_kernel+0x0/0x0
> >>[4.276260] initcall boot_kernel+0x0/0x0 returned 0 after 37 msecs.
> >>[4.276260] calling  uncompress_ll_init+0x0/0x0
> >>[4.276260] initcall uncompress_ll_init+0x0/0x0 returned 0 after 0 
> >>msecs.
> >>[4.276260] Freeing init memory: 0K

> OK So has this been validated and tested on any other IC then a ST part?

No, it has not. As I believe I mentioned before, this is a tool
written for and used by ST-Ericsson. Extending it to use on other
platforms sounds like a great idea, but won't be done by
ST-Ericsson due to a lack of hardware and software assets.

> This boottime_activate patch seems to be only for the dbx500.  If
> this is supposed to be a generic solution I would expect
> a generic patch for ARM to enable boot time activation.

Apparently a generic boottime extention would be fairly trivial
with the use of ktime_get().

> Have you profiled how much time the boot time logging has added to
> the over all boot?

This has not been completed, but the original author suspects
it would be <100ms.

> Also the boottime commit message should explain a little more what
> it is measuring.
> i.e.  This patch enables logging the boot time from point x to point
> y for the kernel only.  This does not include init.
> What about adding the boot time from the init sequence to init complete?

This sounds like a good idea, but again won't be extended upon by
us.

It appears that this driver is interesting and possibly very
useful for quite a lot of people out there. This patch should
therefore be seen as the foundations for other to then extend
in the ways alluded to above and ported to work on other more
generic platforms. I think these should be extra patches on
top of the one submitted here.

>From a personal perspective, I am happy to change a few bits
and pieces, but I don't have the time to satisfy all of the
suggestions made, or adapt the driver in any substantial
manor.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-16 Thread Lee Jones
> >>root@ME:/ cat /sys/kernel/debug/boottime/bootgraph
> >>[0.185254] calling  splash+0x0/0x0
> >>[2.984335] initcall splash+0x0/0x0 returned 0 after 2799 msecs.
> >>[2.984335] calling  autoboot_delay+0x0/0x0
> >>[4.089513] initcall autoboot_delay+0x0/0x0 returned 0 after 1105 
> >>msecs.
> >>[4.089513] calling  load_kernel+0x0/0x0
> >>[4.239174] initcall load_kernel+0x0/0x0 returned 0 after 149 msecs.
> >>[4.239174] calling  boot_kernel+0x0/0x0
> >>[4.276260] initcall boot_kernel+0x0/0x0 returned 0 after 37 msecs.
> >>[4.276260] calling  uncompress_ll_init+0x0/0x0
> >>[4.276260] initcall uncompress_ll_init+0x0/0x0 returned 0 after 0 
> >>msecs.
> >>[4.276260] Freeing init memory: 0K

> >commit 4c49a18bcfd2d041cbad7f41c6e6b39d90008382 (HEAD, 
> >refs/heads/dt-snowball-pre-rc1)
> >Author: Jonas Aaberg
> >Date:   Wed Sep 14 09:29:20 2011 +0200
> >
> > drivers: clocksource: dbx500-prcmu: Add boottime support
> >
> > Change-Id: I9b5e3d050131c08c08786ae84cb76619c0525049
> > Signed-off-by: Jonas Aaberg
> > Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32055
> >
> >diff --git a/drivers/clocksource/clksrc-dbx500-prcmu.c 
> >b/drivers/clocksource/clksrc-dbx500-prcmu.c
> >index c26c369..0069cd9 100644
> >--- a/drivers/clocksource/clksrc-dbx500-prcmu.c
> >+++ b/drivers/clocksource/clksrc-dbx500-prcmu.c
> >@@ -14,6 +14,7 @@
> >   */
> >  #include
> >  #include
> >+#include
> >
> >  #include
> >
> >@@ -68,6 +69,23 @@ static u32 notrace dbx500_prcmu_sched_clock_read(void)
> >
> >  #endif
> >
> >+#ifdef CONFIG_BOOTTIME
> >+static unsigned long __init boottime_get_time(void)
> >+{
> >+return div_s64(clocksource_cyc2ns(clocksource_dbx500_prcmu.read(
> >+&clocksource_dbx500_prcmu),
> >+  clocksource_dbx500_prcmu.mult,
> >+  clocksource_dbx500_prcmu.shift),
> >+   1000);
> >+}
> >+
> >+static struct boottime_timer __initdata boottime_timer = {
> >+.init = NULL,
> >+.get_time = boottime_get_time,
> >+.finalize = NULL,
> >+};
> >+#endif
> >+
> >  void __init clksrc_dbx500_prcmu_init(void __iomem *base)
> >  {
> > clksrc_dbx500_timer_base = base;
> >@@ -90,4 +108,6 @@ void __init clksrc_dbx500_prcmu_init(void __iomem *base)
> >  32, RATE_32K);
> >  #endif
> > clocksource_register_hz(&clocksource_dbx500_prcmu, RATE_32K);
> >+
> >+boottime_activate(&boottime_timer);
> >  }
> >
> 
> OK So has this been validated and tested on any other IC then a ST part?
> This boottime_activate patch seems to be only for the dbx500.  If
> this is supposed to be a generic solution I would expect
> a generic patch for ARM to enable boot time activation.

No, this is essentially an STE patch. We don't have access to any other
hardware, so we'd be reliant on kindhearted soles to test on their h/w.
I guess something like Beagleboard and/or Panda would be ideal. Know
anyone? ;)

> Have you profiled how much time the boot time logging has added to
> the over all boot?
> Also the boottime commit message should explain a little more what
> it is measuring.
> i.e.  This patch enables logging the boot time from point x to point
> y for the kernel only.  This does not include init.
> 
> What about adding the boot time from the init sequence to init complete?

I don't know the answers to these questions, but I'll endeavour to find
out and get back to you posthaste.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-15 Thread Dan Murphy



On 10/12/2012 11:42 AM, Lee Jones wrote:

On Fri, 12 Oct 2012, Dan Murphy wrote:


On 10/12/2012 09:01 AM, Lee Jones wrote:

On Fri, 12 Oct 2012, Arnd Bergmann wrote:


On Friday 12 October 2012, Russell King - ARM Linux wrote:

root@ME:/ cat /sys/kernel/debug/boottime/bootgraph
[0.185254] calling  splash+0x0/0x0
[2.984335] initcall splash+0x0/0x0 returned 0 after 2799 msecs.
[2.984335] calling  autoboot_delay+0x0/0x0
[4.089513] initcall autoboot_delay+0x0/0x0 returned 0 after 1105 msecs.
[4.089513] calling  load_kernel+0x0/0x0
[4.239174] initcall load_kernel+0x0/0x0 returned 0 after 149 msecs.
[4.239174] calling  boot_kernel+0x0/0x0
[4.276260] initcall boot_kernel+0x0/0x0 returned 0 after 37 msecs.
[4.276260] calling  uncompress_ll_init+0x0/0x0
[4.276260] initcall uncompress_ll_init+0x0/0x0 returned 0 after 0 msecs.
[4.276260] Freeing init memory: 0K

Umm, what happened to sysfs not becoming procfs v2?  I thought we had
a fairly strict requirement for "one value per file and not nicely
formatted" for sysfs?


I was thinking the same thing at first, but then I noticed it's actually
debugfs, which has no such rules.

Right. :)


OK I don't see when boottime_activate is called.

Where would this call actually be made from?

I see the call to deactivate but no call to activate.

Here perhaps (Jonas, alerted me to the missing patch):

commit 4c49a18bcfd2d041cbad7f41c6e6b39d90008382 (HEAD, 
refs/heads/dt-snowball-pre-rc1)
Author: Jonas Aaberg
Date:   Wed Sep 14 09:29:20 2011 +0200

 drivers: clocksource: dbx500-prcmu: Add boottime support

 Change-Id: I9b5e3d050131c08c08786ae84cb76619c0525049
 Signed-off-by: Jonas Aaberg
 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32055

diff --git a/drivers/clocksource/clksrc-dbx500-prcmu.c 
b/drivers/clocksource/clksrc-dbx500-prcmu.c
index c26c369..0069cd9 100644
--- a/drivers/clocksource/clksrc-dbx500-prcmu.c
+++ b/drivers/clocksource/clksrc-dbx500-prcmu.c
@@ -14,6 +14,7 @@
   */
  #include
  #include
+#include

  #include

@@ -68,6 +69,23 @@ static u32 notrace dbx500_prcmu_sched_clock_read(void)

  #endif

+#ifdef CONFIG_BOOTTIME
+static unsigned long __init boottime_get_time(void)
+{
+   return div_s64(clocksource_cyc2ns(clocksource_dbx500_prcmu.read(
+   &clocksource_dbx500_prcmu),
+ clocksource_dbx500_prcmu.mult,
+ clocksource_dbx500_prcmu.shift),
+  1000);
+}
+
+static struct boottime_timer __initdata boottime_timer = {
+   .init = NULL,
+   .get_time = boottime_get_time,
+   .finalize = NULL,
+};
+#endif
+
  void __init clksrc_dbx500_prcmu_init(void __iomem *base)
  {
clksrc_dbx500_timer_base = base;
@@ -90,4 +108,6 @@ void __init clksrc_dbx500_prcmu_init(void __iomem *base)
 32, RATE_32K);
  #endif
clocksource_register_hz(&clocksource_dbx500_prcmu, RATE_32K);
+
+   boottime_activate(&boottime_timer);
  }



OK So has this been validated and tested on any other IC then a ST part?
This boottime_activate patch seems to be only for the dbx500.  If this 
is supposed to be a generic solution I would expect

a generic patch for ARM to enable boot time activation.

Have you profiled how much time the boot time logging has added to the 
over all boot?
Also the boottime commit message should explain a little more what it is 
measuring.
i.e.  This patch enables logging the boot time from point x to point y 
for the kernel only.  This does not include init.


What about adding the boot time from the init sequence to init complete?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-12 Thread Lee Jones
On Fri, 12 Oct 2012, Dan Murphy wrote:

> 
> On 10/12/2012 09:01 AM, Lee Jones wrote:
> >On Fri, 12 Oct 2012, Arnd Bergmann wrote:
> >
> >>On Friday 12 October 2012, Russell King - ARM Linux wrote:
> root@ME:/ cat /sys/kernel/debug/boottime/bootgraph
> [0.185254] calling  splash+0x0/0x0
> [2.984335] initcall splash+0x0/0x0 returned 0 after 2799 msecs.
> [2.984335] calling  autoboot_delay+0x0/0x0
> [4.089513] initcall autoboot_delay+0x0/0x0 returned 0 after 1105 
> msecs.
> [4.089513] calling  load_kernel+0x0/0x0
> [4.239174] initcall load_kernel+0x0/0x0 returned 0 after 149 msecs.
> [4.239174] calling  boot_kernel+0x0/0x0
> [4.276260] initcall boot_kernel+0x0/0x0 returned 0 after 37 msecs.
> [4.276260] calling  uncompress_ll_init+0x0/0x0
> [4.276260] initcall uncompress_ll_init+0x0/0x0 returned 0 after 0 
> msecs.
> [4.276260] Freeing init memory: 0K
> >>>Umm, what happened to sysfs not becoming procfs v2?  I thought we had
> >>>a fairly strict requirement for "one value per file and not nicely
> >>>formatted" for sysfs?
> >>>
> >>I was thinking the same thing at first, but then I noticed it's actually
> >>debugfs, which has no such rules.
> >Right. :)
> >
> OK I don't see when boottime_activate is called.
> 
> Where would this call actually be made from?
> 
> I see the call to deactivate but no call to activate.

Here perhaps (Jonas, alerted me to the missing patch):

commit 4c49a18bcfd2d041cbad7f41c6e6b39d90008382 (HEAD, 
refs/heads/dt-snowball-pre-rc1)
Author: Jonas Aaberg 
Date:   Wed Sep 14 09:29:20 2011 +0200

drivers: clocksource: dbx500-prcmu: Add boottime support

Change-Id: I9b5e3d050131c08c08786ae84cb76619c0525049
Signed-off-by: Jonas Aaberg 
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32055

diff --git a/drivers/clocksource/clksrc-dbx500-prcmu.c 
b/drivers/clocksource/clksrc-dbx500-prcmu.c
index c26c369..0069cd9 100644
--- a/drivers/clocksource/clksrc-dbx500-prcmu.c
+++ b/drivers/clocksource/clksrc-dbx500-prcmu.c
@@ -14,6 +14,7 @@
  */
 #include 
 #include 
+#include 
 
 #include 
 
@@ -68,6 +69,23 @@ static u32 notrace dbx500_prcmu_sched_clock_read(void)
 
 #endif
 
+#ifdef CONFIG_BOOTTIME
+static unsigned long __init boottime_get_time(void)
+{
+   return div_s64(clocksource_cyc2ns(clocksource_dbx500_prcmu.read(
+ &clocksource_dbx500_prcmu),
+ clocksource_dbx500_prcmu.mult,
+ clocksource_dbx500_prcmu.shift),
+  1000);
+}
+
+static struct boottime_timer __initdata boottime_timer = {
+   .init = NULL,
+   .get_time = boottime_get_time,
+   .finalize = NULL,
+};
+#endif
+
 void __init clksrc_dbx500_prcmu_init(void __iomem *base)
 {
clksrc_dbx500_timer_base = base;
@@ -90,4 +108,6 @@ void __init clksrc_dbx500_prcmu_init(void __iomem *base)
 32, RATE_32K);
 #endif
clocksource_register_hz(&clocksource_dbx500_prcmu, RATE_32K);
+
+   boottime_activate(&boottime_timer);
 }

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-12 Thread Dan Murphy


On 10/12/2012 09:01 AM, Lee Jones wrote:

On Fri, 12 Oct 2012, Arnd Bergmann wrote:


On Friday 12 October 2012, Russell King - ARM Linux wrote:

root@ME:/ cat /sys/kernel/debug/boottime/bootgraph
[0.185254] calling  splash+0x0/0x0
[2.984335] initcall splash+0x0/0x0 returned 0 after 2799 msecs.
[2.984335] calling  autoboot_delay+0x0/0x0
[4.089513] initcall autoboot_delay+0x0/0x0 returned 0 after 1105 msecs.
[4.089513] calling  load_kernel+0x0/0x0
[4.239174] initcall load_kernel+0x0/0x0 returned 0 after 149 msecs.
[4.239174] calling  boot_kernel+0x0/0x0
[4.276260] initcall boot_kernel+0x0/0x0 returned 0 after 37 msecs.
[4.276260] calling  uncompress_ll_init+0x0/0x0
[4.276260] initcall uncompress_ll_init+0x0/0x0 returned 0 after 0 msecs.
[4.276260] Freeing init memory: 0K

Umm, what happened to sysfs not becoming procfs v2?  I thought we had
a fairly strict requirement for "one value per file and not nicely
formatted" for sysfs?


I was thinking the same thing at first, but then I noticed it's actually
debugfs, which has no such rules.

Right. :)


OK I don't see when boottime_activate is called.

Where would this call actually be made from?

I see the call to deactivate but no call to activate.

Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-12 Thread Lee Jones
On Fri, 12 Oct 2012, Arnd Bergmann wrote:

> On Friday 12 October 2012, Russell King - ARM Linux wrote:
> > > root@ME:/ cat /sys/kernel/debug/boottime/bootgraph
> > > [0.185254] calling  splash+0x0/0x0
> > > [2.984335] initcall splash+0x0/0x0 returned 0 after 2799 msecs.
> > > [2.984335] calling  autoboot_delay+0x0/0x0
> > > [4.089513] initcall autoboot_delay+0x0/0x0 returned 0 after 1105 
> > > msecs.
> > > [4.089513] calling  load_kernel+0x0/0x0
> > > [4.239174] initcall load_kernel+0x0/0x0 returned 0 after 149 msecs.
> > > [4.239174] calling  boot_kernel+0x0/0x0
> > > [4.276260] initcall boot_kernel+0x0/0x0 returned 0 after 37 msecs.
> > > [4.276260] calling  uncompress_ll_init+0x0/0x0
> > > [4.276260] initcall uncompress_ll_init+0x0/0x0 returned 0 after 0 
> > > msecs.
> > > [4.276260] Freeing init memory: 0K
> > 
> > Umm, what happened to sysfs not becoming procfs v2?  I thought we had
> > a fairly strict requirement for "one value per file and not nicely
> > formatted" for sysfs?
> > 
> 
> I was thinking the same thing at first, but then I noticed it's actually
> debugfs, which has no such rules.

Right. :)

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-12 Thread Arnd Bergmann
On Friday 12 October 2012, Russell King - ARM Linux wrote:
> > root@ME:/ cat /sys/kernel/debug/boottime/bootgraph
> > [0.185254] calling  splash+0x0/0x0
> > [2.984335] initcall splash+0x0/0x0 returned 0 after 2799 msecs.
> > [2.984335] calling  autoboot_delay+0x0/0x0
> > [4.089513] initcall autoboot_delay+0x0/0x0 returned 0 after 1105 msecs.
> > [4.089513] calling  load_kernel+0x0/0x0
> > [4.239174] initcall load_kernel+0x0/0x0 returned 0 after 149 msecs.
> > [4.239174] calling  boot_kernel+0x0/0x0
> > [4.276260] initcall boot_kernel+0x0/0x0 returned 0 after 37 msecs.
> > [4.276260] calling  uncompress_ll_init+0x0/0x0
> > [4.276260] initcall uncompress_ll_init+0x0/0x0 returned 0 after 0 msecs.
> > [4.276260] Freeing init memory: 0K
> 
> Umm, what happened to sysfs not becoming procfs v2?  I thought we had
> a fairly strict requirement for "one value per file and not nicely
> formatted" for sysfs?
> 

I was thinking the same thing at first, but then I noticed it's actually
debugfs, which has no such rules.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-12 Thread Russell King - ARM Linux
On Fri, Oct 12, 2012 at 02:45:42PM +0100, Lee Jones wrote:
> That's odd. I get:
> 
> root@ME:/ cat sys/boottime/bootloader 
> 0
> 
> root@ME:/ cat sys/boottime/kernel 
> 4276
> 
> root@ME:/ cat /sys/kernel/debug/boottime/summary 
> kernel: 4276 msecs
> total: 4276 msecs
> 
> root@ME:/ cat /sys/kernel/debug/boottime/bootgraph
> [0.185254] calling  splash+0x0/0x0
> [2.984335] initcall splash+0x0/0x0 returned 0 after 2799 msecs.
> [2.984335] calling  autoboot_delay+0x0/0x0
> [4.089513] initcall autoboot_delay+0x0/0x0 returned 0 after 1105 msecs.
> [4.089513] calling  load_kernel+0x0/0x0
> [4.239174] initcall load_kernel+0x0/0x0 returned 0 after 149 msecs.
> [4.239174] calling  boot_kernel+0x0/0x0
> [4.276260] initcall boot_kernel+0x0/0x0 returned 0 after 37 msecs.
> [4.276260] calling  uncompress_ll_init+0x0/0x0
> [4.276260] initcall uncompress_ll_init+0x0/0x0 returned 0 after 0 msecs.
> [4.276260] Freeing init memory: 0K

Umm, what happened to sysfs not becoming procfs v2?  I thought we had
a fairly strict requirement for "one value per file and not nicely
formatted" for sysfs?

> > >Author: Lee Jones 
> > >Date:   Wed Jun 30 14:00:40 2010 +0200
> > >
> > > Boottime: A tool for automatic measurement of kernel/bootloader boot 
> > > time
> > > The overhead is very low and the results will be found under
> > > sysfs/bootime, as well as detailed results in debugfs under
> > > boottime/. The bootgraph* files are compatible with
> > > scripts/bootgraph.pl. The reason for this patch is to provide
> > > data (sysfs/boottime) suitable for automatic test-cases as
> > > well as help for developers to reduce the boot time (debugfs).
> > > Based heavily on the original driver by Jonas Aaberg.
> > > Cc: Russell King 
> > > Cc: Will Deacon 
> > > Signed-off-by: Jonas Aaberg 
> > > Signed-off-by: Mian Yousaf Kaukab 
> > > Signed-off-by: Lee Jones 
> > > Reviewed-by: Srinidhi KASAGAR 
> > > Tested-by: Mian Yousaf KAUKAB 
> > >
> > >diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
> > >index e8a4e58..8522356 100644
> > >--- a/arch/arm/common/Makefile
> > >+++ b/arch/arm/common/Makefile
> > >@@ -13,3 +13,4 @@ obj-$(CONFIG_SHARP_PARAM)+= sharpsl_param.o
> > >  obj-$(CONFIG_SHARP_SCOOP)+= scoop.o
> > >  obj-$(CONFIG_PCI_HOST_ITE8152)  += it8152.o
> > >  obj-$(CONFIG_ARM_TIMER_SP804)+= timer-sp.o
> > >+obj-$(CONFIG_BOOTTIME)+= boottime.o
> > >diff --git a/arch/arm/common/boottime.c b/arch/arm/common/boottime.c
> > >new file mode 100644
> > >index 000..73e9e04
> > >--- /dev/null
> > >+++ b/arch/arm/common/boottime.c
> > >@@ -0,0 +1,46 @@
> > >+/*
> > >+ * Copyright (C) ST-Ericsson SA 2009-2010
> > >+ *
> > >+ * Author: Jonas Aaberg  for ST-Ericsson
> > >+ *
> > >+ * License terms: GNU General Public License (GPL) version 2
> > >+ *
> > >+ * Store boot times measured during for example u-boot startup.
> > >+ */
> > >+
> > >+#include 
> > >+#include 
> > >+#include 
> > >+#include 
> > >+#include 
> > >+
> > >+static u32 bootloader_idle;
> > >+static u32 bootloader_total;
> > >+
> > >+static int __init boottime_parse_tag(const struct tag *tag)
> > >+{
> > >+  int i;
> > >+  char buff[BOOTTIME_MAX_NAME_LEN];
> > >+
> > >+  bootloader_idle = tag->u.boottime.idle;
> > >+  bootloader_total = tag->u.boottime.total;
> > >+
> > >+  for (i = 0; i < tag->u.boottime.num; i++) {
> > >+  snprintf(buff, BOOTTIME_MAX_NAME_LEN, "%s+0x0/0x0",
> > >+   tag->u.boottime.entry[i].name);
> > >+  buff[BOOTTIME_MAX_NAME_LEN - 1] = '\0';
> > >+  boottime_mark_wtime(buff, tag->u.boottime.entry[i].time);
> > >+  }
> > >+
> > >+  return 0;
> > >+}
> > >+
> > >+__tagtable(ATAG_BOOTTIME,  boottime_parse_tag);
> > >+
> > >+int boottime_bootloader_idle(void)
> > >+{
> > >+  if (bootloader_total == 0)
> > >+  return 0;
> > >+
> > >+  return (int) ((bootloader_idle) / (bootloader_total / 100));
> > >+}
> > >diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
> > >index 24d284a..e8da062 100644
> > >--- a/arch/arm/include/asm/setup.h
> > >+++ b/arch/arm/include/asm/setup.h
> > >@@ -143,6 +143,23 @@ struct tag_memclk {
> > >   __u32 fmemclk;
> > >  };
> > >+/* for automatic boot timing testcases */
> > >+#define ATAG_BOOTTIME  0x41000403
> > >+#define BOOTTIME_MAX_NAME_LEN 64
> > >+#define BOOTTIME_MAX 10
> > >+
> > >+struct boottime_entry {
> > >+  u32 time; /* in us */
> > >+  u8  name[BOOTTIME_MAX_NAME_LEN];
> > >+};
> > >+
> > >+struct tag_boottime {
> > >+  struct boottime_entry entry[BOOTTIME_MAX];
> > >+  u32 idle;  /* in us */
> > >+  u32 total; /* in us */
> > >+  u8 num;
> > >+};
> > >+
> > >  struct tag {
> > >   struct tag_header hdr;
> > >   union {
> > >@@ -165,6 +182,10 @@ struct tag {
> > >* DC21285 specific
> > >*/
> > >   struct tag_memclk   memclk;
> > >+  /*
> > >+   * Boot t

Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-12 Thread Lee Jones
On Fri, 12 Oct 2012, Dan Murphy wrote:

> On a note on testing.
> 
> OK this at least compiles on my system with 3.4.
> 
> The weird thing is that I get the same exact kernel boot time for
> two different machines.
> When I cat the summary for the kernel.
> I am not profiling the bootloader time here as it is neglible so no
> ATAG argument.
> 
> kernel: 3221288 msecs
> total: 3221288 msecs
> kernel: cpu0 system: 0% idle: 0% iowait: 0% irq: 0% cpu1 system: 0%
> idle: 0% iowait: 0% irq: 0%
> 
> And I get no output from any of the bootgraph entries.

That's odd. I get:

root@ME:/ cat sys/boottime/bootloader 
0

root@ME:/ cat sys/boottime/kernel 
4276

root@ME:/ cat /sys/kernel/debug/boottime/summary 
kernel: 4276 msecs
total: 4276 msecs

root@ME:/ cat /sys/kernel/debug/boottime/bootgraph
[0.185254] calling  splash+0x0/0x0
[2.984335] initcall splash+0x0/0x0 returned 0 after 2799 msecs.
[2.984335] calling  autoboot_delay+0x0/0x0
[4.089513] initcall autoboot_delay+0x0/0x0 returned 0 after 1105 msecs.
[4.089513] calling  load_kernel+0x0/0x0
[4.239174] initcall load_kernel+0x0/0x0 returned 0 after 149 msecs.
[4.239174] calling  boot_kernel+0x0/0x0
[4.276260] initcall boot_kernel+0x0/0x0 returned 0 after 37 msecs.
[4.276260] calling  uncompress_ll_init+0x0/0x0
[4.276260] initcall uncompress_ll_init+0x0/0x0 returned 0 after 0 msecs.
[4.276260] Freeing init memory: 0K

> >Author: Lee Jones 
> >Date:   Wed Jun 30 14:00:40 2010 +0200
> >
> > Boottime: A tool for automatic measurement of kernel/bootloader boot 
> > time
> > The overhead is very low and the results will be found under
> > sysfs/bootime, as well as detailed results in debugfs under
> > boottime/. The bootgraph* files are compatible with
> > scripts/bootgraph.pl. The reason for this patch is to provide
> > data (sysfs/boottime) suitable for automatic test-cases as
> > well as help for developers to reduce the boot time (debugfs).
> > Based heavily on the original driver by Jonas Aaberg.
> > Cc: Russell King 
> > Cc: Will Deacon 
> > Signed-off-by: Jonas Aaberg 
> > Signed-off-by: Mian Yousaf Kaukab 
> > Signed-off-by: Lee Jones 
> > Reviewed-by: Srinidhi KASAGAR 
> > Tested-by: Mian Yousaf KAUKAB 
> >
> >diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
> >index e8a4e58..8522356 100644
> >--- a/arch/arm/common/Makefile
> >+++ b/arch/arm/common/Makefile
> >@@ -13,3 +13,4 @@ obj-$(CONFIG_SHARP_PARAM)  += sharpsl_param.o
> >  obj-$(CONFIG_SHARP_SCOOP)  += scoop.o
> >  obj-$(CONFIG_PCI_HOST_ITE8152)  += it8152.o
> >  obj-$(CONFIG_ARM_TIMER_SP804)  += timer-sp.o
> >+obj-$(CONFIG_BOOTTIME)  += boottime.o
> >diff --git a/arch/arm/common/boottime.c b/arch/arm/common/boottime.c
> >new file mode 100644
> >index 000..73e9e04
> >--- /dev/null
> >+++ b/arch/arm/common/boottime.c
> >@@ -0,0 +1,46 @@
> >+/*
> >+ * Copyright (C) ST-Ericsson SA 2009-2010
> >+ *
> >+ * Author: Jonas Aaberg  for ST-Ericsson
> >+ *
> >+ * License terms: GNU General Public License (GPL) version 2
> >+ *
> >+ * Store boot times measured during for example u-boot startup.
> >+ */
> >+
> >+#include 
> >+#include 
> >+#include 
> >+#include 
> >+#include 
> >+
> >+static u32 bootloader_idle;
> >+static u32 bootloader_total;
> >+
> >+static int __init boottime_parse_tag(const struct tag *tag)
> >+{
> >+int i;
> >+char buff[BOOTTIME_MAX_NAME_LEN];
> >+
> >+bootloader_idle = tag->u.boottime.idle;
> >+bootloader_total = tag->u.boottime.total;
> >+
> >+for (i = 0; i < tag->u.boottime.num; i++) {
> >+snprintf(buff, BOOTTIME_MAX_NAME_LEN, "%s+0x0/0x0",
> >+ tag->u.boottime.entry[i].name);
> >+buff[BOOTTIME_MAX_NAME_LEN - 1] = '\0';
> >+boottime_mark_wtime(buff, tag->u.boottime.entry[i].time);
> >+}
> >+
> >+return 0;
> >+}
> >+
> >+__tagtable(ATAG_BOOTTIME,  boottime_parse_tag);
> >+
> >+int boottime_bootloader_idle(void)
> >+{
> >+if (bootloader_total == 0)
> >+return 0;
> >+
> >+return (int) ((bootloader_idle) / (bootloader_total / 100));
> >+}
> >diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
> >index 24d284a..e8da062 100644
> >--- a/arch/arm/include/asm/setup.h
> >+++ b/arch/arm/include/asm/setup.h
> >@@ -143,6 +143,23 @@ struct tag_memclk {
> > __u32 fmemclk;
> >  };
> >+/* for automatic boot timing testcases */
> >+#define ATAG_BOOTTIME  0x41000403
> >+#define BOOTTIME_MAX_NAME_LEN 64
> >+#define BOOTTIME_MAX 10
> >+
> >+struct boottime_entry {
> >+u32 time; /* in us */
> >+u8  name[BOOTTIME_MAX_NAME_LEN];
> >+};
> >+
> >+struct tag_boottime {
> >+struct boottime_entry entry[BOOTTIME_MAX];
> >+u32 idle;  /* in us */
> >+u32 total; /* in us */
> >+u8 num;
> >+};
> >+
> >  struct tag {
> > struct tag_header hdr;
> > union {
> >@@ -165,6 +182,10 @@ struct tag {
> >  * DC21285 specific
> >  

Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-12 Thread Dan Murphy

On a note on testing.

OK this at least compiles on my system with 3.4.

The weird thing is that I get the same exact kernel boot time for two 
different machines.

When I cat the summary for the kernel.
I am not profiling the bootloader time here as it is neglible so no ATAG 
argument.


kernel: 3221288 msecs
total: 3221288 msecs
kernel: cpu0 system: 0% idle: 0% iowait: 0% irq: 0% cpu1 system: 0% 
idle: 0% iowait: 0% irq: 0%


And I get no output from any of the bootgraph entries.

Dan

On 10/12/2012 04:51 AM, Lee Jones wrote:

Okay, please disgard the last patch. Lots of fixups since.

Author: Lee Jones 
Date:   Wed Jun 30 14:00:40 2010 +0200

 Boottime: A tool for automatic measurement of kernel/bootloader boot time
 
 The overhead is very low and the results will be found under

 sysfs/bootime, as well as detailed results in debugfs under
 boottime/. The bootgraph* files are compatible with
 scripts/bootgraph.pl. The reason for this patch is to provide
 data (sysfs/boottime) suitable for automatic test-cases as
 well as help for developers to reduce the boot time (debugfs).
 
 Based heavily on the original driver by Jonas Aaberg.
 
 Cc: Russell King 

 Cc: Will Deacon 
 Signed-off-by: Jonas Aaberg 
 Signed-off-by: Mian Yousaf Kaukab 
 Signed-off-by: Lee Jones 
 Reviewed-by: Srinidhi KASAGAR 
 Tested-by: Mian Yousaf KAUKAB 

diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index e8a4e58..8522356 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -13,3 +13,4 @@ obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
  obj-$(CONFIG_SHARP_SCOOP) += scoop.o
  obj-$(CONFIG_PCI_HOST_ITE8152)  += it8152.o
  obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
+obj-$(CONFIG_BOOTTIME) += boottime.o
diff --git a/arch/arm/common/boottime.c b/arch/arm/common/boottime.c
new file mode 100644
index 000..73e9e04
--- /dev/null
+++ b/arch/arm/common/boottime.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2009-2010
+ *
+ * Author: Jonas Aaberg  for ST-Ericsson
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ *
+ * Store boot times measured during for example u-boot startup.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static u32 bootloader_idle;
+static u32 bootloader_total;
+
+static int __init boottime_parse_tag(const struct tag *tag)
+{
+   int i;
+   char buff[BOOTTIME_MAX_NAME_LEN];
+
+   bootloader_idle = tag->u.boottime.idle;
+   bootloader_total = tag->u.boottime.total;
+
+   for (i = 0; i < tag->u.boottime.num; i++) {
+   snprintf(buff, BOOTTIME_MAX_NAME_LEN, "%s+0x0/0x0",
+tag->u.boottime.entry[i].name);
+   buff[BOOTTIME_MAX_NAME_LEN - 1] = '\0';
+   boottime_mark_wtime(buff, tag->u.boottime.entry[i].time);
+   }
+
+   return 0;
+}
+
+__tagtable(ATAG_BOOTTIME,  boottime_parse_tag);
+
+int boottime_bootloader_idle(void)
+{
+   if (bootloader_total == 0)
+   return 0;
+
+   return (int) ((bootloader_idle) / (bootloader_total / 100));
+}
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 24d284a..e8da062 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -143,6 +143,23 @@ struct tag_memclk {
__u32 fmemclk;
  };
  
+/* for automatic boot timing testcases */

+#define ATAG_BOOTTIME  0x41000403
+#define BOOTTIME_MAX_NAME_LEN 64
+#define BOOTTIME_MAX 10
+
+struct boottime_entry {
+   u32 time; /* in us */
+   u8  name[BOOTTIME_MAX_NAME_LEN];
+};
+
+struct tag_boottime {
+   struct boottime_entry entry[BOOTTIME_MAX];
+   u32 idle;  /* in us */
+   u32 total; /* in us */
+   u8 num;
+};
+
  struct tag {
struct tag_header hdr;
union {
@@ -165,6 +182,10 @@ struct tag {
 * DC21285 specific
 */
struct tag_memclk   memclk;
+   /*
+* Boot time
+*/
+   struct tag_boottime boottime;
} u;
  };
  
diff --git a/include/linux/boottime.h b/include/linux/boottime.h

new file mode 100644
index 000..d330ecd
--- /dev/null
+++ b/include/linux/boottime.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2009-2010
+ *
+ * Author: Jonas Aaberg  for ST-Ericsson
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ *
+ * boottime is a tool for collecting start-up timing
+ * information and can together with boot loader support
+ * display a total system start-up time.
+ *
+ */
+
+#ifndef LINUX_BOOTTIME_H
+#define LINUX_BOOTTIME_H
+
+#ifdef CONFIG_BOOTTIME
+#include 
+
+/**
+ * struct boottime_timer - Callbacks for generic timer.
+ * @init: Function to call at boottime initialization
+ * @get_time: Returns the number of us since start-up
+ *Preferable this is based upon a free running timer.
+ *This is the only requi

Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-12 Thread Lee Jones
Okay, please disgard the last patch. Lots of fixups since.

Author: Lee Jones 
Date:   Wed Jun 30 14:00:40 2010 +0200

Boottime: A tool for automatic measurement of kernel/bootloader boot time

The overhead is very low and the results will be found under
sysfs/bootime, as well as detailed results in debugfs under
boottime/. The bootgraph* files are compatible with
scripts/bootgraph.pl. The reason for this patch is to provide
data (sysfs/boottime) suitable for automatic test-cases as
well as help for developers to reduce the boot time (debugfs).

Based heavily on the original driver by Jonas Aaberg.

Cc: Russell King 
Cc: Will Deacon 
Signed-off-by: Jonas Aaberg 
Signed-off-by: Mian Yousaf Kaukab 
Signed-off-by: Lee Jones 
Reviewed-by: Srinidhi KASAGAR 
Tested-by: Mian Yousaf KAUKAB 

diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index e8a4e58..8522356 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -13,3 +13,4 @@ obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
 obj-$(CONFIG_SHARP_SCOOP)  += scoop.o
 obj-$(CONFIG_PCI_HOST_ITE8152)  += it8152.o
 obj-$(CONFIG_ARM_TIMER_SP804)  += timer-sp.o
+obj-$(CONFIG_BOOTTIME) += boottime.o
diff --git a/arch/arm/common/boottime.c b/arch/arm/common/boottime.c
new file mode 100644
index 000..73e9e04
--- /dev/null
+++ b/arch/arm/common/boottime.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2009-2010
+ *
+ * Author: Jonas Aaberg  for ST-Ericsson
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ *
+ * Store boot times measured during for example u-boot startup.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static u32 bootloader_idle;
+static u32 bootloader_total;
+
+static int __init boottime_parse_tag(const struct tag *tag)
+{
+   int i;
+   char buff[BOOTTIME_MAX_NAME_LEN];
+
+   bootloader_idle = tag->u.boottime.idle;
+   bootloader_total = tag->u.boottime.total;
+
+   for (i = 0; i < tag->u.boottime.num; i++) {
+   snprintf(buff, BOOTTIME_MAX_NAME_LEN, "%s+0x0/0x0",
+tag->u.boottime.entry[i].name);
+   buff[BOOTTIME_MAX_NAME_LEN - 1] = '\0';
+   boottime_mark_wtime(buff, tag->u.boottime.entry[i].time);
+   }
+
+   return 0;
+}
+
+__tagtable(ATAG_BOOTTIME,  boottime_parse_tag);
+
+int boottime_bootloader_idle(void)
+{
+   if (bootloader_total == 0)
+   return 0;
+
+   return (int) ((bootloader_idle) / (bootloader_total / 100));
+}
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 24d284a..e8da062 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -143,6 +143,23 @@ struct tag_memclk {
__u32 fmemclk;
 };
 
+/* for automatic boot timing testcases */
+#define ATAG_BOOTTIME  0x41000403
+#define BOOTTIME_MAX_NAME_LEN 64
+#define BOOTTIME_MAX 10
+
+struct boottime_entry {
+   u32 time; /* in us */
+   u8  name[BOOTTIME_MAX_NAME_LEN];
+};
+
+struct tag_boottime {
+   struct boottime_entry entry[BOOTTIME_MAX];
+   u32 idle;  /* in us */
+   u32 total; /* in us */
+   u8 num;
+};
+
 struct tag {
struct tag_header hdr;
union {
@@ -165,6 +182,10 @@ struct tag {
 * DC21285 specific
 */
struct tag_memclk   memclk;
+   /*
+* Boot time
+*/
+   struct tag_boottime boottime;
} u;
 };
 
diff --git a/include/linux/boottime.h b/include/linux/boottime.h
new file mode 100644
index 000..d330ecd
--- /dev/null
+++ b/include/linux/boottime.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2009-2010
+ *
+ * Author: Jonas Aaberg  for ST-Ericsson
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ *
+ * boottime is a tool for collecting start-up timing
+ * information and can together with boot loader support
+ * display a total system start-up time.
+ *
+ */
+
+#ifndef LINUX_BOOTTIME_H
+#define LINUX_BOOTTIME_H
+
+#ifdef CONFIG_BOOTTIME
+#include 
+
+/**
+ * struct boottime_timer - Callbacks for generic timer.
+ * @init: Function to call at boottime initialization
+ * @get_time: Returns the number of us since start-up
+ *Preferable this is based upon a free running timer.
+ *This is the only required entry.
+ * @finalize: Called before init is executed and boottime is done.
+ */
+struct boottime_timer {
+   int (*init)(void);
+   unsigned long (*get_time)(void);
+   void (*finalize)(void);
+};
+
+/**
+ * boottime_mark_wtime()
+ * Add a sample point with a given time. Useful for adding data collected
+ * by for example a boot loader.
+ * @name: The name of the sample point
+ * @time: The time in us when this point was reached
+ */
+void __init boottime_mark_wtime(char *name, unsigned long time);
+
+/**
+ * boottime_mark()
+ * Add a sample 

Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-12 Thread Lee Jones
On Thu, 11 Oct 2012, Nishanth Menon wrote:

> On 15:42-20121011, Lee Jones wrote:
> > From: Jonas Aaberg 
> > 
> > The overhead is very low and the results will be found under
> > sysfs/bootime, as well as detailed results in debugfs under
> > boottime/. The bootgraph* files are compatible with
> > scripts/bootgraph.pl. The reason for this patch is to provide
> > data (sysfs/boottime) suitable for automatic testcases as
> > well as help for developers to reduce the boot time (debugfs).
> Tried master:
> 250d8 Merge branch 'i2c-embedded/for-next' of 
> git://git.pengutronix.de/git/wsa/linux
> and v3.6-rc7
> with omap2plus_defconfig + CONFIG_BOOTTIME enabled:
> 
> init/boottime.c:47:9: error: ‘cpu_usage_stat’ defined as wrong kind of tag
> init/boottime.c:47:24: error: array type has incomplete element type
> init/boottime.c: In function ‘boottime_mark_core’:
> init/boottime.c:127:313: error: ‘struct kernel_stat’ has no member named 
> ‘cpustat’
> init/boottime.c:128:311: error: ‘struct kernel_stat’ has no member named 
> ‘cpustat’
> init/boottime.c:129:313: error: ‘struct kernel_stat’ has no member named 
> ‘cpustat’
> init/boottime.c:130:310: error: ‘struct kernel_stat’ has no member named 
> ‘cpustat’
> 
> if it depended on some other patch or a specific maintainer branch,
> it was'nt clear.

No, this is completely my fault.

There are added dependencies and fixups that I missed.

I'll fixup and resubmit.

Unfortunately, there are now other authors involved, so I need to
seek permission before squashing them in. Please bear with me.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-11 Thread Nishanth Menon
On 15:42-20121011, Lee Jones wrote:
> From: Jonas Aaberg 
> 
> The overhead is very low and the results will be found under
> sysfs/bootime, as well as detailed results in debugfs under
> boottime/. The bootgraph* files are compatible with
> scripts/bootgraph.pl. The reason for this patch is to provide
> data (sysfs/boottime) suitable for automatic testcases as
> well as help for developers to reduce the boot time (debugfs).
Tried master:
250d8 Merge branch 'i2c-embedded/for-next' of 
git://git.pengutronix.de/git/wsa/linux
and v3.6-rc7
with omap2plus_defconfig + CONFIG_BOOTTIME enabled:

init/boottime.c:47:9: error: ‘cpu_usage_stat’ defined as wrong kind of tag
init/boottime.c:47:24: error: array type has incomplete element type
init/boottime.c: In function ‘boottime_mark_core’:
init/boottime.c:127:313: error: ‘struct kernel_stat’ has no member named 
‘cpustat’
init/boottime.c:128:311: error: ‘struct kernel_stat’ has no member named 
‘cpustat’
init/boottime.c:129:313: error: ‘struct kernel_stat’ has no member named 
‘cpustat’
init/boottime.c:130:310: error: ‘struct kernel_stat’ has no member named 
‘cpustat’

if it depended on some other patch or a specific maintainer branch,
it was'nt clear.
-- 
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-11 Thread Lee Jones
On Thu, 11 Oct 2012, Christian Gmeiner wrote:

> 2012/10/11 Lee Jones :
> > From: Jonas Aaberg 
> >
> > The overhead is very low and the results will be found under
> > sysfs/bootime, as well as detailed results in debugfs under
> > boottime/. The bootgraph* files are compatible with
> > scripts/bootgraph.pl. The reason for this patch is to provide
> > data (sysfs/boottime) suitable for automatic testcases as
> > well as help for developers to reduce the boot time (debugfs).
> >
> 
> Nice idea... what about x86?

What about it?

You want to extend the functionality to include it? :)

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time

2012-10-11 Thread Lee Jones
From: Jonas Aaberg 

The overhead is very low and the results will be found under
sysfs/bootime, as well as detailed results in debugfs under
boottime/. The bootgraph* files are compatible with
scripts/bootgraph.pl. The reason for this patch is to provide
data (sysfs/boottime) suitable for automatic testcases as
well as help for developers to reduce the boot time (debugfs).

Cc: Russell King 
Cc: Will Deacon 
Signed-off-by: Jonas Aaberg 
Signed-off-by: Mian Yousaf Kaukab 
Signed-off-by: Lee Jones 
Reviewed-by: Srinidhi KASAGAR 
Tested-by: Mian Yousaf KAUKAB 
---
 arch/arm/common/Makefile |1 +
 arch/arm/common/boottime.c   |   46 +
 arch/arm/include/asm/setup.h |   21 ++
 include/linux/boottime.h |   89 
 init/Kconfig |9 +
 init/Makefile|1 +
 init/boottime.c  |  467 ++
 init/main.c  |6 +
 8 files changed, 640 insertions(+)
 create mode 100644 arch/arm/common/boottime.c
 create mode 100644 include/linux/boottime.h
 create mode 100644 init/boottime.c

diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index e8a4e58..8522356 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -13,3 +13,4 @@ obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
 obj-$(CONFIG_SHARP_SCOOP)  += scoop.o
 obj-$(CONFIG_PCI_HOST_ITE8152)  += it8152.o
 obj-$(CONFIG_ARM_TIMER_SP804)  += timer-sp.o
+obj-$(CONFIG_BOOTTIME) += boottime.o
diff --git a/arch/arm/common/boottime.c b/arch/arm/common/boottime.c
new file mode 100644
index 000..73e9e04
--- /dev/null
+++ b/arch/arm/common/boottime.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2009-2010
+ *
+ * Author: Jonas Aaberg  for ST-Ericsson
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ *
+ * Store boot times measured during for example u-boot startup.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static u32 bootloader_idle;
+static u32 bootloader_total;
+
+static int __init boottime_parse_tag(const struct tag *tag)
+{
+   int i;
+   char buff[BOOTTIME_MAX_NAME_LEN];
+
+   bootloader_idle = tag->u.boottime.idle;
+   bootloader_total = tag->u.boottime.total;
+
+   for (i = 0; i < tag->u.boottime.num; i++) {
+   snprintf(buff, BOOTTIME_MAX_NAME_LEN, "%s+0x0/0x0",
+tag->u.boottime.entry[i].name);
+   buff[BOOTTIME_MAX_NAME_LEN - 1] = '\0';
+   boottime_mark_wtime(buff, tag->u.boottime.entry[i].time);
+   }
+
+   return 0;
+}
+
+__tagtable(ATAG_BOOTTIME,  boottime_parse_tag);
+
+int boottime_bootloader_idle(void)
+{
+   if (bootloader_total == 0)
+   return 0;
+
+   return (int) ((bootloader_idle) / (bootloader_total / 100));
+}
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 24d284a..e8da062 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -143,6 +143,23 @@ struct tag_memclk {
__u32 fmemclk;
 };
 
+/* for automatic boot timing testcases */
+#define ATAG_BOOTTIME  0x41000403
+#define BOOTTIME_MAX_NAME_LEN 64
+#define BOOTTIME_MAX 10
+
+struct boottime_entry {
+   u32 time; /* in us */
+   u8  name[BOOTTIME_MAX_NAME_LEN];
+};
+
+struct tag_boottime {
+   struct boottime_entry entry[BOOTTIME_MAX];
+   u32 idle;  /* in us */
+   u32 total; /* in us */
+   u8 num;
+};
+
 struct tag {
struct tag_header hdr;
union {
@@ -165,6 +182,10 @@ struct tag {
 * DC21285 specific
 */
struct tag_memclk   memclk;
+   /*
+* Boot time
+*/
+   struct tag_boottime boottime;
} u;
 };
 
diff --git a/include/linux/boottime.h b/include/linux/boottime.h
new file mode 100644
index 000..9836c5b
--- /dev/null
+++ b/include/linux/boottime.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2009-2010
+ *
+ * Author: Jonas Aaberg  for ST-Ericsson
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ *
+ * boottime is a tool for collecting start-up timing
+ * information and can together with boot loader support
+ * display a total system start-up time.
+ *
+ */
+
+#ifndef LINUX_BOOTTIME_H
+#define LINUX_BOOTTIME_H
+
+#ifdef CONFIG_BOOTTIME
+#include 
+
+/**
+ * struct boottime_timer - Callbacks for generic timer.
+ * @init: Function to call at boottime initialization
+ * @get_time: Returns the number of us since start-up
+ *Preferable this is based upon a free running timer.
+ *This is the only required entry.
+ * @finalize: Called before init is executed and boottime is done.
+ */
+struct boottime_timer {
+   int (*init)(void);
+   unsigned long (*get_time)(void);
+   void (*finalize)(void);
+};
+
+/**
+ * boottime_mark_wtime()
+ * Add a sample point with a given time. Useful for adding data collected
+ * by for