diff options
-rw-r--r-- | scripts/bootgraph.pl | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index d459b8bdef0..c34b359c34a 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 | ||
40 | my @rows; | 40 | my %start, %end; |
41 | my %start, %end, %row; | ||
42 | my $done = 0; | 41 | my $done = 0; |
43 | my $rowcount = 0; | ||
44 | my $maxtime = 0; | 42 | my $maxtime = 0; |
45 | my $count = 0; | 43 | my $count = 0; |
44 | my %pids; | ||
45 | |||
46 | while (<>) { | 46 | while (<>) { |
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( | |||
102 | my $mult = 950.0 / $maxtime; | 96 | my $mult = 950.0 / $maxtime; |
103 | my $threshold = 0.0500 / $maxtime; | 97 | my $threshold = 0.0500 / $maxtime; |
104 | my $stylecounter = 0; | 98 | my $stylecounter = 0; |
99 | my %rows; | ||
100 | my $rowscount = 1; | ||
105 | while (($key,$value) = each %start) { | 101 | while (($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]; |