X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=runlttv;h=7af35b018f10bc2c7f582ddb1091a7b4578c5d76;hb=89db30b29d2d223ab5f238d6c6e089bd001efd78;hp=fd774d3042c19c624f665f6798eb8f0828914c0d;hpb=3d55af6e55e4f5e15f3417c952b3ae49a42991c2;p=lttv.git diff --git a/runlttv b/runlttv index fd774d30..7af35b01 100755 --- a/runlttv +++ b/runlttv @@ -4,13 +4,15 @@ # This script runs LTTV in place in the compile directory without need for # installing it with make install. +# +# Run with the TF environment variable set to a trace directory to open it. +# ex: TF=/my/trace ./runlttv # # The .runlttvrc file can be used to control its behavior. # - by setting the TRACEFILE variable, a trace can be automatically loaded # ex: TRACEFILE="-t /tmp/traces/dijkstra-20071212" # - by setting the ARGS variable, a different set of plugins can be loaded # for an example see the ARGS= line below -# - the LTTV_ARGS environment variable may be used to add additional arguments to lttv # # In order for icons to display correctly, it might be necessary to create a # symlink: @@ -30,31 +32,33 @@ ARGS=\ "-L lttv/modules/gui/interrupts/.libs -m interrupts "\ "-L lttv/modules/gui/histogram/.libs -m guihistogram" -LTTV_EXEC="lttv/lttv/.libs/lttv.real" - -if [ ! -e "$LTTV_EXEC" ]; then +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 -for a in $@; do - eval $(echo $a)"=1" -done +if [ -n "$TF" ]; then + TRACEFILE="-t $TF" +fi if [ -e "$RCFILE" ]; then source "$RCFILE"; fi -ARGS="$ARGS $LTTV_ARGS" - -echo $dbg - -if [ -n "$dbg" ]; then - LD_LIBRARY_PATH=ltt/.libs gdb --args $LTTV_EXEC $ARGS $TRACEFILE -elif [ -n "$valgrind" ]; then - LD_LIBRARY_PATH=ltt/.libs valgrind --track-origins=yes --show-reachable=yes --leak-check=full --error-limit=no $LTTV_EXEC $ARGS $TRACEFILE -elif [ -n "$strace" ]; then - LD_LIBRARY_PATH=ltt/.libs strace $LTTV_EXEC $ARGS $TRACEFILE +HELPER=$1 +if [ "$HELPER" = "dbg" ]; 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" = "strace" ]; then + shift + LD_LIBRARY_PATH=ltt/.libs strace $LTTV_EXEC $ARGS $TRACEFILE $@ else - LD_LIBRARY_PATH=ltt/.libs $LTTV_EXEC $ARGS $TRACEFILE + LD_LIBRARY_PATH=ltt/.libs $LTTV_EXEC $ARGS $TRACEFILE $@ fi