-
Notifications
You must be signed in to change notification settings - Fork 10
/
run-stap.in
37 lines (31 loc) · 982 Bytes
/
run-stap.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
srcdir='@abs_top_srcdir@'
builddir='@abs_top_builddir@'
rundir="${0%/*}"
[ "$rundir" == "$0" ] || builddir="$rundir"
# Absolutify the paths.
case "$srcdir" in
/*) ;;
*) srcdir=`cd "$srcdir" && pwd` || exit ;;
esac
case "$builddir" in
/*) ;;
*) builddir=`cd "$builddir" && pwd` || exit ;;
esac
# Set all the variables to find the source and build trees.
SYSTEMTAP_TAPSET="${srcdir}/tapset"
SYSTEMTAP_RUNTIME="${srcdir}/runtime"
SYSTEMTAP_STAPRUN="${builddir}/runtime/staprun/run-staprun"
export SYSTEMTAP_TAPSET SYSTEMTAP_RUNTIME SYSTEMTAP_STAPRUN
# If there were private elfutils libs built, use them.
if [ -d "$rundir/lib-elfutils" ]; then
lib_elfutils="$rundir/lib-elfutils"
elfutils_path="${lib_elfutils}:${lib_elfutils}/systemtap"
LD_LIBRARY_PATH="${elfutils_path}${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
fi
if [ -z "$DEBUG_STAP" ]; then
exec "${builddir}/stap" ${1+"$@"}
else
exec gdb --args "${builddir}/stap" ${1+"$@"}
fi