public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] fastboot: fix bootgraph.pl to run with "use strict"
@ 2008-10-14 13:18 Alan Jenkins
  2008-10-14 13:19 ` [PATCH 2/2] fastboot: fix row order in bootgraph.pl Alan Jenkins
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Jenkins @ 2008-10-14 13:18 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: "Frédéric Weisbecker", Arjan van de Ven,
	linux-kernel

As a perl novice, I would prefer to have the benefit of the interpreters'
wisdom.  It turns out there were already some warnings, so let's fix them.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>

diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index 5e7316e..ea2b079 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -37,7 +37,10 @@
 # 	dmesg | perl scripts/bootgraph.pl > output.svg
 #
 
-my %start, %end;
+use strict;
+
+my %start;
+my %end;
 my $done = 0;
 my $maxtime = 0;
 my $firsttime = 100;
@@ -105,12 +108,14 @@ my $threshold = ($maxtime - $firsttime) / 60.0;
 my $stylecounter = 0;
 my %rows;
 my $rowscount = 1;
+my $key;
+my $value;
 while (($key,$value) = each %start) {
 	my $duration = $end{$key} - $start{$key};
 
 	if ($duration >= $threshold) {
-		my $s, $s2, $e, $y;
-		$pid = $pids{$key};
+		my ($s, $s2, $e, $w, $y, $y2, $style);
+		my $pid = $pids{$key};
 
 		if (!defined($rows{$pid})) {
 			$rows{$pid} = $rowscount;
@@ -140,9 +145,9 @@ while (($key,$value) = each %start) {
 my $time = $firsttime;
 my $step = ($maxtime - $firsttime) / 15;
 while ($time < $maxtime) {
-	my $s2 = ($time - $firsttime) * $mult;
+	my $s3 = ($time - $firsttime) * $mult;
 	my $tm = int($time * 100) / 100.0;
-	print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n";
+	print "<text transform=\"translate($s3,89) rotate(90)\">$tm</text>\n";
 	$time = $time + $step;
 }
 



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

* [PATCH 2/2] fastboot: fix row order in bootgraph.pl
  2008-10-14 13:18 [PATCH 1/2] fastboot: fix bootgraph.pl to run with "use strict" Alan Jenkins
@ 2008-10-14 13:19 ` Alan Jenkins
  2008-10-14 14:01   ` Re : " Frédéric Weisbecker
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Jenkins @ 2008-10-14 13:19 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Frédéric Weisbecker, Arjan van de Ven, linux-kernel

When bootgraph.pl parses a file, it gives one row for each initcall's 
pid.  But they are displayed in random (perl hash) order.  Let's
sort the pids by the start time of their first initcall instead.

This helps trace module initcalls, where each has a separate pid.  
bootgraph.pl will show module initcalls during the initramfs; it may
also be adapted to show subsequent module initcalls.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>

diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index ea2b079..d2c61ef 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -108,9 +108,9 @@ my $threshold = ($maxtime - $firsttime) / 60.0;
 my $stylecounter = 0;
 my %rows;
 my $rowscount = 1;
+my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start);
 my $key;
-my $value;
-while (($key,$value) = each %start) {
+foreach $key (@initcalls) {
 	my $duration = $end{$key} - $start{$key};
 
 	if ($duration >= $threshold) {
@@ -121,7 +121,7 @@ while (($key,$value) = each %start) {
 			$rows{$pid} = $rowscount;
 			$rowscount = $rowscount + 1;
 		}
-		$s = ($value - $firsttime) * $mult;
+		$s = ($start{$key} - $firsttime) * $mult;
 		$s2 = $s + 6;
 		$e = ($end{$key} - $firsttime) * $mult;
 		$w = $e - $s;



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

* Re : [PATCH 2/2] fastboot: fix row order in bootgraph.pl
  2008-10-14 13:19 ` [PATCH 2/2] fastboot: fix row order in bootgraph.pl Alan Jenkins
@ 2008-10-14 14:01   ` Frédéric Weisbecker
  2008-10-22 14:37     ` Ingo Molnar
  0 siblings, 1 reply; 6+ messages in thread
From: Frédéric Weisbecker @ 2008-10-14 14:01 UTC (permalink / raw)
  To: Alan Jenkins; +Cc: Ingo Molnar, Arjan van de Ven, linux-kernel

2008/10/14, Alan Jenkins <alan-jenkins@tuffmail.co.uk>:
> When bootgraph.pl parses a file, it gives one row for each initcall's
> pid.  But they are displayed in random (perl hash) order.  Let's
> sort the pids by the start time of their first initcall instead.

Thanks. That's a good idea!

I can't test it yet but I will give you a feedback as soon as I can.

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

* Re: Re : [PATCH 2/2] fastboot: fix row order in bootgraph.pl
  2008-10-14 14:01   ` Re : " Frédéric Weisbecker
@ 2008-10-22 14:37     ` Ingo Molnar
  2008-10-22 17:48       ` Steven Rostedt
  2008-10-22 17:56       ` Arjan van de Ven
  0 siblings, 2 replies; 6+ messages in thread
From: Ingo Molnar @ 2008-10-22 14:37 UTC (permalink / raw)
  To: Frédéric Weisbecker
  Cc: Alan Jenkins, Arjan van de Ven, linux-kernel, Steven Rostedt


* Frédéric Weisbecker <fweisbec@gmail.com> wrote:

> 2008/10/14, Alan Jenkins <alan-jenkins@tuffmail.co.uk>:
> > When bootgraph.pl parses a file, it gives one row for each initcall's
> > pid.  But they are displayed in random (perl hash) order.  Let's
> > sort the pids by the start time of their first initcall instead.
> 
> Thanks. That's a good idea!
> 
> I can't test it yet but I will give you a feedback as soon as I can.

i've applied the two fix patches from Alan to tip/tracing/urgent:

 06d1cd2: tracing/fastboot: fix row order in bootgraph.pl
 2a813f8: tracing/fastboot: fix bootgraph.pl to run with "use strict"

Arjan, Steve, any objections?

	Ingo

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

* Re: Re : [PATCH 2/2] fastboot: fix row order in bootgraph.pl
  2008-10-22 14:37     ` Ingo Molnar
@ 2008-10-22 17:48       ` Steven Rostedt
  2008-10-22 17:56       ` Arjan van de Ven
  1 sibling, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2008-10-22 17:48 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Frédéric Weisbecker, Alan Jenkins, Arjan van de Ven,
	linux-kernel


On Wed, 22 Oct 2008, Ingo Molnar wrote:
> 
> * Fr?d?ric Weisbecker <fweisbec@gmail.com> wrote:
> 
> > 2008/10/14, Alan Jenkins <alan-jenkins@tuffmail.co.uk>:
> > > When bootgraph.pl parses a file, it gives one row for each initcall's
> > > pid.  But they are displayed in random (perl hash) order.  Let's
> > > sort the pids by the start time of their first initcall instead.
> > 
> > Thanks. That's a good idea!
> > 
> > I can't test it yet but I will give you a feedback as soon as I can.
> 
> i've applied the two fix patches from Alan to tip/tracing/urgent:
> 
>  06d1cd2: tracing/fastboot: fix row order in bootgraph.pl
>  2a813f8: tracing/fastboot: fix bootgraph.pl to run with "use strict"
> 
> Arjan, Steve, any objections?

I have no objections.

-- Steve


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

* Re: Re : [PATCH 2/2] fastboot: fix row order in bootgraph.pl
  2008-10-22 14:37     ` Ingo Molnar
  2008-10-22 17:48       ` Steven Rostedt
@ 2008-10-22 17:56       ` Arjan van de Ven
  1 sibling, 0 replies; 6+ messages in thread
From: Arjan van de Ven @ 2008-10-22 17:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Frédéric Weisbecker, Alan Jenkins, linux-kernel,
	Steven Rostedt

On Wed, 22 Oct 2008 16:37:41 +0200
Ingo Molnar <mingo@elte.hu> wrote:

> 
> * Frédéric Weisbecker <fweisbec@gmail.com> wrote:
> 
> > 2008/10/14, Alan Jenkins <alan-jenkins@tuffmail.co.uk>:
> > > When bootgraph.pl parses a file, it gives one row for each
> > > initcall's pid.  But they are displayed in random (perl hash)
> > > order.  Let's sort the pids by the start time of their first
> > > initcall instead.
> > 
> > Thanks. That's a good idea!
> > 
> > I can't test it yet but I will give you a feedback as soon as I can.
> 
> i've applied the two fix patches from Alan to tip/tracing/urgent:
> 
>  06d1cd2: tracing/fastboot: fix row order in bootgraph.pl
>  2a813f8: tracing/fastboot: fix bootgraph.pl to run with "use strict"
> 
> Arjan, Steve, any objections?
> 
> 	Ingo
fine with me


-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

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

end of thread, other threads:[~2008-10-22 17:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-14 13:18 [PATCH 1/2] fastboot: fix bootgraph.pl to run with "use strict" Alan Jenkins
2008-10-14 13:19 ` [PATCH 2/2] fastboot: fix row order in bootgraph.pl Alan Jenkins
2008-10-14 14:01   ` Re : " Frédéric Weisbecker
2008-10-22 14:37     ` Ingo Molnar
2008-10-22 17:48       ` Steven Rostedt
2008-10-22 17:56       ` Arjan van de Ven

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