]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - scripts/bootgraph.pl
tcp: Restore ordering of TCP options for the sake of inter-operability
[linux-2.6-omap-h63xx.git] / scripts / bootgraph.pl
index c34b359c34a3ab7579d31fa916d11ebed531fef5..5e7316e5aa395a4c5da260c1d2890336b4c70039 100644 (file)
 my %start, %end;
 my $done = 0;
 my $maxtime = 0;
+my $firsttime = 100;
 my $count = 0;
 my %pids;
 
 while (<>) {
        my $line = $_;
-       if ($line =~ /([0-9\.]+)\] calling  ([a-zA-Z\_]+)\+/) {
+       if ($line =~ /([0-9\.]+)\] calling  ([a-zA-Z0-9\_]+)\+/) {
                my $func = $2;
                if ($done == 0) {
                        $start{$func} = $1;
+                       if ($1 < $firsttime) {
+                               $firsttime = $1;
+                       }
                }
                if ($line =~ /\@ ([0-9]+)/) {
                        $pids{$func} = $1;
@@ -56,7 +60,7 @@ while (<>) {
                $count = $count + 1;
        }
 
-       if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z\_]+)\+.*returned/) {
+       if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_]+)\+.*returned/) {
                if ($done == 0) {
                        $end{$2} = $1;
                        $maxtime = $1;
@@ -65,11 +69,14 @@ while (<>) {
        if ($line =~ /Write protecting the/) {
                $done = 1;
        }
+       if ($line =~ /Freeing unused kernel memory/) {
+               $done = 1;
+       }
 }
 
 if ($count == 0) {
-       print "No data found in the dmesg. Make sure CONFIG_PRINTK_TIME is enabled and\n";
-       print "that initcall_debug is passed on the kernel command line.\n\n";
+       print "No data found in the dmesg. Make sure that 'printk.time=1' and\n";
+       print "'initcall_debug' are passed on the kernel command line.\n\n";
        print "Usage: \n";
        print "      dmesg | perl scripts/bootgraph.pl > output.svg\n\n";
        exit;
@@ -93,8 +100,8 @@ $styles[9] = "fill:rgb(255,255,128);fill-opacity:0.5;stroke-width:1;stroke:rgb(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;
 my %rows;
 my $rowscount = 1;
@@ -111,7 +118,7 @@ while (($key,$value) = each %start) {
                }
                $s = ($value - $firsttime) * $mult;
                $s2 = $s + 6;
-               $e = $end{$key} * $mult;
+               $e = ($end{$key} - $firsttime) * $mult;
                $w = $e - $s;
 
                $y = $rows{$pid} * 150;
@@ -130,11 +137,13 @@ while (($key,$value) = each %start) {
 
 
 # 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";