X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=runlttv;h=86edfd3f8cb2efdff07279d0d76f5d80f634a539;hb=a7bbe2f6af5563fed90ff5ba446c6f8c29812f4b;hp=60fe83b53572fd6d11273ec9b1962f3f8f5c086c;hpb=f61f4dca50e13aa52b1ca3941c8f420848f4353f;p=lttv.git diff --git a/runlttv b/runlttv index 60fe83b5..86edfd3f 100755 --- a/runlttv +++ b/runlttv @@ -4,6 +4,9 @@ # 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 @@ -16,26 +19,52 @@ # $ ln -s ./lttv/modules/gui/lttvwindow/pixmaps # while in the same directory as this script. -RCFILE=".runlttvrc" +RCFILE="$(dirname $0)/.runlttvrc" -ARGS="-L lttv/modules/gui/controlflow/.libs -m guicontrolflow -L lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow -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" -LTTV_EXEC="lttv/lttv/.libs/lttv.real" +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 [ ! -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 +if [ -n "$TF" ]; then + TRACEFILE="-t $TF" +fi + if [ -e "$RCFILE" ]; then source "$RCFILE"; fi -if [ "$1" = "dbg" ]; then - LD_LIBRARY_PATH=ltt/.libs gdb --args $LTTV_EXEC $ARGS $TRACEFILE -elif [ "$1" = "valgrind" ]; then - LD_LIBRARY_PATH=ltt/.libs valgrind $LTTV_EXEC $ARGS $TRACEFILE -elif [ "$1" = "strace" ]; then - LD_LIBRARY_PATH=ltt/.libs strace $LTTV_EXEC $ARGS $TRACEFILE +HELPER=$1 +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 + LD_LIBRARY_PATH=ltt/.libs $LTTV_EXEC $ARGS $TRACEFILE $@ fi