public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/bootgraph.pl: ignore times until the clock is running
@ 2010-03-18 17:49 Aaro Koskinen
  2010-03-18 18:24 ` Arjan van de Ven
  0 siblings, 1 reply; 3+ messages in thread
From: Aaro Koskinen @ 2010-03-18 17:49 UTC (permalink / raw)
  To: linux-kernel, arjan

The clock used for printk.time=1 does not necessarily start running
from zero. On such platforms the bootgraph does not work properly as
the calculated boottime will be too long.

To correct this, the patch modifies the script to accept only non-zero
start times. This ensures the report contains entries only from the
period when the clock was running.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 scripts/bootgraph.pl |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index 12caa82..ec57dd4 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -44,7 +44,7 @@ my %end;
 my %type;
 my $done = 0;
 my $maxtime = 0;
-my $firsttime = 100;
+my $firsttime = undef;
 my $count = 0;
 my %pids;
 my %pidctr;
@@ -54,10 +54,12 @@ while (<>) {
 	if ($line =~ /([0-9\.]+)\] calling  ([a-zA-Z0-9\_\.]+)\+/) {
 		my $func = $2;
 		if ($done == 0) {
-			$start{$func} = $1;
+			my $time = $1;
+			next unless $time =~ /[1-9]/;
+			$start{$func} = $time;
 			$type{$func} = 0;
-			if ($1 < $firsttime) {
-				$firsttime = $1;
+			if (not defined $firsttime) {
+				$firsttime = $time;
 			}
 		}
 		if ($line =~ /\@ ([0-9]+)/) {
@@ -77,10 +79,12 @@ while (<>) {
 			$func = "wait_" . $pid . "_" . $pidctr{$pid};
 		}
 		if ($done == 0) {
-			$start{$func} = $1;
+			my $time = $1;
+			next unless $time =~ /[1-9]/;
+			$start{$func} = $time;
 			$type{$func} = 1;
-			if ($1 < $firsttime) {
-				$firsttime = $1;
+			if (not defined $firsttime) {
+				$firsttime = $time;
 			}
 		}
 		$pids{$func} = $pid;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scripts/bootgraph.pl: ignore times until the clock is running
  2010-03-18 17:49 [PATCH] scripts/bootgraph.pl: ignore times until the clock is running Aaro Koskinen
@ 2010-03-18 18:24 ` Arjan van de Ven
  2010-03-19 14:15   ` Aaro Koskinen
  0 siblings, 1 reply; 3+ messages in thread
From: Arjan van de Ven @ 2010-03-18 18:24 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: linux-kernel

On 3/18/2010 10:49, Aaro Koskinen wrote:
> The clock used for printk.time=1 does not necessarily start running
> from zero. On such platforms the bootgraph does not work properly as
> the calculated boottime will be too long.

can we fix the platform to be smarter instead ? I'd think that's needed anyway for various
timers etc to actually work well

>
> To correct this, the patch modifies the script to accept only non-zero
> start times. This ensures the report contains entries only from the
> period when the clock was running.
>
> Signed-off-by: Aaro Koskinen<aaro.koskinen@nokia.com>

nothing wrong with the patch itself... just sad that it's needed to work around such bugs ;(

Acked-by: Arjan van de Ven <arjan@linux.intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scripts/bootgraph.pl: ignore times until the clock is running
  2010-03-18 18:24 ` Arjan van de Ven
@ 2010-03-19 14:15   ` Aaro Koskinen
  0 siblings, 0 replies; 3+ messages in thread
From: Aaro Koskinen @ 2010-03-19 14:15 UTC (permalink / raw)
  To: ext Arjan van de Ven, ext Tony Lindgren; +Cc: linux-kernel@vger.kernel.org

Hi,

Arjan van de Ven wrote:
> On 3/18/2010 10:49, Aaro Koskinen wrote:
>> The clock used for printk.time=1 does not necessarily start running
>> from zero. On such platforms the bootgraph does not work properly as
>> the calculated boottime will be too long.
> 
> can we fix the platform to be smarter instead ? I'd think that's needed anyway for various
> timers etc to actually work well

Hmm, on OMAP I have gotten so used to this "feature" that I never
thought it was a bug. However, I don't think it will affect anything
else than printk time stamps.

Anyway, I sent a fix proposal to linux-omap list:
http://marc.info/?l=linux-omap&m=126900738712041&w=2

>> To correct this, the patch modifies the script to accept only non-zero
>> start times. This ensures the report contains entries only from the
>> period when the clock was running.
>>
>> Signed-off-by: Aaro Koskinen<aaro.koskinen@nokia.com>
> 
> nothing wrong with the patch itself... just sad that it's needed to work around such bugs ;(
> 
> Acked-by: Arjan van de Ven <arjan@linux.intel.com>

I guess we can forget this patch if we agree the platform behaviour is
not correct.

A.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-19 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-18 17:49 [PATCH] scripts/bootgraph.pl: ignore times until the clock is running Aaro Koskinen
2010-03-18 18:24 ` Arjan van de Ven
2010-03-19 14:15   ` Aaro Koskinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox