+USTTRACE_DIR="$(dirname $0)"
+if [ -x "${USTTRACE_DIR}/ust-consumerd/ust-consumerd" ] ; then
+ # Use the not installed libraries instead
+ UST_CONSUMERD="${USTTRACE_DIR}/ust-consumerd/ust-consumerd"
+ 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
+ UST_CONSUMERD="ust-consumerd"
+ if [ ! -x "$(which ust-consumerd 2>/dev/null)" ]; then
+ error "cannot find an executable ust-consumerd; 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"
+
+usage() {
+ echo "usage: $0 OPTIONS COMMAND" 1>&2
+ echo "" 1>&2
+ echo "Options:" 1>&2
+ echo " -l Runtime link with UST library." 1>&2
+ echo " (Needed only if program was not linked at compile time with libust.)" 1>&2
+ echo " -L Add path to ust libraries to LD_LIBRARY_PATH." 1>&2
+ echo " -m Instrument malloc calls." 1>&2
+ echo " -f Also trace forked processes." 1>&2
+ echo " -s Use system-wide daemon instead of creating one for this session." 1>&2
+ echo " -S Specify the subbuffer size." 1>&2
+ echo " -N Specify the number of subbuffers." 1>&2
+ echo " -o Output directory of the trace." 1>&2