aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/bootgraph.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bootgraph.pl')
-rw-r--r--scripts/bootgraph.pl24
1 files changed, 13 insertions, 11 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index 2243353fe55d..5e7316e5aa39 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -37,13 +37,13 @@
37# dmesg | perl scripts/bootgraph.pl > output.svg 37# dmesg | perl scripts/bootgraph.pl > output.svg
38# 38#
39 39
40my @rows; 40my %start, %end;
41my %start, %end, %row;
42my $done = 0; 41my $done = 0;
43my $rowcount = 0;
44my $maxtime = 0; 42my $maxtime = 0;
45my $firsttime = 100; 43my $firsttime = 100;
46my $count = 0; 44my $count = 0;
45my %pids;
46
47while (<>) { 47while (<>) {
48 my $line = $_; 48 my $line = $_;
49 if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_]+)\+/) { 49 if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_]+)\+/) {
@@ -54,14 +54,8 @@ while (<>) {
54 $firsttime = $1; 54 $firsttime = $1;
55 } 55 }
56 } 56 }
57 $row{$func} = 1;
58 if ($line =~ /\@ ([0-9]+)/) { 57 if ($line =~ /\@ ([0-9]+)/) {
59 my $pid = $1; 58 $pids{$func} = $1;
60 if (!defined($rows[$pid])) {
61 $rowcount = $rowcount + 1;
62 $rows[$pid] = $rowcount;
63 }
64 $row{$func} = $rows[$pid];
65 } 59 }
66 $count = $count + 1; 60 $count = $count + 1;
67 } 61 }
@@ -109,17 +103,25 @@ $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(
109my $mult = 950.0 / ($maxtime - $firsttime); 103my $mult = 950.0 / ($maxtime - $firsttime);
110my $threshold = ($maxtime - $firsttime) / 60.0; 104my $threshold = ($maxtime - $firsttime) / 60.0;
111my $stylecounter = 0; 105my $stylecounter = 0;
106my %rows;
107my $rowscount = 1;
112while (($key,$value) = each %start) { 108while (($key,$value) = each %start) {
113 my $duration = $end{$key} - $start{$key}; 109 my $duration = $end{$key} - $start{$key};
114 110
115 if ($duration >= $threshold) { 111 if ($duration >= $threshold) {
116 my $s, $s2, $e, $y; 112 my $s, $s2, $e, $y;
113 $pid = $pids{$key};
114
115 if (!defined($rows{$pid})) {
116 $rows{$pid} = $rowscount;
117 $rowscount = $rowscount + 1;
118 }
117 $s = ($value - $firsttime) * $mult; 119 $s = ($value - $firsttime) * $mult;
118 $s2 = $s + 6; 120 $s2 = $s + 6;
119 $e = ($end{$key} - $firsttime) * $mult; 121 $e = ($end{$key} - $firsttime) * $mult;
120 $w = $e - $s; 122 $w = $e - $s;
121 123
122 $y = $row{$key} * 150; 124 $y = $rows{$pid} * 150;
123 $y2 = $y + 4; 125 $y2 = $y + 4;
124 126
125 $style = $styles[$stylecounter]; 127 $style = $styles[$stylecounter];