aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2008-10-04 15:35:48 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-14 04:39:24 -0400
commitddc7a01aad195708fc943d9446411d11e3547784 (patch)
treee7b0343c8e11a06f7c90cda21bcf038a1be34941 /scripts
parent8a5d900cca57115326bc5b9e7f3bac980986c2c8 (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')
-rw-r--r--scripts/bootgraph.pl26
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
40my @rows; 40my %start, %end;
41my %start, %end, %row;
42my $done = 0; 41my $done = 0;
43my $rowcount = 0;
44my $maxtime = 0; 42my $maxtime = 0;
45my $count = 0; 43my $count = 0;
44my %pids;
45
46while (<>) { 46while (<>) {
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(
102my $mult = 950.0 / $maxtime; 96my $mult = 950.0 / $maxtime;
103my $threshold = 0.0500 / $maxtime; 97my $threshold = 0.0500 / $maxtime;
104my $stylecounter = 0; 98my $stylecounter = 0;
99my %rows;
100my $rowscount = 1;
105while (($key,$value) = each %start) { 101while (($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];