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>
This commit is contained in:
Alan Jenkins 2008-10-14 14:18:07 +01:00 committed by Ingo Molnar
parent 17d80fd07d
commit 2a813f8cd8
1 changed files with 10 additions and 5 deletions

View File

@ -37,7 +37,10 @@
# dmesg | perl scripts/bootgraph.pl > output.svg # dmesg | perl scripts/bootgraph.pl > output.svg
# #
my %start, %end; use strict;
my %start;
my %end;
my $done = 0; my $done = 0;
my $maxtime = 0; my $maxtime = 0;
my $firsttime = 100; my $firsttime = 100;
@ -105,12 +108,14 @@ my $threshold = ($maxtime - $firsttime) / 60.0;
my $stylecounter = 0; my $stylecounter = 0;
my %rows; my %rows;
my $rowscount = 1; my $rowscount = 1;
my $key;
my $value;
while (($key,$value) = each %start) { while (($key,$value) = each %start) {
my $duration = $end{$key} - $start{$key}; my $duration = $end{$key} - $start{$key};
if ($duration >= $threshold) { if ($duration >= $threshold) {
my $s, $s2, $e, $y; my ($s, $s2, $e, $w, $y, $y2, $style);
$pid = $pids{$key}; my $pid = $pids{$key};
if (!defined($rows{$pid})) { if (!defined($rows{$pid})) {
$rows{$pid} = $rowscount; $rows{$pid} = $rowscount;
@ -140,9 +145,9 @@ while (($key,$value) = each %start) {
my $time = $firsttime; my $time = $firsttime;
my $step = ($maxtime - $firsttime) / 15; my $step = ($maxtime - $firsttime) / 15;
while ($time < $maxtime) { while ($time < $maxtime) {
my $s2 = ($time - $firsttime) * $mult; my $s3 = ($time - $firsttime) * $mult;
my $tm = int($time * 100) / 100.0; my $tm = int($time * 100) / 100.0;
print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n"; print "<text transform=\"translate($s3,89) rotate(90)\">$tm</text>\n";
$time = $time + $step; $time = $time + $step;
} }