3 # Copyright (C) 2017 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
5 # SPDX-License-Identifier: LGPL-2.1-only
7 CURDIR
=$
(dirname "$0")/
8 TESTDIR
=$CURDIR/..
/..
/..
/
10 TESTAPP_STATE_PATH
=$
(mktemp
--tmpdir -u "tmp.test_notif_kernel_syscall_application_state.XXXXXX")
14 # shellcheck source=../../../utils/utils.sh
15 source "$TESTDIR/utils/utils.sh"
16 # shellcheck source=./util_event_generator.sh
17 source "$CURDIR/util_event_generator.sh"
19 function test_kernel_syscall_notification
21 kernel_event_generator_run_once_per_transition generate_syscalls \
22 "$TESTAPP_STATE_PATH" 10 /proc
/cpuinfo
/proc
/cmdline
&
25 # Pass the syscall_generator_file for filtering
26 "$CURDIR/notification" 5 LTTNG_DOMAIN_KERNEL
$APP_PID \
30 kill -SIGUSR2 $APP_PID
31 wait $APP_PID 2> /dev
/null
34 if [ "$(id -u)" == "0" ]; then
35 validate_lttng_modules_present
37 start_lttng_sessiond_notap
39 test_kernel_syscall_notification
41 stop_lttng_sessiond_notap
44 # Kernel tests are skipped.
46 skip
0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS
49 rm -f "$TESTAPP_STATE_PATH"