diff options
author | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2008-10-14 09:18:07 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-22 10:37:12 -0400 |
commit | 2a813f8cd8ce91d588a595c5709502dece3af289 (patch) | |
tree | 8695346bf06c22909574da1bd8f972119488f6bf /scripts/bootgraph.pl | |
parent | 17d80fd07d35ae1d231b3378ee4f00ace54f9d31 (diff) |
tracing/fastboot: fix bootgraph.pl to run with "use strict"
As a perl novice, I would prefer to have the benefit of the interpreters'
wisdom. It turns out there were already some warnings, so let's fix them.
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.pl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index 5e7316e5aa39..ea2b079af9fd 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 | ||
40 | my %start, %end; | 40 | use strict; |
41 | |||
42 | my %start; | ||
43 | my %end; | ||
41 | my $done = 0; | 44 | my $done = 0; |
42 | my $maxtime = 0; | 45 | my $maxtime = 0; |
43 | my $firsttime = 100; | 46 | my $firsttime = 100; |
@@ -105,12 +108,14 @@ my $threshold = ($maxtime - $firsttime) / 60.0; | |||
105 | my $stylecounter = 0; | 108 | my $stylecounter = 0; |
106 | my %rows; | 109 | my %rows; |
107 | my $rowscount = 1; | 110 | my $rowscount = 1; |
111 | my $key; | ||
112 | my $value; | ||
108 | while (($key,$value) = each %start) { | 113 | while (($key,$value) = each %start) { |
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; |
@@ -140,9 +145,9 @@ while (($key,$value) = each %start) { | |||
140 | my $time = $firsttime; | 145 | my $time = $firsttime; |
141 | my $step = ($maxtime - $firsttime) / 15; | 146 | my $step = ($maxtime - $firsttime) / 15; |
142 | while ($time < $maxtime) { | 147 | while ($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 | ||