提交 80a398a5 编写于 作者: A Arjan van de Ven 提交者: Ingo Molnar

tracing/fastboot: fix issues and improve output of bootgraph.pl

David Sanders reported some issues with bootgraph.pl's display
of his sytems bootup; this commit fixes these by scaling the graph
not from 0 - end time but from the first initcall to the end time;
the minimum display size etc also now need to scale with this, as does
the axis display.
Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
上级 231375cc
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
my %start, %end; my %start, %end;
my $done = 0; my $done = 0;
my $maxtime = 0; my $maxtime = 0;
my $firsttime = 100;
my $count = 0; my $count = 0;
my %pids; my %pids;
...@@ -49,6 +50,9 @@ while (<>) { ...@@ -49,6 +50,9 @@ while (<>) {
my $func = $2; my $func = $2;
if ($done == 0) { if ($done == 0) {
$start{$func} = $1; $start{$func} = $1;
if ($1 < $firsttime) {
$firsttime = $1;
}
} }
if ($line =~ /\@ ([0-9]+)/) { if ($line =~ /\@ ([0-9]+)/) {
$pids{$func} = $1; $pids{$func} = $1;
...@@ -65,6 +69,9 @@ while (<>) { ...@@ -65,6 +69,9 @@ while (<>) {
if ($line =~ /Write protecting the/) { if ($line =~ /Write protecting the/) {
$done = 1; $done = 1;
} }
if ($line =~ /Freeing unused kernel memory/) {
$done = 1;
}
} }
if ($count == 0) { 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,8 +100,8 @@ $styles[9] = "fill:rgb(255,255,128);fill-opacity:0.5;stroke-width:1;stroke:rgb(0
$styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; $styles[10] = "fill:rgb(255,128,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
$styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
my $mult = 950.0 / $maxtime; my $mult = 950.0 / ($maxtime - $firsttime);
my $threshold = 0.0500 / $maxtime; my $threshold = ($maxtime - $firsttime) / 60.0;
my $stylecounter = 0; my $stylecounter = 0;
my %rows; my %rows;
my $rowscount = 1; my $rowscount = 1;
...@@ -103,15 +110,9 @@ while (($key,$value) = each %start) { ...@@ -103,15 +110,9 @@ while (($key,$value) = each %start) {
if ($duration >= $threshold) { if ($duration >= $threshold) {
my $s, $s2, $e, $y; my $s, $s2, $e, $y;
$pid = $pids{$key};
if (!defined($rows{$pid})) {
$rows{$pid} = $rowscount;
$rowscount = $rowscount + 1;
}
$s = ($value - $firsttime) * $mult; $s = ($value - $firsttime) * $mult;
$s2 = $s + 6; $s2 = $s + 6;
$e = $end{$key} * $mult; $e = ($end{$key} - $firsttime) * $mult;
$w = $e - $s; $w = $e - $s;
$y = $rows{$pid} * 150; $y = $rows{$pid} * 150;
...@@ -130,11 +131,13 @@ while (($key,$value) = each %start) { ...@@ -130,11 +131,13 @@ while (($key,$value) = each %start) {
# print the time line on top # print the time line on top
my $time = 0.0; my $time = $firsttime;
my $step = ($maxtime - $firsttime) / 15;
while ($time < $maxtime) { while ($time < $maxtime) {
my $s2 = $time * $mult; my $s2 = ($time - $firsttime) * $mult;
print "<text transform=\"translate($s2,89) rotate(90)\">$time</text>\n"; my $tm = int($time * 100) / 100.0;
$time = $time + 0.1; print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n";
$time = $time + $step;
} }
print "</svg>\n"; print "</svg>\n";
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册