diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2008-09-14 18:30:52 -0400 |
---|---|---|
committer | Arjan van de Ven <arjan@linux.intel.com> | 2008-10-12 11:07:37 -0400 |
commit | 709790a9aafe424785dd02bcb31b0dddb4ef59e4 (patch) | |
tree | 9e3e58b20451553987ec165c3273699b6fb5bb54 /scripts | |
parent | f9b9796ade7609cd62571d38f064e20c77d31281 (diff) |
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')
-rw-r--r-- | scripts/bootgraph.pl | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index d459b8bdef02..4e5f4ab2ed7f 100644 --- a/scripts/bootgraph.pl +++ b/scripts/bootgraph.pl | |||
@@ -42,6 +42,7 @@ my %start, %end, %row; | |||
42 | my $done = 0; | 42 | my $done = 0; |
43 | my $rowcount = 0; | 43 | my $rowcount = 0; |
44 | my $maxtime = 0; | 44 | my $maxtime = 0; |
45 | my $firsttime = 100; | ||
45 | my $count = 0; | 46 | my $count = 0; |
46 | while (<>) { | 47 | while (<>) { |
47 | my $line = $_; | 48 | my $line = $_; |
@@ -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 | $row{$func} = 1; | 57 | $row{$func} = 1; |
54 | if ($line =~ /\@ ([0-9]+)/) { | 58 | if ($line =~ /\@ ([0-9]+)/) { |
@@ -71,6 +75,9 @@ while (<>) { | |||
71 | if ($line =~ /Write protecting the/) { | 75 | if ($line =~ /Write protecting the/) { |
72 | $done = 1; | 76 | $done = 1; |
73 | } | 77 | } |
78 | if ($line =~ /Freeing unused kernel memory/) { | ||
79 | $done = 1; | ||
80 | } | ||
74 | } | 81 | } |
75 | 82 | ||
76 | if ($count == 0) { | 83 | if ($count == 0) { |
@@ -99,17 +106,17 @@ $styles[9] = "fill:rgb(255,255,128);fill-opacity:0.5;stroke-width:1;stroke:rgb(0 | |||
99 | $styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; | 106 | $styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; |
100 | $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; | 107 | $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; |
101 | 108 | ||
102 | my $mult = 950.0 / $maxtime; | 109 | my $mult = 950.0 / ($maxtime - $firsttime); |
103 | my $threshold = 0.0500 / $maxtime; | 110 | my $threshold = ($maxtime - $firsttime) / 60.0; |
104 | my $stylecounter = 0; | 111 | my $stylecounter = 0; |
105 | while (($key,$value) = each %start) { | 112 | while (($key,$value) = each %start) { |
106 | my $duration = $end{$key} - $start{$key}; | 113 | my $duration = $end{$key} - $start{$key}; |
107 | 114 | ||
108 | if ($duration >= $threshold) { | 115 | if ($duration >= $threshold) { |
109 | my $s, $s2, $e, $y; | 116 | my $s, $s2, $e, $y; |
110 | $s = $value * $mult; | 117 | $s = ($value - $firsttime) * $mult; |
111 | $s2 = $s + 6; | 118 | $s2 = $s + 6; |
112 | $e = $end{$key} * $mult; | 119 | $e = ($end{$key} - $firsttime) * $mult; |
113 | $w = $e - $s; | 120 | $w = $e - $s; |
114 | 121 | ||
115 | $y = $row{$key} * 150; | 122 | $y = $row{$key} * 150; |
@@ -128,11 +135,13 @@ while (($key,$value) = each %start) { | |||
128 | 135 | ||
129 | 136 | ||
130 | # print the time line on top | 137 | # print the time line on top |
131 | my $time = 0.0; | 138 | my $time = $firsttime; |
139 | my $step = ($maxtime - $firsttime) / 15; | ||
132 | while ($time < $maxtime) { | 140 | while ($time < $maxtime) { |
133 | my $s2 = $time * $mult; | 141 | my $s2 = ($time - $firsttime) * $mult; |
134 | print "<text transform=\"translate($s2,89) rotate(90)\">$time</text>\n"; | 142 | my $tm = int($time * 100) / 100.0; |
135 | $time = $time + 0.1; | 143 | print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n"; |
144 | $time = $time + $step; | ||
136 | } | 145 | } |
137 | 146 | ||
138 | print "</svg>\n"; | 147 | print "</svg>\n"; |