X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Ftracker%2Ftest_event_tracker;h=be42407405df6e3aca655326f58a3bf13548ecd4;hb=b9263e1ac5e563a689273b6ef6aa6f4d081cfb40;hp=deecb8f8072ab7969a6608962781842c6e635ee4;hpb=c125de8f5c0dc9ba3ada63e9317e468ffb9e335a;p=lttng-tools.git diff --git a/tests/regression/tools/tracker/test_event_tracker b/tests/regression/tools/tracker/test_event_tracker index deecb8f80..be4240740 100755 --- a/tests/regression/tools/tracker/test_event_tracker +++ b/tests/regression/tools/tracker/test_event_tracker @@ -40,8 +40,8 @@ source $TESTDIR/utils/utils.sh # untracking on an active app. function prepare_ust_app { - TOUCH_BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_touch_before_last.XXXXXX) - SYNC_BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX) + TOUCH_BEFORE_LAST_PATH=$(mktemp -u -t tmp.${FUNCNAME[0]}_touch_before_last.XXXXXX) + SYNC_BEFORE_LAST_PATH=$(mktemp -u -t tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX) $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \ --sync-before-last-event-touch "$TOUCH_BEFORE_LAST_PATH" \ @@ -52,7 +52,7 @@ function prepare_ust_app # Wait for the app to execute all the way to right before the last # event. while [ ! -f "${TOUCH_BEFORE_LAST_PATH}" ]; do - sleep 0.5 + sleep 0.01 done } @@ -69,7 +69,7 @@ function trace_ust_app function prepare_kernel_app { - WAIT_PATH=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_wait_path.XXXXXX") + WAIT_PATH=$(mktemp -u -t "tmp.${FUNCNAME[0]}_wait_path.XXXXXX") "$TESTAPP_KERNEL_BIN" "$WAIT_PATH" $NR_ITER & CHILD_PID=$! @@ -94,7 +94,7 @@ function test_event_tracker() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -114,7 +114,7 @@ function test_event_tracker() trace_"$domain"_app stop_lttng_tracing_ok - destroy_lttng_session_ok $SESSION_NAME + destroy_lttng_session_ok $SESSION_NAME --no-wait if [ "$expect_event" -eq 1 ]; then trace_matches "$EVENT_NAME" $NR_ITER "$trace_path" @@ -135,7 +135,7 @@ function test_event_vpid_tracker() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -159,7 +159,7 @@ function test_event_vpid_tracker() trace_"$domain"_app stop_lttng_tracing_ok - destroy_lttng_session_ok $SESSION_NAME + destroy_lttng_session_ok $SESSION_NAME --no-wait if [ "$expect_event" -eq 1 ]; then validate_trace "$EVENT_NAME" "$trace_path" @@ -180,7 +180,7 @@ function test_event_pid_tracker() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -204,7 +204,7 @@ function test_event_pid_tracker() trace_"$domain"_app stop_lttng_tracing_ok - destroy_lttng_session_ok $SESSION_NAME + destroy_lttng_session_ok $SESSION_NAME --no-wait if [ "$expect_event" -eq 1 ]; then validate_trace "$EVENT_NAME" "$trace_path" @@ -225,12 +225,12 @@ function test_event_tracker_fail() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" enable_"$domain"_lttng_event_ok $SESSION_NAME "$wildcard" lttng_track_"$domain"_fail "${tracker}" - destroy_lttng_session_ok $SESSION_NAME + destroy_lttng_session_ok $SESSION_NAME --no-wait rm -rf "$trace_path" } @@ -246,7 +246,7 @@ function test_event_track_untrack() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -267,7 +267,7 @@ function test_event_track_untrack() trace_"$domain"_app stop_lttng_tracing_ok - destroy_lttng_session_ok $SESSION_NAME + destroy_lttng_session_ok $SESSION_NAME --no-wait if [ "$expect_event" -eq 1 ]; then trace_matches "$EVENT_NAME" $NR_ITER "$trace_path" @@ -288,7 +288,7 @@ function test_event_vpid_track_untrack() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -309,7 +309,7 @@ function test_event_vpid_track_untrack() trace_"$domain"_app stop_lttng_tracing_ok - destroy_lttng_session_ok $SESSION_NAME + destroy_lttng_session_ok $SESSION_NAME --no-wait if [ "$expect_event" -eq 1 ]; then validate_trace "$EVENT_NAME" "$trace_path" @@ -330,7 +330,7 @@ function test_event_pid_track_untrack() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -351,7 +351,7 @@ function test_event_pid_track_untrack() trace_"$domain"_app stop_lttng_tracing_ok - destroy_lttng_session_ok $SESSION_NAME + destroy_lttng_session_ok $SESSION_NAME --no-wait if [ "$expect_event" -eq 1 ]; then validate_trace "$EVENT_NAME" "$trace_path" @@ -366,7 +366,7 @@ function test_event_ust_vpid_untrack_snapshot() { diag "${FUNCNAME[0]} $*" - local trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + local trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" "--snapshot" @@ -382,7 +382,7 @@ function test_event_ust_vpid_untrack_snapshot() lttng_snapshot_record $SESSION_NAME stop_lttng_tracing_ok - destroy_lttng_session_ok $SESSION_NAME + destroy_lttng_session_ok $SESSION_NAME --no-wait snapshot_count=$(find "$trace_path" -name metadata | wc -l) is "$snapshot_count" 0 "Number of snapshot is zero" @@ -565,6 +565,19 @@ skip $isroot "Root access is needed. Skipping all kernel tracker tests." $NUM_KE test_event_tracker kernel 1 "${EVENT_NAME}" "--pid --all" test_event_pid_tracker kernel 1 "${EVENT_NAME}" + # When using session destroy with '--no-wait', the quick + # exit at the end means that the lttng-test modules is + # still marked as being in use and 'modprobe --remove' fails. + # + # It is possible to work around the issue by not setting + # '--no-wait' on the last kernel test, but it seems like + # an easy detail to forget about. + # + # The sleep here gives the system a small amount of time to + # finish wrapping up the session that had the lttng-test kernel + # module loaded. + sleep 1 + modprobe --remove lttng-test ok $? "Unloading lttng-test module" }