X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fnotification%2Ftest_notification_ust_buffer_usage;h=a8b96bb33cdc7f2d9df0f7834bf8b8d75539084a;hb=51704c8eb4792d8ff748ffdbc2118471a9a67e6c;hp=7e530d8e404f6c58f984c11ee4c33f1d8e73d414;hpb=069fc1c5abf8a9ce01feab82906faf6d02b95c97;p=lttng-tools.git diff --git a/tests/regression/tools/notification/test_notification_ust_buffer_usage b/tests/regression/tools/notification/test_notification_ust_buffer_usage index 7e530d8e4..a8b96bb33 100755 --- a/tests/regression/tools/notification/test_notification_ust_buffer_usage +++ b/tests/regression/tools/notification/test_notification_ust_buffer_usage @@ -29,31 +29,8 @@ PAGE_SIZE=$(getconf PAGE_SIZE) # shellcheck source=../../../utils/utils.sh source "$TESTDIR/utils/utils.sh" - -function ust_event_generator_toggle_state -{ - ust_event_generator_suspended=$((ust_event_generator_suspended==0)) - -} -function ust_event_generator -{ - test_app=$1 - state_file=$2 - ust_event_generator_suspended=0 - trap ust_event_generator_toggle_state SIGUSR1 - - while (true); do - if [[ $ust_event_generator_suspended -eq "1" ]]; then - touch $state_file - sleep 0.5 - else - if [[ -f $state_file ]]; then - rm -rf $state_file 2> /dev/null - fi - taskset -c 0 $test_app -i $NR_ITER -w $NR_USEC_WAIT > /dev/null 2>&1 - fi - done -} +# shellcheck source=./util_event_generator.sh +source "$CURDIR/util_event_generator.sh" function test_buffer_usage_notification { @@ -70,16 +47,17 @@ function test_buffer_usage_notification consumerd_pipe+=("$f") done - ust_event_generator $GEN_UST_EVENTS_TESTAPP_BIN $TESTAPP_STATE_PATH & + ust_event_generator "$GEN_UST_EVENTS_TESTAPP_BIN" "$TESTAPP_STATE_PATH" & APP_PID=$! - "$CURDIR/notification" 2 LTTNG_DOMAIN_UST $SESSION_NAME $CHANNEL_NAME $APP_PID "$TESTAPP_STATE_PATH" "${consumerd_pipe[@]}" + "$CURDIR/notification" 2 LTTNG_DOMAIN_UST $APP_PID "$TESTAPP_STATE_PATH" \ + $SESSION_NAME $CHANNEL_NAME "${consumerd_pipe[@]}" destroy_lttng_session_notap $SESSION_NAME # On ungraceful kill the app is cleaned up via the full_cleanup call # Suppress kill message - kill -9 $APP_PID + kill -SIGUSR2 $APP_PID wait $APP_PID 2> /dev/null # Just in case cleanup