Skip to content

Commit

Permalink
tracing/fastboot: fix row order in bootgraph.pl
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Frédéric Weisbecker <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Alan Jenkins authored and Ingo Molnar committed Oct 22, 2008
1 parent 2a813f8 commit 06d1cd2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/bootgraph.pl
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@
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) {
Expand All @@ -121,7 +121,7 @@
$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;
Expand Down

0 comments on commit 06d1cd2

Please sign in to comment.