2 # Released under the GPL
5 # This script runs LTTV in place in the compile directory without need for
6 # installing it with make install.
8 # In order for icons to display correctly, it might be necessary to create a
10 # $ ln -s ./lttv/modules/gui/lttvwindow/pixmaps
11 # while in the same directory as this script.
14 BUILDPATH
=$
(dirname $0)
15 RCFILE
="$(dirname $0)/.runlttvrc"
16 TEXTLIBS
="-L ${BUILDPATH}/lttv/modules/text/.libs -m textDump"
17 EVALLIBS
="-L ${BUILDPATH}/lttv/modules/text/.libs -m sync_chain_batch"
18 GRAPHLIBS
="-L ${BUILDPATH}/lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\
19 "-L ${BUILDPATH}/lttv/modules/gui/detailedevents/.libs -m guievents "\
20 "-L ${BUILDPATH}/lttv/modules/gui/histogram/.libs -m guihistogram "\
21 "-L ${BUILDPATH}/lttv/modules/gui/controlflow/.libs -m guicontrolflow"
22 #"-L ${BUILDPATH}/lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\
23 #"-L ${BUILDPATH}/lttv/modules/gui/statistics/.libs -m guistatistics "\
24 #"-L ${BUILDPATH}/lttv/modules/gui/resourceview/.libs -m resourceview "\
25 #"-L ${BUILDPATH}/lttv/modules/gui/filter/.libs -m guifilter "\
26 #"-L ${BUILDPATH}/lttv/modules/gui/interrupts/.libs -m interrupts "
31 echo "Usage: $0 [OPTION]... [TRACE]..." >/dev
/stderr
33 echo "Options:" >/dev
/stderr
34 printf "\t-m MODE Output mode (modes: text, eval, gui)\n" >/dev
/stderr
35 printf "\t-H HELPER Invoke LTTV through a helper program\n" >/dev
/stderr
36 printf "\t (helpers: gdb, valgrind, massif, strace, callgrind)\n" >/dev
/stderr
37 printf "\t-b OPTIONS LTTV options to specify before the module list\n" >/dev
/stderr
38 printf "\t-a OPTIONS LTTV options to specify after the module list\n" >/dev
/stderr
39 printf "\t-d Activate LTTV debug level\n" >/dev
/stderr
43 if [ -e "${BUILDPATH}/lttv/lttv/.libs/lttv.real" ]; then
44 LTTV_EXEC
="${BUILDPATH}/lttv/lttv/.libs/lttv.real"
45 elif [ -e "${BUILDPATH}/lttv/lttv/lttv.real" ]; then
46 LTTV_EXEC
="${BUILDPATH}/lttv/lttv/lttv.real"
48 echo "error: LTTV should be compiled before running this script." >/dev
/stderr
52 while getopts "H:m:b:a:dh" options
; do
56 b
) BOPTIONS
="$BOPTIONS $OPTARG";;
57 a
) AOPTIONS
="$AOPTIONS $OPTARG";;
58 d
) DEBUG_ARGS
="--debug"; G_MESSAGES_DEBUG
="all";;
65 shift $
(($OPTIND - 1))
69 TRACEFILES
="$TRACEFILES -t $trace "
72 if [ -e "$RCFILE" ]; then
76 if [ -z "$MODE" ]; then
80 if [ "$MODE" = "text" ]; then
82 elif [ "$MODE" = "eval" ]; then
84 elif [ "$MODE" = "gui" ]; then
87 echo "$PROGNAME: unknown mode -- $MODE" >/dev
/stderr
91 LTTV_ARGS
="$DEBUG_ARGS $BOPTIONS $LIBS $TRACEFILES $AOPTIONS"
92 if [ "$HELPER" = "gdb" ]; then
93 LD_LIBRARY_PATH
=${BUILDPATH}/ltt
/.libs G_MESSAGES_DEBUG
=${G_MESSAGES_DEBUG} gdb
--args $LTTV_EXEC $LTTV_ARGS
94 elif [ "$HELPER" = "valgrind" ]; then
95 LD_LIBRARY_PATH
=${BUILDPATH}/ltt
/.libs G_MESSAGES_DEBUG
=${G_MESSAGES_DEBUG} G_SLICE
=always-malloc G_DEBUG
=gc-friendly valgrind
--show-reachable=yes --leak-check=full
--tool=memcheck
--suppressions=debug
/gtk.suppression
--track-origins=yes --error-limit=no
$LTTV_EXEC $LTTV_ARGS
96 elif [ "$HELPER" = "callgrind" ]; then
97 LD_LIBRARY_PATH
=${BUILDPATH}/ltt
/.libs G_MESSAGES_DEBUG
=${G_MESSAGES_DEBUG} G_SLICE
=always-malloc G_DEBUG
=gc-friendly valgrind
--tool=callgrind
$LTTV_EXEC $LTTV_ARGS
98 elif [ "$HELPER" = "massif" ]; then
99 LD_LIBRARY_PATH
=${BUILDPATH}/ltt
/.libs G_MESSAGES_DEBUG
=${G_MESSAGES_DEBUG} valgrind
--tool=massif
$LTTV_EXEC $LTTV_ARGS
100 elif [ "$HELPER" = "strace" ]; then
101 LD_LIBRARY_PATH
=${BUILDPATH}/ltt
/.libs G_MESSAGES_DEBUG
=${G_MESSAGES_DEBUG} strace
$LTTV_EXEC $LTTV_ARGS
103 LD_LIBRARY_PATH
=${BUILDPATH}/ltt
/.libs G_MESSAGES_DEBUG
=${G_MESSAGES_DEBUG} $LTTV_EXEC $LTTV_ARGS
This page took 0.046272 seconds and 4 git commands to generate.