public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Arjan van de Ven" <arjan@infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/2] fastboot: fix row order in bootgraph.pl
Date: Tue, 14 Oct 2008 14:19:15 +0100	[thread overview]
Message-ID: <48F49C53.1070103@tuffmail.co.uk> (raw)
In-Reply-To: <48F49C0F.7050705@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.

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;



  reply	other threads:[~2008-10-14 13:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2008-10-14 14:01   ` Re : [PATCH 2/2] fastboot: fix row order in bootgraph.pl 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

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=48F49C53.1070103@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=arjan@infradead.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox