aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/bootgraph.pl
diff options
context:
space:
mode:
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>2008-10-14 09:19:15 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-22 10:37:25 -0400
commit06d1cd267ca0a2a76beb9a762465572dd3d0cce6 (patch)
tree3ddbeffefd0ec34097fe1d9495afae25ef632611 /scripts/bootgraph.pl
parent2a813f8cd8ce91d588a595c5709502dece3af289 (diff)
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>
Diffstat (limited to 'scripts/bootgraph.pl')
-rw-r--r--scripts/bootgraph.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index ea2b079af9fd..d2c61efc216f 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -108,9 +108,9 @@ my $threshold = ($maxtime - $firsttime) / 60.0;
108my $stylecounter = 0; 108my $stylecounter = 0;
109my %rows; 109my %rows;
110my $rowscount = 1; 110my $rowscount = 1;
111my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start);
111my $key; 112my $key;
112my $value; 113foreach $key (@initcalls) {
113while (($key,$value) = each %start) {
114 my $duration = $end{$key} - $start{$key}; 114 my $duration = $end{$key} - $start{$key};
115 115
116 if ($duration >= $threshold) { 116 if ($duration >= $threshold) {
@@ -121,7 +121,7 @@ while (($key,$value) = each %start) {
121 $rows{$pid} = $rowscount; 121 $rows{$pid} = $rowscount;
122 $rowscount = $rowscount + 1; 122 $rowscount = $rowscount + 1;
123 } 123 }
124 $s = ($value - $firsttime) * $mult; 124 $s = ($start{$key} - $firsttime) * $mult;
125 $s2 = $s + 6; 125 $s2 = $s + 6;
126 $e = ($end{$key} - $firsttime) * $mult; 126 $e = ($end{$key} - $firsttime) * $mult;
127 $w = $e - $s; 127 $w = $e - $s;