aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2012-09-06 06:22:58 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2012-10-19 12:50:28 -0400
commit46a5a8976116026302e9ee9b94bc93cdb40e247f (patch)
tree7941c2b0f634587dafe0d647a41a7f32b526df2c
parentfe67e69e273ea7d589488465e95ba2b5b6d0a9a6 (diff)
Auto-discover ftcat in st_trace
-rwxr-xr-xst_trace30
1 files changed, 28 insertions, 2 deletions
diff --git a/st_trace b/st_trace
index e9c1a9f..64bc3dd 100755
--- a/st_trace
+++ b/st_trace
@@ -1,5 +1,32 @@
1#!/bin/bash 1#!/bin/bash
2 2
3PATH_TO_SCRIPT=`dirname $0`
4function find_helper()
5{
6 IN_PATH=`which $1`
7 REL_TO_PATH="$PATH_TO_SCRIPT/$2"
8 if [ -z "$IN_PATH" ] && [ ! -z "$PATH_TO_SCRIPT" ] && [ -x "$PATH_TO_SCRIPT/$1" ]
9 then
10 echo "$PATH_TO_SCRIPT/$1"
11 elif [ -z "$IN_PATH" ] && [ ! -z "$PATH_TO_SCRIPT" ] && [ -x "$REL_TO_PATH/$1" ]
12 then
13 echo "$REL_TO_PATH/$1"
14 else
15 echo "$IN_PATH"
16 fi
17}
18
19function die()
20{
21 echo "Error: $*"
22 exit 1
23}
24
25
26[ -z "$FTCAT" ] && FTCAT=`find_helper ftcat ../ft_tools`
27[ -z "$FTCAT" ] && die "Can't find 'ftcat' utility."
28[ -z "$FTDEV" ] && FTDEV=/dev/litmus/sched_trace
29
3if [ "$1" == "-s" ] 30if [ "$1" == "-s" ]
4then 31then
5 AUTO=1 32 AUTO=1
@@ -21,8 +48,7 @@ on_finish()
21# register shutdown signal handler 48# register shutdown signal handler
22trap 'on_finish' SIGUSR1 49trap 'on_finish' SIGUSR1
23 50
24[ -z "$FTCAT" ] && FTCAT=ftcat 51
25[ -z "$FTDEV" ] && FTDEV=/dev/litmus/sched_trace
26 52
27# Setup up sched_trace tracing. 53# Setup up sched_trace tracing.
28 54