Commit | Line | Data |
---|---|---|
94e22cd1 | 1 | #!/bin/sh |
2 | # Released under the GPL | |
3 | # pmf - 2008/07/31 | |
4 | ||
eb9ab977 | 5 | # This script runs LTTV in place in the compile directory without need for |
6 | # installing it with make install. | |
58f53b56 PMF |
7 | # |
8 | # Run with the TF environment variable set to a trace directory to open it. | |
9 | # ex: TF=/my/trace ./runlttv | |
94e22cd1 | 10 | # |
11 | # The .runlttvrc file can be used to control its behavior. | |
12 | # - by setting the TRACEFILE variable, a trace can be automatically loaded | |
13 | # ex: TRACEFILE="-t /tmp/traces/dijkstra-20071212" | |
14 | # - by setting the ARGS variable, a different set of plugins can be loaded | |
15 | # for an example see the ARGS= line below | |
16 | # | |
eb9ab977 | 17 | # In order for icons to display correctly, it might be necessary to create a |
18 | # symlink: | |
94e22cd1 | 19 | # $ ln -s ./lttv/modules/gui/lttvwindow/pixmaps |
20 | # while in the same directory as this script. | |
21 | ||
22 | RCFILE=".runlttvrc" | |
23 | ||
3d55af6e BP |
24 | ARGS=\ |
25 | "-L lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\ | |
26 | "-L lttv/modules/gui/controlflow/.libs -m guicontrolflow "\ | |
27 | "-L lttv/modules/gui/detailedevents/.libs -m guievents "\ | |
28 | "-L lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\ | |
29 | "-L lttv/modules/gui/statistics/.libs -m guistatistics "\ | |
30 | "-L lttv/modules/gui/resourceview/.libs -m resourceview "\ | |
31 | "-L lttv/modules/gui/filter/.libs -m guifilter "\ | |
32 | "-L lttv/modules/gui/interrupts/.libs -m interrupts "\ | |
33 | "-L lttv/modules/gui/histogram/.libs -m guihistogram" | |
34 | ||
011e5097 BP |
35 | if [ -e "lttv/lttv/.libs/lttv.real" ]; then |
36 | LTTV_EXEC="lttv/lttv/.libs/lttv.real" | |
37 | elif [ -e "lttv/lttv/lttv.real" ]; then | |
38 | LTTV_EXEC="lttv/lttv/lttv.real" | |
39 | else | |
f034e1cb | 40 | echo "error: LTTV should be compiled before running this script." >/dev/stderr |
41 | exit 1 | |
42 | fi | |
94e22cd1 | 43 | |
58f53b56 PMF |
44 | if [ -n "$TF" ]; then |
45 | TRACEFILE="-t $TF" | |
46 | fi | |
47 | ||
94e22cd1 | 48 | if [ -e "$RCFILE" ]; then |
49 | source "$RCFILE"; | |
50 | fi | |
51 | ||
89db30b2 | 52 | HELPER=$1 |
91840ab1 | 53 | if [ "$HELPER" = "gdb" ]; then |
89db30b2 BP |
54 | shift |
55 | LD_LIBRARY_PATH=ltt/.libs gdb --args $LTTV_EXEC $ARGS $TRACEFILE $@ | |
56 | elif [ "$HELPER" = "valgrind" ]; then | |
57 | shift | |
58 | LD_LIBRARY_PATH=ltt/.libs valgrind --track-origins=yes --show-reachable=yes --leak-check=full --error-limit=no $LTTV_EXEC $ARGS $TRACEFILE $@ | |
ad5078da BP |
59 | elif [ "$HELPER" = "massif" ]; then |
60 | shift | |
61 | LD_LIBRARY_PATH=ltt/.libs valgrind --tool=massif $LTTV_EXEC $ARGS $TRACEFILE $@ | |
89db30b2 BP |
62 | elif [ "$HELPER" = "strace" ]; then |
63 | shift | |
64 | LD_LIBRARY_PATH=ltt/.libs strace $LTTV_EXEC $ARGS $TRACEFILE $@ | |
94e22cd1 | 65 | else |
89db30b2 | 66 | LD_LIBRARY_PATH=ltt/.libs $LTTV_EXEC $ARGS $TRACEFILE $@ |
94e22cd1 | 67 | fi |