2 eval 'exec perl -wS $0 ${1+"$@"}'
5 # This file is part of the LibreOffice project.
7 # This Source Code Form is subject to the terms of the Mozilla Public
8 # License, v. 2.0. If a copy of the MPL was not distributed with this
9 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 # This file incorporates work covered by the following license notice:
13 # Licensed to the Apache Software Foundation (ASF) under one or more
14 # contributor license agreements. See the NOTICE file distributed
15 # with this work for additional information regarding copyright
16 # ownership. The ASF licenses this file to you under the Apache
17 # License, Version 2.0 (the "License"); you may not use this file
18 # except in compliance with the License. You may obtain a copy of
19 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 =head1 PROGRAM NAME AND AUTHOR
29 Extract move effect timings from a verbose trace log of the
30 presentation engine. Generated is a gnuplot data file, which can be
31 displayed issuing a 'gnuplot <filename>' or at a gnuplot prompt, via
34 To generate such a verbose log file, rebuild module canvas and module
35 slideshow with VERBOSE=t defined in the environment, and debug=t at
36 the build tool command line. Then run the presentation, and redirect
37 stdout to your log file.
39 Call me like this: timings.pl < trace-file > gnuplot-target
41 The whole point in doing this is to detect jerks in shape movements,
42 which manifest themselves clearly in the graphed gnuplot output. Note
43 that there's some heuristic to recognize when one effect ends and
44 another has started: If the time difference between two subsequent
45 page flipping times is more than one second, a new effect is assumed
46 and a new gnuplot data record is generated.
54 ##############################################################################
57 print "# Autogenerated by timings.pl, do not change\n",
58 "set ylabel \"position\"\n",
59 "set xlabel \"time\"\n",
60 "plot '-' index 0 using (\$1):(\$2) title \"Move effect position\" with lp\n",
69 if( $state == 0 && m
|next position will be
| )
71 ($posX) = m
|.*\
(([0-9]+.[0-9]+),|;
72 ($posY) = m
|.*,([0-9]+.[0-9]+)\
)|;
75 elsif( $state == 1 && m
|output
pos is
| )
79 elsif( $state == 2 && m
|flip done at
| )
82 ($flippingTime) = m
|.*at
([0-9]+.[0-9]+)|;
86 if( $last_time + 1.0 < $flippingTime )
89 print "\n\n#", $record, "\n";
94 $last_time = $flippingTime;
95 print $flippingTime, " ", $posX, " ", $posY, "\n";