3 # Copyright (C) 2021 Francis Deslauriers <francis.deslauriers@efficios.com>
5 # SPDX-License-Identifier: GPL-2.0-only
8 TEST_DESC
="Kernel tracer - function event"
14 source $TESTDIR/utils
/utils.sh
16 function test_kernel_function_basic
()
18 local TRACE_PATH
=$
(mktemp
-d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX")
19 local SESSION_NAME
="kernel_function_basic"
20 local EVENT_NAME
="my_event_name"
21 local TARGET_SYMBOL
="lttng_test_filter_event_write"
23 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
25 lttng_enable_kernel_function_event_ok
$SESSION_NAME "$TARGET_SYMBOL" "$EVENT_NAME"
27 start_lttng_tracing_ok
29 echo 1 > /proc
/lttng-test-filter-event
33 validate_trace
"${EVENT_NAME}_entry" $TRACE_PATH
34 validate_trace
"${EVENT_NAME}_exit" $TRACE_PATH
36 destroy_lttng_session_ok
$SESSION_NAME
41 # MUST set TESTDIR before calling those functions
44 print_test_banner
"$TEST_DESC"
46 check_skip_kernel_test
"$NUM_TESTS" "Skipping all tests." ||
48 start_lttng_sessiond_notap
49 validate_lttng_modules_present
52 test_kernel_function_basic
54 modprobe
--remove lttng-test
55 stop_lttng_sessiond_notap