aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/bootgraph.pl
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-09-14 18:30:52 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-14 04:39:32 -0400
commit80a398a55d3096ff4572b44271d095413749ebb4 (patch)
tree68f28bd08c66f6f81174150116e0459cfa87a15d /scripts/bootgraph.pl
parent231375cc5cc3549bb413f94a164bdcbd5f9ce943 (diff)
tracing/fastboot: fix issues and improve output of bootgraph.pl
David Sanders reported some issues with bootgraph.pl's display of his sytems bootup; this commit fixes these by scaling the graph not from 0 - end time but from the first initcall to the end time; the minimum display size etc also now need to scale with this, as does the axis display. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Diffstat (limited to 'scripts/bootgraph.pl')
-rw-r--r--scripts/bootgraph.pl29
1 files changed, 16 insertions, 13 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index c34b359c34a3..4baf49985589 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -40,6 +40,7 @@
40my %start, %end; 40my %start, %end;
41my $done = 0; 41my $done = 0;
42my $maxtime = 0; 42my $maxtime = 0;
43my $firsttime = 100;
43my $count = 0; 44my $count = 0;
44my %pids; 45my %pids;
45 46
@@ -49,6 +50,9 @@ while (<>) {
49 my $func = $2; 50 my $func = $2;
50 if ($done == 0) { 51 if ($done == 0) {
51 $start{$func} = $1; 52 $start{$func} = $1;
53 if ($1 < $firsttime) {
54 $firsttime = $1;
55 }
52 } 56 }
53 if ($line =~ /\@ ([0-9]+)/) { 57 if ($line =~ /\@ ([0-9]+)/) {
54 $pids{$func} = $1; 58 $pids{$func} = $1;
@@ -65,6 +69,9 @@ while (<>) {
65 if ($line =~ /Write protecting the/) { 69 if ($line =~ /Write protecting the/) {
66 $done = 1; 70 $done = 1;
67 } 71 }
72 if ($line =~ /Freeing unused kernel memory/) {
73 $done = 1;
74 }
68} 75}
69 76
70if ($count == 0) { 77if ($count == 0) {
@@ -93,8 +100,8 @@ $styles[9] = "fill:rgb(255,255,128);fill-opacity:0.5;stroke-width:1;stroke:rgb(0
93$styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; 100$styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
94$styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; 101$styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
95 102
96my $mult = 950.0 / $maxtime; 103my $mult = 950.0 / ($maxtime - $firsttime);
97my $threshold = 0.0500 / $maxtime; 104my $threshold = ($maxtime - $firsttime) / 60.0;
98my $stylecounter = 0; 105my $stylecounter = 0;
99my %rows; 106my %rows;
100my $rowscount = 1; 107my $rowscount = 1;
@@ -103,15 +110,9 @@ while (($key,$value) = each %start) {
103 110
104 if ($duration >= $threshold) { 111 if ($duration >= $threshold) {
105 my $s, $s2, $e, $y; 112 my $s, $s2, $e, $y;
106 $pid = $pids{$key};
107
108 if (!defined($rows{$pid})) {
109 $rows{$pid} = $rowscount;
110 $rowscount = $rowscount + 1;
111 }
112 $s = ($value - $firsttime) * $mult; 113 $s = ($value - $firsttime) * $mult;
113 $s2 = $s + 6; 114 $s2 = $s + 6;
114 $e = $end{$key} * $mult; 115 $e = ($end{$key} - $firsttime) * $mult;
115 $w = $e - $s; 116 $w = $e - $s;
116 117
117 $y = $rows{$pid} * 150; 118 $y = $rows{$pid} * 150;
@@ -130,11 +131,13 @@ while (($key,$value) = each %start) {
130 131
131 132
132# print the time line on top 133# print the time line on top
133my $time = 0.0; 134my $time = $firsttime;
135my $step = ($maxtime - $firsttime) / 15;
134while ($time < $maxtime) { 136while ($time < $maxtime) {
135 my $s2 = $time * $mult; 137 my $s2 = ($time - $firsttime) * $mult;
136 print "<text transform=\"translate($s2,89) rotate(90)\">$time</text>\n"; 138 my $tm = int($time * 100) / 100.0;
137 $time = $time + 0.1; 139 print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n";
140 $time = $time + $step;
138} 141}
139 142
140print "</svg>\n"; 143print "</svg>\n";