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