X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fruntests;h=3cb9da6ad68bc245e6c0ccc8a433d70351dd602f;hb=6c42ce2c7f9c9f2c91170e87029c9c2702a76c6e;hp=e13930a9c57bdcb66305b123a97c46096391799d;hpb=68d19739e607872375bb3425a8a38dc66518e0bf;p=ust.git diff --git a/tests/runtests b/tests/runtests index e13930a..3cb9da6 100755 --- a/tests/runtests +++ b/tests/runtests @@ -62,8 +62,11 @@ TRACE_DIR="/tmp/ust-testsuite-manual-trace" rm -rf "$TRACE_DIR" mkdir "$TRACE_DIR" -NOFAIL ustd -o "$TRACE_DIR" >/dev/null 2>&1 & -USTD_PID=$! +pidfilepath="/tmp/ust-testsuite-$USER-$(date +%Y%m%d%H%M%S%N)-ustd-pid" +mkfifo -m 0600 "$pidfilepath" +# It's not useful to run ustd in NOFAIL because it's running in the background +ustd --pidfile "$pidfilepath" -o "$TRACE_DIR" >/dev/null 2>&1 & +USTD_PID="$(<$pidfilepath)" LD_PRELOAD=/usr/local/lib/libust.so.0.0.0:/usr/local/lib/libmallocwrap.so find / >/dev/null 2>&1 & PID=$! @@ -75,13 +78,37 @@ NOFAIL ustctl --create-trace $PID NOFAIL ustctl --alloc-trace $PID NOFAIL ustctl --start-trace $PID sleep 0.5 + NOFAIL ustctl --stop-trace $PID NOFAIL ustctl --destroy-trace $PID kill $PID -kill $USTD_PID +kill -SIGTERM $USTD_PID +wait $USTD_PID NOFAIL $MATCHES -N "manual - find - ust.malloc" "^ust.malloc:" "$TRACE_DIR" +### Valgrind ustd ### +starttest "ustd valgrind check" +TRACE_DIR="/tmp/ust-testsuite-ustdvalgrind-trace" +rm -rf "$TRACE_DIR" +mkdir "$TRACE_DIR" + +pidfilepath="/tmp/ust-testsuite-$USER-$(date +%Y%m%d%H%M%S%N)-ustd-pid" +mkfifo -m 0600 "$pidfilepath" +# It's not useful to run ustd in NOFAIL because it's running in the background +VALG_OUT=/tmp/ust-testsuite-valg.txt +valgrind -q ustd --pidfile "$pidfilepath" -o "$TRACE_DIR" >/dev/null 2>"$VALG_OUT" & +VALG_PID=$! +USTD_PID="$(<$pidfilepath)" + +usttrace -s $TESTDIR/basic/.libs/basic + +kill -SIGTERM $USTD_PID +wait $! + +echo "Valgrind output is in $VALG_OUT" +NOFAIL [ -z "$(<$VALG_OUT)" ] + echo "************************************" echo "$0: All passed" echo "************************************"