xref: /aoo41x/main/slideshow/qa/debug/nodetree.sh (revision e4af8f11)
1*e4af8f11SPedro Giffuni#!/bin/sh
2cdf0e10cSrcweir#
3cdf0e10cSrcweir#  $Revision: 1.3 $
4cdf0e10cSrcweir#
5cdf0e10cSrcweir#  Last changes: $Author: kz $ $Date: 2005-01-21 16:54:21 $
6cdf0e10cSrcweir#
7cdf0e10cSrcweir#  Generate node tree from verbose logfile
8cdf0e10cSrcweir#
9cdf0e10cSrcweir#  HOWTO USE
10cdf0e10cSrcweir#  =========
11cdf0e10cSrcweir#
12cdf0e10cSrcweir#  First of all, you need to recompile modules slideshow and canvas
13cdf0e10cSrcweir#  with VERBOSE=t set in the environment, and debug=t defined at the
14cdf0e10cSrcweir#  build tool command line. Then run your slideshow and redirect stdout
15cdf0e10cSrcweir#  to a file.
16cdf0e10cSrcweir#
17cdf0e10cSrcweir#  Then, call 'nodetree.sh trace-file > tree.ps' to generate a
18cdf0e10cSrcweir#  PostScript file for the AnimationNode tree generated during the show.
19cdf0e10cSrcweir#  Since these easily get pretty huge, use only one page, and try to
20cdf0e10cSrcweir#  limit the slide content (which have effects assigned, that is) to
21cdf0e10cSrcweir#  the bare minimum (to reproduce your bug, or whatever you need this
22cdf0e10cSrcweir#  for).
23cdf0e10cSrcweir#
24cdf0e10cSrcweir#  The generated output will have all nodes color-coded with their state
25cdf0e10cSrcweir#  at the point when the tree was dumped (see colors.sh for the color
26cdf0e10cSrcweir#  codes)
27cdf0e10cSrcweir#
28cdf0e10cSrcweir#  When looking for the mechanics that generate the relevant output,
29cdf0e10cSrcweir#  grep for the DEBUG_NODES_SHOWTREE macros in the slideshow source:
30cdf0e10cSrcweir#  Each such place dumps the current node tree to the trace output. Thus,
31cdf0e10cSrcweir#  if you need to check the tree state at other places or times, just add
32cdf0e10cSrcweir#  a DEBUG_NODES_SHOWTREE (or DEBUG_NODES_SHOWTREE_WITHIN, that is).
33cdf0e10cSrcweir#
34cdf0e10cSrcweir
35cdf0e10cSrcweir###################################################
36cdf0e10cSrcweir#
37cdf0e10cSrcweir# Generate node tree
38cdf0e10cSrcweir#
39cdf0e10cSrcweir###################################################
40cdf0e10cSrcweir
41cdf0e10cSrcweiregrep "Node connection|Node state" $1 | 										\
42cdf0e10cSrcweir	sed -e '/Node state/ s/.*Node state.*: \(.*\)/\1/' 							\
43cdf0e10cSrcweir		-e '/Node connection/ s/.*Node connection.*: \(n.*\)/\1/' | 			\
44cdf0e10cSrcweir																				\
45cdf0e10cSrcweirawk 'BEGIN { print "digraph Event_network {" }; { print } END { print "}" }' |	\
46cdf0e10cSrcweir																				\
47cdf0e10cSrcweir																				\
48cdf0e10cSrcweir# fill a complete A1 page with graph output
49cdf0e10cSrcweirdot -Gratio=fill -Gsize=23,33 -Tps
50cdf0e10cSrcweir#dot -Gratio=fill -Gorientation=land -Tps
51