diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-09-06 06:22:58 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-10-19 12:50:28 -0400 |
commit | 46a5a8976116026302e9ee9b94bc93cdb40e247f (patch) | |
tree | 7941c2b0f634587dafe0d647a41a7f32b526df2c | |
parent | fe67e69e273ea7d589488465e95ba2b5b6d0a9a6 (diff) |
Auto-discover ftcat in st_trace
-rwxr-xr-x | st_trace | 30 |
1 files changed, 28 insertions, 2 deletions
@@ -1,5 +1,32 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | PATH_TO_SCRIPT=`dirname $0` | ||
4 | function 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 | |||
19 | function 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 | |||
3 | if [ "$1" == "-s" ] | 30 | if [ "$1" == "-s" ] |
4 | then | 31 | then |
5 | AUTO=1 | 32 | AUTO=1 |
@@ -21,8 +48,7 @@ on_finish() | |||
21 | # register shutdown signal handler | 48 | # register shutdown signal handler |
22 | trap 'on_finish' SIGUSR1 | 49 | trap '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 | ||