]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - scripts/bootgraph.pl
fix allmodconfig breakage
[linux-2.6-omap-h63xx.git] / scripts / bootgraph.pl
index 4e5f4ab2ed7fcb34db8b85f3dbc9fd3bb6315b37..5e7316e5aa395a4c5da260c1d2890336b4c70039 100644 (file)
 #      dmesg | perl scripts/bootgraph.pl > output.svg
 #
 
-my @rows;
-my %start, %end, %row;
+my %start, %end;
 my $done = 0;
-my $rowcount = 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;
@@ -54,19 +54,13 @@ while (<>) {
                                $firsttime = $1;
                        }
                }
-               $row{$func} = 1;
                if ($line =~ /\@ ([0-9]+)/) {
-                       my $pid = $1;
-                       if (!defined($rows[$pid])) {
-                               $rowcount = $rowcount + 1;
-                               $rows[$pid] = $rowcount;
-                       }
-                       $row{$func} = $rows[$pid];
+                       $pids{$func} = $1;
                }
                $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;
@@ -81,8 +75,8 @@ while (<>) {
 }
 
 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;
@@ -109,17 +103,25 @@ $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(
 my $mult = 950.0 / ($maxtime - $firsttime);
 my $threshold = ($maxtime - $firsttime) / 60.0;
 my $stylecounter = 0;
+my %rows;
+my $rowscount = 1;
 while (($key,$value) = each %start) {
        my $duration = $end{$key} - $start{$key};
 
        if ($duration >= $threshold) {
                my $s, $s2, $e, $y;
+               $pid = $pids{$key};
+
+               if (!defined($rows{$pid})) {
+                       $rows{$pid} = $rowscount;
+                       $rowscount = $rowscount + 1;
+               }
                $s = ($value - $firsttime) * $mult;
                $s2 = $s + 6;
                $e = ($end{$key} - $firsttime) * $mult;
                $w = $e - $s;
 
-               $y = $row{$key} * 150;
+               $y = $rows{$pid} * 150;
                $y2 = $y + 4;
 
                $style = $styles[$stylecounter];