update compat
[lttv.git] / runlttv
CommitLineData
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 7#
eb9ab977 8# In order for icons to display correctly, it might be necessary to create a
9# symlink:
94e22cd1 10# $ ln -s ./lttv/modules/gui/lttvwindow/pixmaps
11# while in the same directory as this script.
12
a7bbe2f6 13RCFILE="$(dirname $0)/.runlttvrc"
94e22cd1 14
ceedc609
PMF
15function usage {
16 echo "Usage: $0 OPTIONS TRACES..." >/dev/stderr
17 echo "" >/dev/stderr
18 echo "Options:" >/dev/stderr
19 echo -e "\t-m mode (modes: text)" >/dev/stderr
20 echo -e "\t-H helper (helpers: gdb, valgrind, massif, strace)" >/dev/stderr
21 echo "" >/dev/stderr
22}
3d55af6e 23
011e5097
BP
24if [ -e "lttv/lttv/.libs/lttv.real" ]; then
25 LTTV_EXEC="lttv/lttv/.libs/lttv.real"
26elif [ -e "lttv/lttv/lttv.real" ]; then
27 LTTV_EXEC="lttv/lttv/lttv.real"
28else
f034e1cb 29 echo "error: LTTV should be compiled before running this script." >/dev/stderr
30 exit 1
31fi
94e22cd1 32
33if [ -e "$RCFILE" ]; then
34 source "$RCFILE";
35fi
36
ceedc609
PMF
37while getopts ":hH:m:" options; do
38 case $options in
39 H) HELPER=$OPTARG;;
40 m) MODE=$OPTARG;;
41 h) usage;
42 exit 0;;
43 \?) usage
44 exit 1;;
45 *) usage
46 exit 1;;
47 esac
48done
49shift $(($OPTIND - 1))
50
51for trace in $@;
52do
53 TRACEFILE="$TRACEFILE -t $trace "
54done
55
56if [ "$MODE" = "text" ]; then
57 ARGS="-L lttv/modules/text/.libs -m textDump"
58else
59 ARGS="-L lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\
60"-L lttv/modules/gui/controlflow/.libs -m guicontrolflow "\
61"-L lttv/modules/gui/detailedevents/.libs -m guievents "\
62"-L lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\
63"-L lttv/modules/gui/statistics/.libs -m guistatistics "\
64"-L lttv/modules/gui/resourceview/.libs -m resourceview "\
65"-L lttv/modules/gui/filter/.libs -m guifilter "\
66"-L lttv/modules/gui/interrupts/.libs -m interrupts "\
67"-L lttv/modules/gui/histogram/.libs -m guihistogram"
68fi
69
91840ab1 70if [ "$HELPER" = "gdb" ]; then
89db30b2
BP
71 shift
72 LD_LIBRARY_PATH=ltt/.libs gdb --args $LTTV_EXEC $ARGS $TRACEFILE $@
73elif [ "$HELPER" = "valgrind" ]; then
74 shift
75 LD_LIBRARY_PATH=ltt/.libs valgrind --track-origins=yes --show-reachable=yes --leak-check=full --error-limit=no $LTTV_EXEC $ARGS $TRACEFILE $@
ad5078da
BP
76elif [ "$HELPER" = "massif" ]; then
77 shift
78 LD_LIBRARY_PATH=ltt/.libs valgrind --tool=massif $LTTV_EXEC $ARGS $TRACEFILE $@
89db30b2
BP
79elif [ "$HELPER" = "strace" ]; then
80 shift
81 LD_LIBRARY_PATH=ltt/.libs strace $LTTV_EXEC $ARGS $TRACEFILE $@
94e22cd1 82else
89db30b2 83 LD_LIBRARY_PATH=ltt/.libs $LTTV_EXEC $ARGS $TRACEFILE $@
94e22cd1 84fi
This page took 0.032604 seconds and 4 git commands to generate.