summaryrefslogtreecommitdiffstats
path: root/slideshow/qa/debug
diff options
context:
space:
mode:
Diffstat (limited to 'slideshow/qa/debug')
-rw-r--r--slideshow/qa/debug/colors.sh16
-rw-r--r--slideshow/qa/debug/nodetree.sh46
-rw-r--r--slideshow/qa/debug/readme.txt19
-rw-r--r--slideshow/qa/debug/timings.pl97
4 files changed, 178 insertions, 0 deletions
diff --git a/slideshow/qa/debug/colors.sh b/slideshow/qa/debug/colors.sh
new file mode 100644
index 0000000000..c85a916d09
--- /dev/null
+++ b/slideshow/qa/debug/colors.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# Output a PS file with a legend for the node state colors
+#
+
+cat <<EOF | dot -Tps
+digraph State_Colors
+{
+ node0 [label="INVALID",style=filled,fillcolor="0.5,0.2,0.5"]
+ node1 [label="UNRESOLVED",style=filled,fillcolor="0.0,1.0,1.0"]
+ node2 [label="RESOLVED",style=filled,fillcolor="0.17328679513998632735430803036454,1.0,1.0"]
+ node4 [label="ACTIVE",style=filled,fillcolor="0.34657359027997265470861606072909,1.0,1.0"]
+ node8 [label="FROZEN",style=filled,fillcolor="0.51986038541995898206292409109363,1.0,1.0"]
+ node16 [label="ENDED",style=filled,fillcolor="0.69314718055994530941723212145818,1.0,1.0"]
+}
+EOF \ No newline at end of file
diff --git a/slideshow/qa/debug/nodetree.sh b/slideshow/qa/debug/nodetree.sh
new file mode 100644
index 0000000000..78546cb8ce
--- /dev/null
+++ b/slideshow/qa/debug/nodetree.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# Generate node tree from verbose logfile
+#
+# HOWTO USE
+# =========
+#
+# First of all, you need to recompile modules slideshow and canvas
+# with VERBOSE=t set in the environment, and debug=t defined at the
+# build tool command line. Then run your slideshow and redirect stdout
+# to a file.
+#
+# Then, call 'nodetree.sh trace-file > tree.ps' to generate a
+# PostScript file for the AnimationNode tree generated during the show.
+# Since these easily get pretty huge, use only one page, and try to
+# limit the slide content (which have effects assigned, that is) to
+# the bare minimum (to reproduce your bug, or whatever you need this
+# for).
+#
+# The generated output will have all nodes color-coded with their state
+# at the point when the tree was dumped (see colors.sh for the color
+# codes)
+#
+# When looking for the mechanics that generate the relevant output,
+# grep for the DEBUG_NODES_SHOWTREE macros in the slideshow source:
+# Each such place dumps the current node tree to the trace output. Thus,
+# if you need to check the tree state at other places or times, just add
+# a DEBUG_NODES_SHOWTREE
+#
+
+###################################################
+#
+# Generate node tree
+#
+###################################################
+
+grep -E "Node connection|Node state" $1 | \
+ sed -e '/Node state/ s/.*Node state.*: \(.*\)/\1/' \
+ -e '/Node connection/ s/.*Node connection.*: \(n.*\)/\1/' | \
+ \
+awk 'BEGIN { print "digraph Event_network {" }; { print } END { print "}" }' | \
+ \
+ \
+# fill a complete A1 page with graph output
+dot -Gratio=fill -Gsize=23,33 -Tps
+#dot -Gratio=fill -Gorientation=land -Tps
diff --git a/slideshow/qa/debug/readme.txt b/slideshow/qa/debug/readme.txt
new file mode 100644
index 0000000000..eb458d6860
--- /dev/null
+++ b/slideshow/qa/debug/readme.txt
@@ -0,0 +1,19 @@
+Recognized preprocessor switches
+================================
+
+ - TIMELOG=t: enable time logging (also for product builds)
+
+
+Debug tools overview
+====================
+
+nodetree.sh:
+
+ Generates a number of tree graphs from a trace output file, showing
+ the tree of AnimationNodes at various instances of the
+ slideshow. Each node has a fill color corresponding to its current
+ state, a legend for the color values can be obtained by the colors.sh
+ script.
+ To generate output at other instances, use the DEBUG_NODES_SHOWTREE
+ macro in animationnodefactory.cxx.
+
diff --git a/slideshow/qa/debug/timings.pl b/slideshow/qa/debug/timings.pl
new file mode 100644
index 0000000000..f41181e43d
--- /dev/null
+++ b/slideshow/qa/debug/timings.pl
@@ -0,0 +1,97 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed
+# with this work for additional information regarding copyright
+# ownership. The ASF licenses this file to you under the Apache
+# License, Version 2.0 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+# POD Documentation
+
+=head1 PROGRAM NAME AND AUTHOR
+
+Timings
+
+=head1 WHAT IT IS
+
+Extract move effect timings from a verbose trace log of the
+presentation engine. Generated is a gnuplot data file, which can be
+displayed issuing a 'gnuplot <filename>' or at a gnuplot prompt, via
+'load <filename>'.
+
+To generate such a verbose log file, rebuild module canvas and module
+slideshow with VERBOSE=t defined in the environment, and debug=t at
+the build tool command line. Then run the presentation, and redirect
+stdout to your log file.
+
+Call me like this: timings.pl < trace-file > gnuplot-target
+
+The whole point in doing this is to detect jerks in shape movements,
+which manifest themselves clearly in the graphed gnuplot output. Note
+that there's some heuristic to recognize when one effect ends and
+another has started: If the time difference between two subsequent
+page flipping times is more than one second, a new effect is assumed
+and a new gnuplot data record is generated.
+
+=head1 REQUIREMENTS
+
+Perl 5
+
+=cut
+
+##############################################################################
+#
+
+print "# Autogenerated by timings.pl, do not change\n",
+ "set ylabel \"position\"\n",
+ "set xlabel \"time\"\n",
+ "plot '-' index 0 using (\$1):(\$2) title \"Move effect position\" with lp\n",
+ "#0\n";
+
+$state = 0;
+$last_time = 0;
+$record = 1;
+
+while( <> )
+{
+ if( $state == 0 && m|next position will be| )
+ {
+ ($posX) = m|.*\(([0-9]+.[0-9]+),|;
+ ($posY) = m|.*,([0-9]+.[0-9]+)\)|;
+ $state = 1;
+ }
+ elsif( $state == 1 && m|output pos is| )
+ {
+ $state = 2;
+ }
+ elsif( $state == 2 && m|flip done at| )
+ {
+ $state = 0;
+ ($flippingTime) = m|.*at ([0-9]+.[0-9]+)|;
+
+ if( $last_time != 0 )
+ {
+ if( $last_time + 1.0 < $flippingTime )
+ {
+ # new record
+ print "\n\n#", $record, "\n";
+ $record++;
+ }
+ }
+
+ $last_time = $flippingTime;
+ print $flippingTime, " ", $posX, " ", $posY, "\n";
+ }
+}