Skip to content

Commit 06d1cd2

Browse files
Alan JenkinsIngo Molnar
authored andcommitted
tracing/fastboot: fix row order in bootgraph.pl
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> Acked-by: Frédéric Weisbecker <fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 2a813f8 commit 06d1cd2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎scripts/bootgraph.pl‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@
108108
my $stylecounter = 0;
109109
my %rows;
110110
my $rowscount = 1;
111+
my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start);
111112
my $key;
112-
my $value;
113-
while (($key,$value) = each %start) {
113+
foreach $key (@initcalls) {
114114
my $duration = $end{$key} - $start{$key};
115115

116116
if ($duration >= $threshold) {
@@ -121,7 +121,7 @@
121121
$rows{$pid} = $rowscount;
122122
$rowscount = $rowscount + 1;
123123
}
124-
$s = ($value - $firsttime) * $mult;
124+
$s = ($start{$key} - $firsttime) * $mult;
125125
$s2 = $s + 6;
126126
$e = ($end{$key} - $firsttime) * $mult;
127127
$w = $e - $s;

0 commit comments

Comments
 (0)