Skip to content

Commit 2a813f8

Browse files
Alan JenkinsIngo Molnar
authored andcommitted
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>
1 parent 17d80fd commit 2a813f8

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

scripts/bootgraph.pl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
# dmesg | perl scripts/bootgraph.pl > output.svg
3838
#
3939

40-
my %start, %end;
40+
use strict;
41+
42+
my %start;
43+
my %end;
4144
my $done = 0;
4245
my $maxtime = 0;
4346
my $firsttime = 100;
@@ -105,12 +108,14 @@
105108
my $stylecounter = 0;
106109
my %rows;
107110
my $rowscount = 1;
111+
my $key;
112+
my $value;
108113
while (($key,$value) = each %start) {
109114
my $duration = $end{$key} - $start{$key};
110115

111116
if ($duration >= $threshold) {
112-
my $s, $s2, $e, $y;
113-
$pid = $pids{$key};
117+
my ($s, $s2, $e, $w, $y, $y2, $style);
118+
my $pid = $pids{$key};
114119

115120
if (!defined($rows{$pid})) {
116121
$rows{$pid} = $rowscount;
@@ -140,9 +145,9 @@
140145
my $time = $firsttime;
141146
my $step = ($maxtime - $firsttime) / 15;
142147
while ($time < $maxtime) {
143-
my $s2 = ($time - $firsttime) * $mult;
148+
my $s3 = ($time - $firsttime) * $mult;
144149
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";
146151
$time = $time + $step;
147152
}
148153

0 commit comments

Comments
 (0)