diff options
-rw-r--r-- | scripts/bootgraph.pl | 29 |
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 @@ | |||
40 | my %start, %end; | 40 | my %start, %end; |
41 | my $done = 0; | 41 | my $done = 0; |
42 | my $maxtime = 0; | 42 | my $maxtime = 0; |
43 | my $firsttime = 100; | ||
43 | my $count = 0; | 44 | my $count = 0; |
44 | my %pids; | 45 | my %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 | ||
70 | if ($count == 0) { | 77 | if ($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 | ||
96 | my $mult = 950.0 / $maxtime; | 103 | my $mult = 950.0 / ($maxtime - $firsttime); |
97 | my $threshold = 0.0500 / $maxtime; | 104 | my $threshold = ($maxtime - $firsttime) / 60.0; |
98 | my $stylecounter = 0; | 105 | my $stylecounter = 0; |
99 | my %rows; | 106 | my %rows; |
100 | my $rowscount = 1; | 107 | my $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 |
133 | my $time = 0.0; | 134 | my $time = $firsttime; |
135 | my $step = ($maxtime - $firsttime) / 15; | ||
134 | while ($time < $maxtime) { | 136 | while ($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 | ||
140 | print "</svg>\n"; | 143 | print "</svg>\n"; |