1 From 5470e09b98074974316bbf98c8b8da01d670c2a4 Mon Sep 17 00:00:00 2001
2 From: Arjan van de Ven <arjan@linux.intel.com>
3 Date: Sun, 14 Sep 2008 15:30:52 -0700
4 Subject: [PATCH] fastboot: fix issues and improve output of bootgraph.pl
6 David Sanders reported some issues with bootgraph.pl's display
7 of his sytems bootup; this commit fixes these by scaling the graph
8 not from 0 - end time but from the first initcall to the end time;
9 the minimum display size etc also now need to scale with this, as does
12 Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
14 scripts/bootgraph.pl | 25 +++++++++++++++++--------
15 1 files changed, 17 insertions(+), 8 deletions(-)
17 diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
18 index d459b8b..4e5f4ab 100644
19 --- a/scripts/bootgraph.pl
20 +++ b/scripts/bootgraph.pl
21 @@ -42,6 +42,7 @@ my %start, %end, %row;
29 @@ -49,6 +50,9 @@ while (<>) {
33 + if ($1 < $firsttime) {
38 if ($line =~ /\@ ([0-9]+)/) {
39 @@ -71,6 +75,9 @@ while (<>) {
40 if ($line =~ /Write protecting the/) {
43 + if ($line =~ /Freeing unused kernel memory/) {
49 @@ -99,17 +106,17 @@ $styles[9] = "fill:rgb(255,255,128);fill-opacity:0.5;stroke-width:1;stroke:rgb(0
50 $styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
51 $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
53 -my $mult = 950.0 / $maxtime;
54 -my $threshold = 0.0500 / $maxtime;
55 +my $mult = 950.0 / ($maxtime - $firsttime);
56 +my $threshold = ($maxtime - $firsttime) / 60.0;
58 while (($key,$value) = each %start) {
59 my $duration = $end{$key} - $start{$key};
61 if ($duration >= $threshold) {
63 - $s = $value * $mult;
64 + $s = ($value - $firsttime) * $mult;
66 - $e = $end{$key} * $mult;
67 + $e = ($end{$key} - $firsttime) * $mult;
70 $y = $row{$key} * 150;
71 @@ -128,11 +135,13 @@ while (($key,$value) = each %start) {
74 # print the time line on top
76 +my $time = $firsttime;
77 +my $step = ($maxtime - $firsttime) / 15;
78 while ($time < $maxtime) {
79 - my $s2 = $time * $mult;
80 - print "<text transform=\"translate($s2,89) rotate(90)\">$time</text>\n";
81 - $time = $time + 0.1;
82 + my $s2 = ($time - $firsttime) * $mult;
83 + my $tm = int($time * 100) / 100.0;
84 + print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n";
85 + $time = $time + $step;