All of lore.kernel.org
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time
Date: Fri, 12 Oct 2012 17:42:21 +0100	[thread overview]
Message-ID: <20121012164221.GN12567@gmail.com> (raw)
In-Reply-To: <50784729.4030302@ti.com>

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 at 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 <jonas.aberg@stericsson.com>
Date:   Wed Sep 14 09:29:20 2011 +0200

    drivers: clocksource: dbx500-prcmu: Add boottime support
    
    Change-Id: I9b5e3d050131c08c08786ae84cb76619c0525049
    Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
    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 <linux/clockchips.h>
 #include <linux/clksrc-dbx500-prcmu.h>
+#include <linux/boottime.h>
 
 #include <asm/sched_clock.h>
 
@@ -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

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Dan Murphy <dmurphy@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nishanth Menon <nm@ti.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linus.walleij@stericsson.com,
	Jonas Aaberg <jonas.aberg@stericsson.com>,
	Will Deacon <will.deacon@arm.com>,
	Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Subject: Re: [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time
Date: Fri, 12 Oct 2012 17:42:21 +0100	[thread overview]
Message-ID: <20121012164221.GN12567@gmail.com> (raw)
In-Reply-To: <50784729.4030302@ti.com>

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 <jonas.aberg@stericsson.com>
Date:   Wed Sep 14 09:29:20 2011 +0200

    drivers: clocksource: dbx500-prcmu: Add boottime support
    
    Change-Id: I9b5e3d050131c08c08786ae84cb76619c0525049
    Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
    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 <linux/clockchips.h>
 #include <linux/clksrc-dbx500-prcmu.h>
+#include <linux/boottime.h>
 
 #include <asm/sched_clock.h>
 
@@ -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

  reply	other threads:[~2012-10-12 16:42 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 14:42 [PATCH] Boottime: A tool for automatic measurement of kernel/bootloader boot time Lee Jones
2012-10-11 14:42 ` Lee Jones
2012-10-11 15:24 ` Christian Gmeiner
2012-10-11 15:24   ` Christian Gmeiner
2012-10-11 15:36   ` Lee Jones
2012-10-11 15:36     ` Lee Jones
2012-10-11 20:17 ` Nishanth Menon
2012-10-11 20:17   ` Nishanth Menon
2012-10-12  9:37   ` Lee Jones
2012-10-12  9:37     ` Lee Jones
2012-10-12  9:51   ` Lee Jones
2012-10-12  9:51     ` Lee Jones
2012-10-12 13:35     ` Dan Murphy
2012-10-12 13:35       ` Dan Murphy
2012-10-12 13:45       ` Lee Jones
2012-10-12 13:45         ` Lee Jones
2012-10-12 13:48         ` Russell King - ARM Linux
2012-10-12 13:48           ` Russell King - ARM Linux
2012-10-12 13:53           ` Arnd Bergmann
2012-10-12 13:53             ` Arnd Bergmann
2012-10-12 14:01             ` Lee Jones
2012-10-12 14:01               ` Lee Jones
2012-10-12 16:36               ` Dan Murphy
2012-10-12 16:36                 ` Dan Murphy
2012-10-12 16:42                 ` Lee Jones [this message]
2012-10-12 16:42                   ` Lee Jones
2012-10-15 15:52                   ` Dan Murphy
2012-10-15 15:52                     ` Dan Murphy
2012-10-16  7:34                     ` Lee Jones
2012-10-16  7:34                       ` Lee Jones
2012-10-23  7:19                     ` Lee Jones
2012-10-23  7:19                       ` Lee Jones
2013-06-09  8:17                       ` Steve Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121012164221.GN12567@gmail.com \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.