xref: /glogg/tools/perfmeter.pl (revision 948fb2fa58c1810ffb41925d38d024bd7d866c92)
1257f352aSNicolas Bonnefon#!/usr/bin/perl
2257f352aSNicolas Bonnefon
3257f352aSNicolas Bonnefon# Take a debug log from logcrawler and output some perf statistics
4*948fb2faSNicolas Bonnefon# Can be plotted by echo "plot [ ] [0:0.1] 'foo.data'; pause mouse key;" | gnuplot -
5257f352aSNicolas Bonnefon
6257f352aSNicolas Bonnefonwhile (<>) {
7257f352aSNicolas Bonnefon    strip;
8257f352aSNicolas Bonnefon    if (/(\d\d\.\d\d\d) DEBUG: paintEvent.*firstLine=(\d+) lastLine=(\d+) /) {
9257f352aSNicolas Bonnefon        if ( ($3 - $2) > 35 ) {
10257f352aSNicolas Bonnefon            $beginning = $1;
11257f352aSNicolas Bonnefon            $first_line = $2;
12257f352aSNicolas Bonnefon        }
13257f352aSNicolas Bonnefon    }
14257f352aSNicolas Bonnefon    elsif (/(\d\d\.\d\d\d) DEBUG: End/) {
15257f352aSNicolas Bonnefon        if ($beginning) {
16257f352aSNicolas Bonnefon            $time = $1 - $beginning;
17*948fb2faSNicolas Bonnefon            print "$first_line $time\n";
18257f352aSNicolas Bonnefon        }
19257f352aSNicolas Bonnefon    }
20257f352aSNicolas Bonnefon}
21