tracing/fastboot: fix initcalls disposition in bootgraph.pl
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. [ mingo@elte.hu: resolved conflicts ] Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
8a5d900cca
commit
ddc7a01aad
@ -37,12 +37,12 @@
|
|||||||
# dmesg | perl scripts/bootgraph.pl > output.svg
|
# dmesg | perl scripts/bootgraph.pl > output.svg
|
||||||
#
|
#
|
||||||
|
|
||||||
my @rows;
|
my %start, %end;
|
||||||
my %start, %end, %row;
|
|
||||||
my $done = 0;
|
my $done = 0;
|
||||||
my $rowcount = 0;
|
|
||||||
my $maxtime = 0;
|
my $maxtime = 0;
|
||||||
my $count = 0;
|
my $count = 0;
|
||||||
|
my %pids;
|
||||||
|
|
||||||
while (<>) {
|
while (<>) {
|
||||||
my $line = $_;
|
my $line = $_;
|
||||||
if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z\_]+)\+/) {
|
if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z\_]+)\+/) {
|
||||||
@ -50,14 +50,8 @@ while (<>) {
|
|||||||
if ($done == 0) {
|
if ($done == 0) {
|
||||||
$start{$func} = $1;
|
$start{$func} = $1;
|
||||||
}
|
}
|
||||||
$row{$func} = 1;
|
|
||||||
if ($line =~ /\@ ([0-9]+)/) {
|
if ($line =~ /\@ ([0-9]+)/) {
|
||||||
my $pid = $1;
|
$pids{$func} = $1;
|
||||||
if (!defined($rows[$pid])) {
|
|
||||||
$rowcount = $rowcount + 1;
|
|
||||||
$rows[$pid] = $rowcount;
|
|
||||||
}
|
|
||||||
$row{$func} = $rows[$pid];
|
|
||||||
}
|
}
|
||||||
$count = $count + 1;
|
$count = $count + 1;
|
||||||
}
|
}
|
||||||
@ -102,17 +96,25 @@ $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(
|
|||||||
my $mult = 950.0 / $maxtime;
|
my $mult = 950.0 / $maxtime;
|
||||||
my $threshold = 0.0500 / $maxtime;
|
my $threshold = 0.0500 / $maxtime;
|
||||||
my $stylecounter = 0;
|
my $stylecounter = 0;
|
||||||
|
my %rows;
|
||||||
|
my $rowscount = 1;
|
||||||
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, $y;
|
||||||
$s = $value * $mult;
|
$pid = $pids{$key};
|
||||||
|
|
||||||
|
if (!defined($rows{$pid})) {
|
||||||
|
$rows{$pid} = $rowscount;
|
||||||
|
$rowscount = $rowscount + 1;
|
||||||
|
}
|
||||||
|
$s = ($value - $firsttime) * $mult;
|
||||||
$s2 = $s + 6;
|
$s2 = $s + 6;
|
||||||
$e = $end{$key} * $mult;
|
$e = $end{$key} * $mult;
|
||||||
$w = $e - $s;
|
$w = $e - $s;
|
||||||
|
|
||||||
$y = $row{$key} * 150;
|
$y = $rows{$pid} * 150;
|
||||||
$y2 = $y + 4;
|
$y2 = $y + 4;
|
||||||
|
|
||||||
$style = $styles[$stylecounter];
|
$style = $styles[$stylecounter];
|
||||||
|
Loading…
Reference in New Issue
Block a user