Update the README file to mark the project as unmaintained
[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# In order for icons to display correctly, it might be necessary to create a
9# symlink:
10# $ ln -s ./lttv/modules/gui/lttvwindow/pixmaps
11# while in the same directory as this script.
12
13PROGNAME=$0
14BUILDPATH=$(dirname $0)
15RCFILE="$(dirname $0)/.runlttvrc"
16TEXTLIBS="-L ${BUILDPATH}/lttv/modules/text/.libs -m textDump"
17FORMATEDLIBS="-L ${BUILDPATH}/lttv/modules/text/.libs -m formatedDump"
18EVALLIBS="-L ${BUILDPATH}/lttv/modules/text/.libs -m sync_chain_batch"
19GRAPHLIBS="-L ${BUILDPATH}/lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\
20"-L ${BUILDPATH}/lttv/modules/gui/detailedevents/.libs -m guievents "\
21"-L ${BUILDPATH}/lttv/modules/gui/histogram/.libs -m guihistogram "\
22"-L ${BUILDPATH}/lttv/modules/gui/resourceview/.libs -m resourceview "\
23"-L ${BUILDPATH}/lttv/modules/gui/controlflow/.libs -m guicontrolflow"
24#"-L ${BUILDPATH}/lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\
25#"-L ${BUILDPATH}/lttv/modules/gui/statistics/.libs -m guistatistics "\
26#"-L ${BUILDPATH}/lttv/modules/gui/filter/.libs -m guifilter "\
27#"-L ${BUILDPATH}/lttv/modules/gui/interrupts/.libs -m interrupts "
28
29DEFAULTMODE="gui"
30
31usage () {
32 echo "Usage: $0 [OPTION]... [TRACE]..." >/dev/stderr
33 echo "" >/dev/stderr
34 echo "Options:" >/dev/stderr
35 printf "\t-m MODE Output mode (modes: text, eval, gui)\n" >/dev/stderr
36 printf "\t-H HELPER Invoke LTTV through a helper program\n" >/dev/stderr
37 printf "\t (helpers: gdb, valgrind, massif, strace, callgrind)\n" >/dev/stderr
38 printf "\t-b OPTIONS LTTV options to specify before the module list\n" >/dev/stderr
39 printf "\t-a OPTIONS LTTV options to specify after the module list\n" >/dev/stderr
40 printf "\t-d Activate LTTV debug level\n" >/dev/stderr
41 echo "" >/dev/stderr
42}
43
44if [ -e "${BUILDPATH}/lttv/lttv/.libs/lttv.real" ]; then
45 LTTV_EXEC="${BUILDPATH}/lttv/lttv/.libs/lttv.real"
46elif [ -e "${BUILDPATH}/lttv/lttv/lttv.real" ]; then
47 LTTV_EXEC="${BUILDPATH}/lttv/lttv/lttv.real"
48else
49 echo "error: LTTV should be compiled before running this script." >/dev/stderr
50 exit 1
51fi
52
53while getopts "H:m:b:a:dh" options; do
54 case $options in
55 H) HELPER=$OPTARG;;
56 m) MODE=$OPTARG;;
57 b) BOPTIONS="$BOPTIONS $OPTARG";;
58 a) AOPTIONS="$AOPTIONS $OPTARG";;
59 d) DEBUG_ARGS="--debug"; G_MESSAGES_DEBUG="all";;
60 h) usage;
61 exit 0;;
62 \?) usage;
63 exit 1;;
64 esac
65done
66shift $(($OPTIND - 1))
67
68for trace in $@
69do
70 TRACEFILES="$TRACEFILES -t $trace "
71done
72
73if [ -e "$RCFILE" ]; then
74 . "$RCFILE";
75fi
76
77if [ -z "$MODE" ]; then
78 MODE=$DEFAULTMODE
79fi
80
81if [ "$MODE" = "text" ]; then
82 LIBS="$TEXTLIBS"
83elif [ "$MODE" = "format" ]; then
84 LIBS="$FORMATLIBS"
85elif [ "$MODE" = "eval" ]; then
86 LIBS="$EVALLIBS"
87elif [ "$MODE" = "gui" ]; then
88 LIBS="$GRAPHLIBS"
89else
90 echo "$PROGNAME: unknown mode -- $MODE" >/dev/stderr
91 exit 1
92fi
93
94LTTV_ARGS="$DEBUG_ARGS $BOPTIONS $LIBS $TRACEFILES $AOPTIONS"
95if [ "$HELPER" = "gdb" ]; then
96 LD_LIBRARY_PATH=${BUILDPATH}/ltt/.libs G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG} gdb --args $LTTV_EXEC $LTTV_ARGS
97elif [ "$HELPER" = "valgrind" ]; then
98 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
99elif [ "$HELPER" = "callgrind" ]; then
100 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
101elif [ "$HELPER" = "massif" ]; then
102 LD_LIBRARY_PATH=${BUILDPATH}/ltt/.libs G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG} valgrind --tool=massif $LTTV_EXEC $LTTV_ARGS
103elif [ "$HELPER" = "strace" ]; then
104 LD_LIBRARY_PATH=${BUILDPATH}/ltt/.libs G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG} strace $LTTV_EXEC $LTTV_ARGS
105else
106 LD_LIBRARY_PATH=${BUILDPATH}/ltt/.libs G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG} $LTTV_EXEC $LTTV_ARGS
107fi
This page took 0.023953 seconds and 4 git commands to generate.