diff options
Diffstat (limited to 'scripts/bootgraph.pl')
-rw-r--r-- | scripts/bootgraph.pl | 24 |
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 | ||
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 $firsttime = 100; | 43 | my $firsttime = 100; |
46 | my $count = 0; | 44 | my $count = 0; |
45 | my %pids; | ||
46 | |||
47 | while (<>) { | 47 | while (<>) { |
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( | |||
109 | my $mult = 950.0 / ($maxtime - $firsttime); | 103 | my $mult = 950.0 / ($maxtime - $firsttime); |
110 | my $threshold = ($maxtime - $firsttime) / 60.0; | 104 | my $threshold = ($maxtime - $firsttime) / 60.0; |
111 | my $stylecounter = 0; | 105 | my $stylecounter = 0; |
106 | my %rows; | ||
107 | my $rowscount = 1; | ||
112 | while (($key,$value) = each %start) { | 108 | while (($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]; |