update dev300-m58
[ooovba.git] / slideshow / qa / debug / timings.pl
bloba409b8d5f392518c9371728687af3789ce394324
2 eval 'exec perl -wS $0 ${1+"$@"}'
3 if 0;
4 # POD Documentation
6 =head1 PROGRAM NAME AND AUTHOR
8 Timings - $Revision: 1.2 $
9 Last changes: $Author: rt $ $Date: 2004-11-26 18:43:32 $
11 =head1 WHAT IT IS
13 Extract move effect timings from a verbose trace log of the
14 presentation engine. Generated is a gnuplot data file, which can be
15 displayed issuing a 'gnuplot <filename>' or at a gnuplot prompt, via
16 'load <filename>'.
18 To generate such a verbose log file, rebuild module canvas and module
19 slideshow with VERBOSE=t defined in the environment, and debug=t at
20 the build tool command line. Then run the presentation, and redirect
21 stdout to your log file.
23 Call me like this: timings.pl < trace-file > gnuplot-target
25 The whole point in doing this is to detect jerks in shape movements,
26 which manifest themselves clearly in the graphed gnuplot output. Note
27 that there's some heuristic to recognize when one effect ends and
28 another has started: If the time difference between two subsequent
29 page flipping times is more than one second, a new effect is assumed
30 and a new gnuplot data record is generated.
32 =head1 REQUIREMENTS
34 Perl 5
36 =cut
38 ##############################################################################
41 print "# Autogenerated by timings.pl, do not change\n",
42 "set ylabel \"position\"\n",
43 "set xlabel \"time\"\n",
44 "plot '-' index 0 using (\$1):(\$2) title \"Move effect position\" with lp\n",
45 "#0\n";
47 $state = 0;
48 $last_time = 0;
49 $record = 1;
51 while( <> )
53 if( $state == 0 && m|next position will be| )
55 ($posX) = m|.*\(([0-9]+.[0-9]+),|;
56 ($posY) = m|.*,([0-9]+.[0-9]+)\)|;
57 $state = 1;
59 elsif( $state == 1 && m|output pos is| )
61 $state = 2;
63 elsif( $state == 2 && m|flip done at| )
65 $state = 0;
66 ($flippingTime) = m|.*at ([0-9]+.[0-9]+)|;
68 if( $last_time != 0 )
70 if( $last_time + 1.0 < $flippingTime )
72 # new record
73 print "\n\n#", $record, "\n";
74 $record++;
78 $last_time = $flippingTime;
79 print $flippingTime, " ", $posX, " ", $posY, "\n";