Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bootgraph: make the bootgraph script show async waiting time

It is useful for diagnosing boot performance to see where async function
calls are waiting on serialization... this patch adds this
functionality to the bootgraph.pl script.

The waiting time is shown as a half transparent, gray bar through the
block that is waiting.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arjan van de Ven and committed by
Linus Torvalds
d3f8ddea fa853a48

+42 -4
+42 -4
scripts/bootgraph.pl
··· 41 41 42 42 my %start; 43 43 my %end; 44 + my %type; 44 45 my $done = 0; 45 46 my $maxtime = 0; 46 47 my $firsttime = 100; 47 48 my $count = 0; 48 49 my %pids; 50 + my %pidctr; 49 51 50 52 while (<>) { 51 53 my $line = $_; ··· 55 53 my $func = $2; 56 54 if ($done == 0) { 57 55 $start{$func} = $1; 56 + $type{$func} = 0; 58 57 if ($1 < $firsttime) { 59 58 $firsttime = $1; 60 59 } ··· 66 63 $count = $count + 1; 67 64 } 68 65 66 + if ($line =~ /([0-9\.]+)\] async_waiting @ ([0-9]+)/) { 67 + my $pid = $2; 68 + my $func; 69 + if (!defined($pidctr{$pid})) { 70 + $func = "wait_" . $pid . "_1"; 71 + $pidctr{$pid} = 1; 72 + } else { 73 + $pidctr{$pid} = $pidctr{$pid} + 1; 74 + $func = "wait_" . $pid . "_" . $pidctr{$pid}; 75 + } 76 + if ($done == 0) { 77 + $start{$func} = $1; 78 + $type{$func} = 1; 79 + if ($1 < $firsttime) { 80 + $firsttime = $1; 81 + } 82 + } 83 + $pids{$func} = $pid; 84 + $count = $count + 1; 85 + } 86 + 69 87 if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_]+)\+.*returned/) { 70 88 if ($done == 0) { 71 89 $end{$2} = $1; 72 90 $maxtime = $1; 73 91 } 92 + } 93 + 94 + if ($line =~ /([0-9\.]+)\] async_continuing @ ([0-9]+)/) { 95 + my $pid = $2; 96 + my $func = "wait_" . $pid . "_" . $pidctr{$pid}; 97 + $end{$func} = $1; 98 + $maxtime = $1; 74 99 } 75 100 if ($line =~ /Write protecting the/) { 76 101 $done = 1; ··· 136 105 $styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; 137 106 $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; 138 107 108 + my $style_wait = "fill:rgb(128,128,128);fill-opacity:0.5;stroke-width:0;stroke:rgb(0,0,0)"; 109 + 139 110 my $mult = 1950.0 / ($maxtime - $firsttime); 140 111 my $threshold2 = ($maxtime - $firsttime) / 120.0; 141 112 my $threshold = $threshold2/10; ··· 172 139 $stylecounter = 0; 173 140 }; 174 141 175 - print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"145\" style=\"$style\"/>\n"; 176 - if ($duration >= $threshold2) { 177 - print "<text transform=\"translate($s2,$y2) rotate(90)\">$key</text>\n"; 142 + if ($type{$key} == 1) { 143 + $y = $y + 15; 144 + print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"115\" style=\"$style_wait\"/>\n"; 178 145 } else { 179 - print "<text transform=\"translate($s3,$y2) rotate(90)\" font-size=\"3pt\">$key</text>\n"; 146 + print "<rect x=\"$s\" width=\"$w\" y=\"$y\" height=\"145\" style=\"$style\"/>\n"; 147 + if ($duration >= $threshold2) { 148 + print "<text transform=\"translate($s2,$y2) rotate(90)\">$key</text>\n"; 149 + } else { 150 + print "<text transform=\"translate($s3,$y2) rotate(90)\" font-size=\"3pt\">$key</text>\n"; 151 + } 180 152 } 181 153 } 182 154 }