X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fnotification%2Ftest_notification_kernel_buffer_usage;h=3214f90f9aebd2d27d70da17969ac7981d6a62a1;hb=51704c8eb4792d8ff748ffdbc2118471a9a67e6c;hp=904212f396c0d7ef318a57c241ab468c084b886f;hpb=069fc1c5abf8a9ce01feab82906faf6d02b95c97;p=lttng-tools.git diff --git a/tests/regression/tools/notification/test_notification_kernel_buffer_usage b/tests/regression/tools/notification/test_notification_kernel_buffer_usage index 904212f39..3214f90f9 100755 --- a/tests/regression/tools/notification/test_notification_kernel_buffer_usage +++ b/tests/regression/tools/notification/test_notification_kernel_buffer_usage @@ -23,36 +23,8 @@ NUM_TESTS=104 # shellcheck source=../../../utils/utils.sh source "$TESTDIR/utils/utils.sh" - -function kernel_event_generator_toggle_state -{ - kernel_event_generator_suspended=$((kernel_event_generator_suspended==0)) -} - -function generate_filter_events -{ - /bin/echo -n "10" > /proc/lttng-test-filter-event 2> /dev/null -} - -function kernel_event_generator -{ - command_to_run=$1 - state_file=$2 - kernel_event_generator_suspended=0 - trap kernel_event_generator_toggle_state SIGUSR1 - - while (true); do - if [[ $kernel_event_generator_suspended -eq "1" ]]; then - touch $state_file - sleep 0.5 - else - if [[ -f $state_file ]]; then - rm $state_file 2> /dev/null - fi - $command_to_run - fi - done -} +# shellcheck source=./util_event_generator.sh +source "$CURDIR/util_event_generator.sh" function test_buffer_usage_notification { @@ -79,12 +51,12 @@ function test_buffer_usage_notification consumerd_pipe+=("$f") done - "$CURDIR/notification" 2 LTTNG_DOMAIN_KERNEL $SESSION_NAME $CHANNEL_NAME \ - $APP_PID $TESTAPP_STATE_PATH ${consumerd_pipe[@]} + "$CURDIR/notification" 2 LTTNG_DOMAIN_KERNEL $APP_PID "$TESTAPP_STATE_PATH" \ + $SESSION_NAME $CHANNEL_NAME "${consumerd_pipe[@]}" destroy_lttng_session_notap $SESSION_NAME - kill -9 $APP_PID + kill -SIGUSR2 $APP_PID wait $APP_PID 2> /dev/null }