Skip to content

Commit

Permalink
tracing/fastboot: fix initcalls disposition in bootgraph.pl
Browse files Browse the repository at this point in the history
When bootgraph.pl parses a file, it gives one row
for each initcall's pid. But only few of them will
be displayed => the longest.

This patch corrects it by giving only a rows for pids
which have initcalls that will be displayed.

[ [email protected]: resolved conflicts ]
Signed-off-by: Frederic Weisbecker <[email protected]>
Acked-by: Arjan van de Ven <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
fweisbec authored and Ingo Molnar committed Oct 14, 2008
1 parent 8a5d900 commit ddc7a01
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions scripts/bootgraph.pl
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,21 @@
# dmesg | perl scripts/bootgraph.pl > output.svg
#

my @rows;
my %start, %end, %row;
my %start, %end;
my $done = 0;
my $rowcount = 0;
my $maxtime = 0;
my $count = 0;
my %pids;

while (<>) {
my $line = $_;
if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z\_]+)\+/) {
my $func = $2;
if ($done == 0) {
$start{$func} = $1;
}
$row{$func} = 1;
if ($line =~ /\@ ([0-9]+)/) {
my $pid = $1;
if (!defined($rows[$pid])) {
$rowcount = $rowcount + 1;
$rows[$pid] = $rowcount;
}
$row{$func} = $rows[$pid];
$pids{$func} = $1;
}
$count = $count + 1;
}
Expand Down Expand Up @@ -102,17 +96,25 @@
my $mult = 950.0 / $maxtime;
my $threshold = 0.0500 / $maxtime;
my $stylecounter = 0;
my %rows;
my $rowscount = 1;
while (($key,$value) = each %start) {
my $duration = $end{$key} - $start{$key};

if ($duration >= $threshold) {
my $s, $s2, $e, $y;
$s = $value * $mult;
$pid = $pids{$key};

if (!defined($rows{$pid})) {
$rows{$pid} = $rowscount;
$rowscount = $rowscount + 1;
}
$s = ($value - $firsttime) * $mult;
$s2 = $s + 6;
$e = $end{$key} * $mult;
$w = $e - $s;

$y = $row{$key} * 150;
$y = $rows{$pid} * 150;
$y2 = $y + 4;

$style = $styles[$stylecounter];
Expand Down

0 comments on commit ddc7a01

Please sign in to comment.