xref: /aoo41x/main/slideshow/qa/debug/timings.pl (revision cdf0e10c)
1:
2eval 'exec perl -wS $0 ${1+"$@"}'
3    if 0;
4# POD Documentation
5
6=head1 PROGRAM NAME AND AUTHOR
7
8Timings - $Revision: 1.2 $
9Last changes: $Author: rt $ $Date: 2004-11-26 18:43:32 $
10
11=head1 WHAT IT IS
12
13Extract move effect timings from a verbose trace log of the
14presentation engine. Generated is a gnuplot data file, which can be
15displayed issuing a 'gnuplot <filename>' or at a gnuplot prompt, via
16'load <filename>'.
17
18To generate such a verbose log file, rebuild module canvas and module
19slideshow with VERBOSE=t defined in the environment, and debug=t at
20the build tool command line. Then run the presentation, and redirect
21stdout to your log file.
22
23Call me like this: timings.pl < trace-file > gnuplot-target
24
25The whole point in doing this is to detect jerks in shape movements,
26which manifest themselves clearly in the graphed gnuplot output. Note
27that there's some heuristic to recognize when one effect ends and
28another has started: If the time difference between two subsequent
29page flipping times is more than one second, a new effect is assumed
30and a new gnuplot data record is generated.
31
32=head1 REQUIREMENTS
33
34Perl 5
35
36=cut
37
38##############################################################################
39#
40
41print "# 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";
46
47$state = 0;
48$last_time = 0;
49$record = 1;
50
51while( <> )
52{
53	if( $state == 0 && m|next position will be| )
54	{
55		($posX) = m|.*\(([0-9]+.[0-9]+),|;
56		($posY) = m|.*,([0-9]+.[0-9]+)\)|;
57		$state = 1;
58	}
59	elsif( $state == 1 && m|output pos is| )
60	{
61		$state = 2;
62	}
63	elsif( $state == 2 && m|flip done at| )
64	{
65		$state = 0;
66		($flippingTime) = m|.*at ([0-9]+.[0-9]+)|;
67
68		if( $last_time != 0 )
69		{
70			if( $last_time + 1.0 < $flippingTime )
71			{
72				# new record
73				print "\n\n#", $record, "\n";
74				$record++;
75			}
76		}
77
78		$last_time = $flippingTime;
79		print $flippingTime, " ", $posX, " ", $posY, "\n";
80	}
81}
82