aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/bootgraph.pl26
1 files changed, 14 insertions, 12 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index d459b8bdef02..c34b359c34a3 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -37,12 +37,12 @@
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 $count = 0; 43my $count = 0;
44my %pids;
45
46while (<>) { 46while (<>) {
47 my $line = $_; 47 my $line = $_;
48 if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z\_]+)\+/) { 48 if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z\_]+)\+/) {
@@ -50,14 +50,8 @@ while (<>) {
50 if ($done == 0) { 50 if ($done == 0) {
51 $start{$func} = $1; 51 $start{$func} = $1;
52 } 52 }
53 $row{$func} = 1;
54 if ($line =~ /\@ ([0-9]+)/) { 53 if ($line =~ /\@ ([0-9]+)/) {
55 my $pid = $1; 54 $pids{$func} = $1;
56 if (!defined($rows[$pid])) {
57 $rowcount = $rowcount + 1;
58 $rows[$pid] = $rowcount;
59 }
60 $row{$func} = $rows[$pid];
61 } 55 }
62 $count = $count + 1; 56 $count = $count + 1;
63 } 57 }
@@ -102,17 +96,25 @@ $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(
102my $mult = 950.0 / $maxtime; 96my $mult = 950.0 / $maxtime;
103my $threshold = 0.0500 / $maxtime; 97my $threshold = 0.0500 / $maxtime;
104my $stylecounter = 0; 98my $stylecounter = 0;
99my %rows;
100my $rowscount = 1;
105while (($key,$value) = each %start) { 101while (($key,$value) = each %start) {
106 my $duration = $end{$key} - $start{$key}; 102 my $duration = $end{$key} - $start{$key};
107 103
108 if ($duration >= $threshold) { 104 if ($duration >= $threshold) {
109 my $s, $s2, $e, $y; 105 my $s, $s2, $e, $y;
110 $s = $value * $mult; 106 $pid = $pids{$key};
107
108 if (!defined($rows{$pid})) {
109 $rows{$pid} = $rowscount;
110 $rowscount = $rowscount + 1;
111 }
112 $s = ($value - $firsttime) * $mult;
111 $s2 = $s + 6; 113 $s2 = $s + 6;
112 $e = $end{$key} * $mult; 114 $e = $end{$key} * $mult;
113 $w = $e - $s; 115 $w = $e - $s;
114 116
115 $y = $row{$key} * 150; 117 $y = $rows{$pid} * 150;
116 $y2 = $y + 4; 118 $y2 = $y + 4;
117 119
118 $style = $styles[$stylecounter]; 120 $style = $styles[$stylecounter];