]> Pileus Git - ~andy/linux/commitdiff
tracing/fastboot: fix row order in bootgraph.pl
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Tue, 14 Oct 2008 13:19:15 +0000 (14:19 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 22 Oct 2008 14:37:25 +0000 (16:37 +0200)
When bootgraph.pl parses a file, it gives one row for each initcall's
pid.  But they are displayed in random (perl hash) order.  Let's
sort the pids by the start time of their first initcall instead.

This helps trace module initcalls, where each has a separate pid.
bootgraph.pl will show module initcalls during the initramfs; it may
also be adapted to show subsequent module initcalls.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: Frédéric Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
scripts/bootgraph.pl

index ea2b079af9fda0a454699ce9cbcbd96b994c51d3..d2c61efc216f4bd413dd271faa3aa62c736c6203 100644 (file)
@@ -108,9 +108,9 @@ my $threshold = ($maxtime - $firsttime) / 60.0;
 my $stylecounter = 0;
 my %rows;
 my $rowscount = 1;
+my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start);
 my $key;
-my $value;
-while (($key,$value) = each %start) {
+foreach $key (@initcalls) {
        my $duration = $end{$key} - $start{$key};
 
        if ($duration >= $threshold) {
@@ -121,7 +121,7 @@ while (($key,$value) = each %start) {
                        $rows{$pid} = $rowscount;
                        $rowscount = $rowscount + 1;
                }
-               $s = ($value - $firsttime) * $mult;
+               $s = ($start{$key} - $firsttime) * $mult;
                $s2 = $s + 6;
                $e = ($end{$key} - $firsttime) * $mult;
                $w = $e - $s;