Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: benjamin.poirier@polymtl.ca (Benjamin Poirier)
Subject: [ltt-dev] [PATCH 1/3] lttv: Extra arguments in runlttv
Date: Wed, 12 Aug 2009 09:18:22 -0400	[thread overview]
Message-ID: <4A82C11E.3060200@polymtl.ca> (raw)

Here's an alternate take on specifying extra arguments for LTTV in the runlttv
script. They are specified on the command line after the optionnal "helper"
program name. This is more in line with the way commands like `xargs` take
extra arguments for the executable they invoke.

Signed-off-by: Benjamin Poirier <benjamin.poirier at polymtl.ca>
---
 runlttv |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/runlttv b/runlttv
index 983b50c..7af35b0 100755
--- a/runlttv
+++ b/runlttv
@@ -13,7 +13,6 @@
 #     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:
@@ -42,10 +41,6 @@ else
 	exit 1
 fi
 
-for a in $@; do
-	eval $(echo $a)"=1"
-done
-
 if [ -n "$TF" ]; then
 	TRACEFILE="-t $TF"
 fi
@@ -54,14 +49,16 @@ if [ -e "$RCFILE" ]; then
 	source "$RCFILE";
 fi
 
-ARGS="$ARGS $LTTV_ARGS"
-
-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
-- 
1.6.3.3





                 reply	other threads:[~2009-08-12 13:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A82C11E.3060200@polymtl.ca \
    --to=benjamin.poirier@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox