aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/bootgraph.pl25
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;
42my $done = 0; 42my $done = 0;
43my $rowcount = 0; 43my $rowcount = 0;
44my $maxtime = 0; 44my $maxtime = 0;
45my $firsttime = 100;
45my $count = 0; 46my $count = 0;
46while (<>) { 47while (<>) {
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
76if ($count == 0) { 83if ($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
102my $mult = 950.0 / $maxtime; 109my $mult = 950.0 / ($maxtime - $firsttime);
103my $threshold = 0.0500 / $maxtime; 110my $threshold = ($maxtime - $firsttime) / 60.0;
104my $stylecounter = 0; 111my $stylecounter = 0;
105while (($key,$value) = each %start) { 112while (($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
131my $time = 0.0; 138my $time = $firsttime;
139my $step = ($maxtime - $firsttime) / 15;
132while ($time < $maxtime) { 140while ($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
138print "</svg>\n"; 147print "</svg>\n";