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