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