diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2008-10-04 15:35:48 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-14 04:39:24 -0400 |
commit | ddc7a01aad195708fc943d9446411d11e3547784 (patch) | |
tree | e7b0343c8e11a06f7c90cda21bcf038a1be34941 /scripts/bootgraph.pl | |
parent | 8a5d900cca57115326bc5b9e7f3bac980986c2c8 (diff) |
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>
Diffstat (limited to 'scripts/bootgraph.pl')
-rw-r--r-- | scripts/bootgraph.pl | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index d459b8bdef02..c34b359c34a3 100644 --- a/scripts/bootgraph.pl +++ b/scripts/bootgraph.pl | |||
@@ -37,12 +37,12 @@ | |||
37 | # dmesg | perl scripts/bootgraph.pl > output.svg | 37 | # dmesg | perl scripts/bootgraph.pl > output.svg |
38 | # | 38 | # |
39 | 39 | ||
40 | my @rows; | 40 | my %start, %end; |
41 | my %start, %end, %row; | ||
42 | my $done = 0; | 41 | my $done = 0; |
43 | my $rowcount = 0; | ||
44 | my $maxtime = 0; | 42 | my $maxtime = 0; |
45 | my $count = 0; | 43 | my $count = 0; |
44 | my %pids; | ||
45 | |||
46 | while (<>) { | 46 | while (<>) { |
47 | my $line = $_; | 47 | my $line = $_; |
48 | if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z\_]+)\+/) { | 48 | if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z\_]+)\+/) { |
@@ -50,14 +50,8 @@ while (<>) { | |||
50 | if ($done == 0) { | 50 | if ($done == 0) { |
51 | $start{$func} = $1; | 51 | $start{$func} = $1; |
52 | } | 52 | } |
53 | $row{$func} = 1; | ||
54 | if ($line =~ /\@ ([0-9]+)/) { | 53 | if ($line =~ /\@ ([0-9]+)/) { |
55 | my $pid = $1; | 54 | $pids{$func} = $1; |
56 | if (!defined($rows[$pid])) { | ||
57 | $rowcount = $rowcount + 1; | ||
58 | $rows[$pid] = $rowcount; | ||
59 | } | ||
60 | $row{$func} = $rows[$pid]; | ||
61 | } | 55 | } |
62 | $count = $count + 1; | 56 | $count = $count + 1; |
63 | } | 57 | } |
@@ -102,17 +96,25 @@ $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb( | |||
102 | my $mult = 950.0 / $maxtime; | 96 | my $mult = 950.0 / $maxtime; |
103 | my $threshold = 0.0500 / $maxtime; | 97 | my $threshold = 0.0500 / $maxtime; |
104 | my $stylecounter = 0; | 98 | my $stylecounter = 0; |
99 | my %rows; | ||
100 | my $rowscount = 1; | ||
105 | while (($key,$value) = each %start) { | 101 | while (($key,$value) = each %start) { |
106 | my $duration = $end{$key} - $start{$key}; | 102 | my $duration = $end{$key} - $start{$key}; |
107 | 103 | ||
108 | if ($duration >= $threshold) { | 104 | if ($duration >= $threshold) { |
109 | my $s, $s2, $e, $y; | 105 | my $s, $s2, $e, $y; |
110 | $s = $value * $mult; | 106 | $pid = $pids{$key}; |
107 | |||
108 | if (!defined($rows{$pid})) { | ||
109 | $rows{$pid} = $rowscount; | ||
110 | $rowscount = $rowscount + 1; | ||
111 | } | ||
112 | $s = ($value - $firsttime) * $mult; | ||
111 | $s2 = $s + 6; | 113 | $s2 = $s + 6; |
112 | $e = $end{$key} * $mult; | 114 | $e = $end{$key} * $mult; |
113 | $w = $e - $s; | 115 | $w = $e - $s; |
114 | 116 | ||
115 | $y = $row{$key} * 150; | 117 | $y = $rows{$pid} * 150; |
116 | $y2 = $y + 4; | 118 | $y2 = $y + 4; |
117 | 119 | ||
118 | $style = $styles[$stylecounter]; | 120 | $style = $styles[$stylecounter]; |