lttv: Look for executable in run script
[lttv.git] / runlttv
... / ...
CommitLineData
1#!/bin/sh
2# Released under the GPL
3# pmf - 2008/07/31
4
5# This script runs LTTV in place in the compile directory without need for
6# installing it with make install.
7#
8# The .runlttvrc file can be used to control its behavior.
9# - by setting the TRACEFILE variable, a trace can be automatically loaded
10# ex: TRACEFILE="-t /tmp/traces/dijkstra-20071212"
11# - by setting the ARGS variable, a different set of plugins can be loaded
12# for an example see the ARGS= line below
13# - the LTTV_ARGS environment variable may be used to add additional arguments to lttv
14#
15# In order for icons to display correctly, it might be necessary to create a
16# symlink:
17# $ ln -s ./lttv/modules/gui/lttvwindow/pixmaps
18# while in the same directory as this script.
19
20RCFILE=".runlttvrc"
21
22ARGS=\
23"-L lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\
24"-L lttv/modules/gui/controlflow/.libs -m guicontrolflow "\
25"-L lttv/modules/gui/detailedevents/.libs -m guievents "\
26"-L lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\
27"-L lttv/modules/gui/statistics/.libs -m guistatistics "\
28"-L lttv/modules/gui/resourceview/.libs -m resourceview "\
29"-L lttv/modules/gui/filter/.libs -m guifilter "\
30"-L lttv/modules/gui/interrupts/.libs -m interrupts "\
31"-L lttv/modules/gui/histogram/.libs -m guihistogram"
32
33if [ -e "lttv/lttv/.libs/lttv.real" ]; then
34 LTTV_EXEC="lttv/lttv/.libs/lttv.real"
35elif [ -e "lttv/lttv/lttv.real" ]; then
36 LTTV_EXEC="lttv/lttv/lttv.real"
37else
38 echo "error: LTTV should be compiled before running this script." >/dev/stderr
39 exit 1
40fi
41
42for a in $@; do
43 eval $(echo $a)"=1"
44done
45
46if [ -e "$RCFILE" ]; then
47 source "$RCFILE";
48fi
49
50ARGS="$ARGS $LTTV_ARGS"
51
52echo $dbg
53
54if [ -n "$dbg" ]; then
55 LD_LIBRARY_PATH=ltt/.libs gdb --args $LTTV_EXEC $ARGS $TRACEFILE
56elif [ -n "$valgrind" ]; then
57 LD_LIBRARY_PATH=ltt/.libs valgrind --track-origins=yes --show-reachable=yes --leak-check=full --error-limit=no $LTTV_EXEC $ARGS $TRACEFILE
58elif [ -n "$strace" ]; then
59 LD_LIBRARY_PATH=ltt/.libs strace $LTTV_EXEC $ARGS $TRACEFILE
60else
61 LD_LIBRARY_PATH=ltt/.libs $LTTV_EXEC $ARGS $TRACEFILE
62fi
This page took 0.022296 seconds and 4 git commands to generate.