1e4af8f11SPedro Giffuni#!/bin/sh 29f22d7c2SAndrew Rist# ************************************************************* 39f22d7c2SAndrew Rist# 49f22d7c2SAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 59f22d7c2SAndrew Rist# or more contributor license agreements. See the NOTICE file 69f22d7c2SAndrew Rist# distributed with this work for additional information 79f22d7c2SAndrew Rist# regarding copyright ownership. The ASF licenses this file 89f22d7c2SAndrew Rist# to you under the Apache License, Version 2.0 (the 99f22d7c2SAndrew Rist# "License"); you may not use this file except in compliance 109f22d7c2SAndrew Rist# with the License. You may obtain a copy of the License at 119f22d7c2SAndrew Rist# 129f22d7c2SAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 139f22d7c2SAndrew Rist# 149f22d7c2SAndrew Rist# Unless required by applicable law or agreed to in writing, 159f22d7c2SAndrew Rist# software distributed under the License is distributed on an 169f22d7c2SAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 179f22d7c2SAndrew Rist# KIND, either express or implied. See the License for the 189f22d7c2SAndrew Rist# specific language governing permissions and limitations 199f22d7c2SAndrew Rist# under the License. 209f22d7c2SAndrew Rist# 219f22d7c2SAndrew Rist# ************************************************************* 22cdf0e10cSrcweir# 23cdf0e10cSrcweir# $Revision: 1.3 $ 24cdf0e10cSrcweir# 25*99e66e07Spfg# Last changes: $Author$ $Date$ 26cdf0e10cSrcweir# 27cdf0e10cSrcweir# Generate node tree from verbose logfile 28cdf0e10cSrcweir# 29cdf0e10cSrcweir# HOWTO USE 30cdf0e10cSrcweir# ========= 31cdf0e10cSrcweir# 32cdf0e10cSrcweir# First of all, you need to recompile modules slideshow and canvas 33cdf0e10cSrcweir# with VERBOSE=t set in the environment, and debug=t defined at the 34cdf0e10cSrcweir# build tool command line. Then run your slideshow and redirect stdout 35cdf0e10cSrcweir# to a file. 36cdf0e10cSrcweir# 37cdf0e10cSrcweir# Then, call 'nodetree.sh trace-file > tree.ps' to generate a 38cdf0e10cSrcweir# PostScript file for the AnimationNode tree generated during the show. 39cdf0e10cSrcweir# Since these easily get pretty huge, use only one page, and try to 40cdf0e10cSrcweir# limit the slide content (which have effects assigned, that is) to 41cdf0e10cSrcweir# the bare minimum (to reproduce your bug, or whatever you need this 42cdf0e10cSrcweir# for). 43cdf0e10cSrcweir# 44cdf0e10cSrcweir# The generated output will have all nodes color-coded with their state 45cdf0e10cSrcweir# at the point when the tree was dumped (see colors.sh for the color 46cdf0e10cSrcweir# codes) 47cdf0e10cSrcweir# 48cdf0e10cSrcweir# When looking for the mechanics that generate the relevant output, 49cdf0e10cSrcweir# grep for the DEBUG_NODES_SHOWTREE macros in the slideshow source: 50cdf0e10cSrcweir# Each such place dumps the current node tree to the trace output. Thus, 51cdf0e10cSrcweir# if you need to check the tree state at other places or times, just add 52cdf0e10cSrcweir# a DEBUG_NODES_SHOWTREE (or DEBUG_NODES_SHOWTREE_WITHIN, that is). 53cdf0e10cSrcweir# 54cdf0e10cSrcweir 55cdf0e10cSrcweir################################################### 56cdf0e10cSrcweir# 57cdf0e10cSrcweir# Generate node tree 58cdf0e10cSrcweir# 59cdf0e10cSrcweir################################################### 60cdf0e10cSrcweir 61cdf0e10cSrcweiregrep "Node connection|Node state" $1 | \ 62cdf0e10cSrcweir sed -e '/Node state/ s/.*Node state.*: \(.*\)/\1/' \ 63cdf0e10cSrcweir -e '/Node connection/ s/.*Node connection.*: \(n.*\)/\1/' | \ 64cdf0e10cSrcweir \ 65cdf0e10cSrcweirawk 'BEGIN { print "digraph Event_network {" }; { print } END { print "}" }' | \ 66cdf0e10cSrcweir \ 67cdf0e10cSrcweir \ 68cdf0e10cSrcweir# fill a complete A1 page with graph output 69cdf0e10cSrcweirdot -Gratio=fill -Gsize=23,33 -Tps 70cdf0e10cSrcweir#dot -Gratio=fill -Gorientation=land -Tps 71