#!/bin/sh # Released under the GPL # pmf - 2008/07/31 # This script runs LTTV in place in the compile directory without need for # installing it with make install. # # In order for icons to display correctly, it might be necessary to create a # symlink: # $ ln -s ./lttv/modules/gui/lttvwindow/pixmaps # while in the same directory as this script. RCFILE="$(dirname $0)/.runlttvrc" function usage { echo "Usage: $0 OPTIONS TRACES..." >/dev/stderr echo "" >/dev/stderr echo "Options:" >/dev/stderr echo -e "\t-m mode (modes: text)" >/dev/stderr echo -e "\t-H helper (helpers: gdb, valgrind, massif, strace)" >/dev/stderr echo "" >/dev/stderr } if [ -e "lttv/lttv/.libs/lttv.real" ]; then LTTV_EXEC="lttv/lttv/.libs/lttv.real" elif [ -e "lttv/lttv/lttv.real" ]; then LTTV_EXEC="lttv/lttv/lttv.real" else echo "error: LTTV should be compiled before running this script." >/dev/stderr exit 1 fi if [ -e "$RCFILE" ]; then source "$RCFILE"; fi while getopts ":hH:m:" options; do case $options in H) HELPER=$OPTARG;; m) MODE=$OPTARG;; h) usage; exit 0;; \?) usage exit 1;; *) usage exit 1;; esac done shift $(($OPTIND - 1)) for trace in $@; do TRACEFILE="$TRACEFILE -t $trace " done if [ "$MODE" = "text" ]; then ARGS="-L lttv/modules/text/.libs -m textDump" else ARGS="-L lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\ "-L lttv/modules/gui/controlflow/.libs -m guicontrolflow "\ "-L lttv/modules/gui/detailedevents/.libs -m guievents "\ "-L lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\ "-L lttv/modules/gui/statistics/.libs -m guistatistics "\ "-L lttv/modules/gui/resourceview/.libs -m resourceview "\ "-L lttv/modules/gui/filter/.libs -m guifilter "\ "-L lttv/modules/gui/interrupts/.libs -m interrupts "\ "-L lttv/modules/gui/histogram/.libs -m guihistogram" fi if [ "$HELPER" = "gdb" ]; then shift LD_LIBRARY_PATH=ltt/.libs gdb --args $LTTV_EXEC $ARGS $TRACEFILE $@ elif [ "$HELPER" = "valgrind" ]; then shift LD_LIBRARY_PATH=ltt/.libs valgrind --track-origins=yes --show-reachable=yes --leak-check=full --error-limit=no $LTTV_EXEC $ARGS $TRACEFILE $@ elif [ "$HELPER" = "massif" ]; then shift LD_LIBRARY_PATH=ltt/.libs valgrind --tool=massif $LTTV_EXEC $ARGS $TRACEFILE $@ elif [ "$HELPER" = "strace" ]; then shift LD_LIBRARY_PATH=ltt/.libs strace $LTTV_EXEC $ARGS $TRACEFILE $@ else LD_LIBRARY_PATH=ltt/.libs $LTTV_EXEC $ARGS $TRACEFILE $@ fi