Tests: triggers: Add kprobe event rule condition kernel tests
[lttng-tools.git] / tests / regression / kernel / test_all_events
1 #!/bin/bash
2 #
3 # Copyright (C) 2013 Christian Babeux <christian.babeux@efficios.com>
4 #
5 # SPDX-License-Identifier: GPL-2.0-only
6 #
7
8 TEST_DESC="Kernel tracer - All events"
9
10 CURDIR=$(dirname $0)/
11 TESTDIR=$CURDIR/../..
12 NUM_TESTS=8
13
14 TESTCMD="/bin/true"
15
16 source $TESTDIR/utils/utils.sh
17
18 function test_all_event()
19 {
20 TRACE_PATH=$(mktemp -d)
21 SESSION_NAME="kernel_all_events_basic"
22
23 create_lttng_session_ok $SESSION_NAME $TRACE_PATH
24
25 lttng_enable_kernel_event $SESSION_NAME
26
27 start_lttng_tracing_ok
28
29 # Running a process and waiting for its completion forces the triggering of a
30 # sched_switch event
31 eval ${TESTCMD}
32 stop_lttng_tracing_ok
33
34 validate_trace "sched_switch" $TRACE_PATH
35
36 destroy_lttng_session_ok $SESSION_NAME
37
38 rm -rf $TRACE_PATH
39 }
40
41 # MUST set TESTDIR before calling those functions
42 plan_tests $NUM_TESTS
43
44 print_test_banner "$TEST_DESC"
45
46 if [ "$(id -u)" == "0" ]; then
47 isroot=1
48 else
49 isroot=0
50 fi
51
52 skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
53 {
54 start_lttng_sessiond
55
56 test_all_event
57
58 stop_lttng_sessiond
59 }
This page took 0.031415 seconds and 4 git commands to generate.