+USTTRACE_DIR="$(dirname $0)"
+if [ -x "${USTTRACE_DIR}/ustd/ustd" ] ; then
+ # Use the not installed libraries instead
+ USTD="${USTTRACE_DIR}/ustd/ustd"
+ LIBINTERFORK_PATH="${USTTRACE_DIR}/libustfork/.libs/libustfork.so"
+ LIBMALLOCWRAP_PATH="${USTTRACE_DIR}/libustinstr-malloc/.libs/libustinstr-malloc.so"
+ LIBUST_PATH="${USTTRACE_DIR}/libust/.libs/libust.so"
+else
+ # Use the libraries that the dynamic link finds
+ USTD="ustd"
+ if [ ! -x "$(which ustd 2>/dev/null)" ]; then
+ error "cannot find an executable ustd; make sure its location is in the PATH"
+ exit 1
+ fi
+ LIBINTERFORK_PATH="libustfork.so"
+ LIBMALLOCWRAP_PATH="libustinstr-malloc.so"
+ LIBUST_PATH="libust.so.0"
+fi
+
+BASE_TRACE_DIR="${HOME}/.usttraces"
+
+function usage () {
+ echo "usage: $0 OPTIONS COMMAND" 2>/dev/stderr
+ echo "" 2>/dev/stderr
+ echo "Options:" 2>/dev/stderr
+ echo " -l Runtime link with UST library." 2>/dev/stderr
+ echo " (Needed only if program was not linked at compile time with libust.)" 2>/dev/stderr
+ echo " -L Add path to ust libraries to LD_LIBRARY_PATH." 2>/dev/stderr
+ echo " -m Instrument malloc calls." 2>/dev/stderr
+ echo " -f Also trace forked processes." 2>/dev/stderr
+ echo " -s Use system-wide daemon instead of creating one for this session." 2>/dev/stderr
+ echo " -S Specify the subbuffer size." 2>/dev/stderr
+ echo " -N Specify the number of subbuffers." 2>/dev/stderr