aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/bootgraph.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bootgraph.pl')
-rw-r--r--scripts/bootgraph.pl19
1 files changed, 12 insertions, 7 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index 5e7316e5aa39..d2c61efc216f 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -37,7 +37,10 @@
37# dmesg | perl scripts/bootgraph.pl > output.svg 37# dmesg | perl scripts/bootgraph.pl > output.svg
38# 38#
39 39
40my %start, %end; 40use strict;
41
42my %start;
43my %end;
41my $done = 0; 44my $done = 0;
42my $maxtime = 0; 45my $maxtime = 0;
43my $firsttime = 100; 46my $firsttime = 100;
@@ -105,18 +108,20 @@ my $threshold = ($maxtime - $firsttime) / 60.0;
105my $stylecounter = 0; 108my $stylecounter = 0;
106my %rows; 109my %rows;
107my $rowscount = 1; 110my $rowscount = 1;
108while (($key,$value) = each %start) { 111my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start);
112my $key;
113foreach $key (@initcalls) {
109 my $duration = $end{$key} - $start{$key}; 114 my $duration = $end{$key} - $start{$key};
110 115
111 if ($duration >= $threshold) { 116 if ($duration >= $threshold) {
112 my $s, $s2, $e, $y; 117 my ($s, $s2, $e, $w, $y, $y2, $style);
113 $pid = $pids{$key}; 118 my $pid = $pids{$key};
114 119
115 if (!defined($rows{$pid})) { 120 if (!defined($rows{$pid})) {
116 $rows{$pid} = $rowscount; 121 $rows{$pid} = $rowscount;
117 $rowscount = $rowscount + 1; 122 $rowscount = $rowscount + 1;
118 } 123 }
119 $s = ($value - $firsttime) * $mult; 124 $s = ($start{$key} - $firsttime) * $mult;
120 $s2 = $s + 6; 125 $s2 = $s + 6;
121 $e = ($end{$key} - $firsttime) * $mult; 126 $e = ($end{$key} - $firsttime) * $mult;
122 $w = $e - $s; 127 $w = $e - $s;
@@ -140,9 +145,9 @@ while (($key,$value) = each %start) {
140my $time = $firsttime; 145my $time = $firsttime;
141my $step = ($maxtime - $firsttime) / 15; 146my $step = ($maxtime - $firsttime) / 15;
142while ($time < $maxtime) { 147while ($time < $maxtime) {
143 my $s2 = ($time - $firsttime) * $mult; 148 my $s3 = ($time - $firsttime) * $mult;
144 my $tm = int($time * 100) / 100.0; 149 my $tm = int($time * 100) / 100.0;
145 print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n"; 150 print "<text transform=\"translate($s3,89) rotate(90)\">$tm</text>\n";
146 $time = $time + $step; 151 $time = $time + $step;
147} 152}
148 153