my $done = 0;
my $rowcount = 0;
my $maxtime = 0;
+my $firsttime = 100;
my $count = 0;
while (<>) {
my $line = $_;
my $func = $2;
if ($done == 0) {
$start{$func} = $1;
+ if ($1 < $firsttime) {
+ $firsttime = $1;
+ }
}
$row{$func} = 1;
if ($line =~ /\@ ([0-9]+)/) {
if ($line =~ /Write protecting the/) {
$done = 1;
}
+ if ($line =~ /Freeing unused kernel memory/) {
+ $done = 1;
+ }
}
if ($count == 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)";
-my $mult = 950.0 / $maxtime;
-my $threshold = 0.0500 / $maxtime;
+my $mult = 950.0 / ($maxtime - $firsttime);
+my $threshold = ($maxtime - $firsttime) / 60.0;
my $stylecounter = 0;
while (($key,$value) = each %start) {
my $duration = $end{$key} - $start{$key};
if ($duration >= $threshold) {
my $s, $s2, $e, $y;
- $s = $value * $mult;
+ $s = ($value - $firsttime) * $mult;
$s2 = $s + 6;
- $e = $end{$key} * $mult;
+ $e = ($end{$key} - $firsttime) * $mult;
$w = $e - $s;
$y = $row{$key} * 150;
# print the time line on top
-my $time = 0.0;
+my $time = $firsttime;
+my $step = ($maxtime - $firsttime) / 15;
while ($time < $maxtime) {
- my $s2 = $time * $mult;
- print "<text transform=\"translate($s2,89) rotate(90)\">$time</text>\n";
- $time = $time + 0.1;
+ my $s2 = ($time - $firsttime) * $mult;
+ my $tm = int($time * 100) / 100.0;
+ print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n";
+ $time = $time + $step;
}
print "</svg>\n";