Commit 06d1cd26 authored by Alan Jenkins's avatar Alan Jenkins Committed by Ingo Molnar

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: default avatarAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: default avatarFrédéric Weisbecker <fweisbec@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2a813f8c
...@@ -108,9 +108,9 @@ my $threshold = ($maxtime - $firsttime) / 60.0; ...@@ -108,9 +108,9 @@ my $threshold = ($maxtime - $firsttime) / 60.0;
my $stylecounter = 0; my $stylecounter = 0;
my %rows; my %rows;
my $rowscount = 1; my $rowscount = 1;
my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start);
my $key; my $key;
my $value; foreach $key (@initcalls) {
while (($key,$value) = each %start) {
my $duration = $end{$key} - $start{$key}; my $duration = $end{$key} - $start{$key};
if ($duration >= $threshold) { if ($duration >= $threshold) {
...@@ -121,7 +121,7 @@ while (($key,$value) = each %start) { ...@@ -121,7 +121,7 @@ while (($key,$value) = each %start) {
$rows{$pid} = $rowscount; $rows{$pid} = $rowscount;
$rowscount = $rowscount + 1; $rowscount = $rowscount + 1;
} }
$s = ($value - $firsttime) * $mult; $s = ($start{$key} - $firsttime) * $mult;
$s2 = $s + 6; $s2 = $s + 6;
$e = ($end{$key} - $firsttime) * $mult; $e = ($end{$key} - $firsttime) * $mult;
$w = $e - $s; $w = $e - $s;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment