aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/bootgraph.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bootgraph.pl')
-rw-r--r--scripts/bootgraph.pl56
1 files changed, 50 insertions, 6 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index f0af9aa9b243..b0246307aac4 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -41,11 +41,13 @@ use strict;
41 41
42my %start; 42my %start;
43my %end; 43my %end;
44my %type;
44my $done = 0; 45my $done = 0;
45my $maxtime = 0; 46my $maxtime = 0;
46my $firsttime = 100; 47my $firsttime = 100;
47my $count = 0; 48my $count = 0;
48my %pids; 49my %pids;
50my %pidctr;
49 51
50while (<>) { 52while (<>) {
51 my $line = $_; 53 my $line = $_;
@@ -53,6 +55,7 @@ while (<>) {
53 my $func = $2; 55 my $func = $2;
54 if ($done == 0) { 56 if ($done == 0) {
55 $start{$func} = $1; 57 $start{$func} = $1;
58 $type{$func} = 0;
56 if ($1 < $firsttime) { 59 if ($1 < $firsttime) {
57 $firsttime = $1; 60 $firsttime = $1;
58 } 61 }
@@ -63,12 +66,40 @@ while (<>) {
63 $count = $count + 1; 66 $count = $count + 1;
64 } 67 }
65 68
69 if ($line =~ /([0-9\.]+)\] async_waiting @ ([0-9]+)/) {
70 my $pid = $2;
71 my $func;
72 if (!defined($pidctr{$pid})) {
73 $func = "wait_" . $pid . "_1";
74 $pidctr{$pid} = 1;
75 } else {
76 $pidctr{$pid} = $pidctr{$pid} + 1;
77 $func = "wait_" . $pid . "_" . $pidctr{$pid};
78 }
79 if ($done == 0) {
80 $start{$func} = $1;
81 $type{$func} = 1;
82 if ($1 < $firsttime) {
83 $firsttime = $1;
84 }
85 }
86 $pids{$func} = $pid;
87 $count = $count + 1;
88 }
89
66 if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_]+)\+.*returned/) { 90 if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_]+)\+.*returned/) {
67 if ($done == 0) { 91 if ($done == 0) {
68 $end{$2} = $1; 92 $end{$2} = $1;
69 $maxtime = $1; 93 $maxtime = $1;
70 } 94 }
71 } 95 }
96
97 if ($line =~ /([0-9\.]+)\] async_continuing @ ([0-9]+)/) {
98 my $pid = $2;
99 my $func = "wait_" . $pid . "_" . $pidctr{$pid};
100 $end{$func} = $1;
101 $maxtime = $1;
102 }
72 if ($line =~ /Write protecting the/) { 103 if ($line =~ /Write protecting the/) {
73 $done = 1; 104 $done = 1;
74 } 105 }
@@ -88,7 +119,7 @@ END
88} 119}
89 120
90print "<?xml version=\"1.0\" standalone=\"no\"?> \n"; 121print "<?xml version=\"1.0\" standalone=\"no\"?> \n";
91print "<svg width=\"1000\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n"; 122print "<svg width=\"2000\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n";
92 123
93my @styles; 124my @styles;
94 125
@@ -105,8 +136,11 @@ $styles[9] = "fill:rgb(255,255,128);fill-opacity:0.5;stroke-width:1;stroke:rgb(0
105$styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; 136$styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
106$styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; 137$styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
107 138
108my $mult = 950.0 / ($maxtime - $firsttime); 139my $style_wait = "fill:rgb(128,128,128);fill-opacity:0.5;stroke-width:0;stroke:rgb(0,0,0)";
109my $threshold = ($maxtime - $firsttime) / 60.0; 140
141my $mult = 1950.0 / ($maxtime - $firsttime);
142my $threshold2 = ($maxtime - $firsttime) / 120.0;
143my $threshold = $threshold2/10;
110my $stylecounter = 0; 144my $stylecounter = 0;
111my %rows; 145my %rows;
112my $rowscount = 1; 146my $rowscount = 1;
@@ -116,7 +150,7 @@ foreach my $key (@initcalls) {
116 my $duration = $end{$key} - $start{$key}; 150 my $duration = $end{$key} - $start{$key};
117 151
118 if ($duration >= $threshold) { 152 if ($duration >= $threshold) {
119 my ($s, $s2, $e, $w, $y, $y2, $style); 153 my ($s, $s2, $s3, $e, $w, $y, $y2, $style);
120 my $pid = $pids{$key}; 154 my $pid = $pids{$key};
121 155
122 if (!defined($rows{$pid})) { 156 if (!defined($rows{$pid})) {
@@ -125,6 +159,7 @@ foreach my $key (@initcalls) {
125 } 159 }
126 $s = ($start{$key} - $firsttime) * $mult; 160 $s = ($start{$key} - $firsttime) * $mult;
127 $s2 = $s + 6; 161 $s2 = $s + 6;
162 $s3 = $s + 1;
128 $e = ($end{$key} - $firsttime) * $mult; 163 $e = ($end{$key} - $firsttime) * $mult;
129 $w = $e - $s; 164 $w = $e - $s;
130 165
@@ -137,8 +172,17 @@ foreach my $key (@initcalls) {
137 $stylecounter = 0; 172 $stylecounter = 0;
138 }; 173 };
139 174
140 print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"145\" style=\"$style\"/>\n"; 175 if ($type{$key} == 1) {
141 print "<text transform=\"translate($s2,$y2) rotate(90)\">$key</text>\n"; 176 $y = $y + 15;
177 print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"115\" style=\"$style_wait\"/>\n";
178 } else {
179 print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"145\" style=\"$style\"/>\n";
180 if ($duration >= $threshold2) {
181 print "<text transform=\"translate($s2,$y2) rotate(90)\">$key</text>\n";
182 } else {
183 print "<text transform=\"translate($s3,$y2) rotate(90)\" font-size=\"3pt\">$key</text>\n";
184 }
185 }
142 } 186 }
143} 187}
144 188