Add kernel and UST time namespace context
[lttng-tools.git] / tests / regression / ust / test_event_basic
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 TEST_DESC="UST tracer - Basic events"
8
9 CURDIR=$(dirname $0)/
10 TESTDIR=$CURDIR/../..
11 BIN_NAME="gen-ust-events"
12 SESSION_NAME="valid_filter"
13 EVENT_NAME="tp:tptest"
14
15
16 NUM_TESTS=25
17
18 source $TESTDIR/utils/utils.sh
19
20 function test_event_basic()
21 {
22 TRACE_PATH=$(mktemp -d)
23 SESSION_NAME="ust_event_basic"
24 SESSION_NAME2="ust_event_basic2"
25 CHAN_NAME="mychan"
26 CHAN_NAME2="mychan2"
27 EVENT_NAME="tp1"
28 EVENT_NAME2="ev2"
29 EVENT_NAME3="ev3"
30
31 create_lttng_session_ok $SESSION_NAME $TRACE_PATH
32 create_lttng_session_ok $SESSION_NAME2 $TRACE_PATH
33
34 enable_ust_lttng_channel_ok $SESSION_NAME $CHAN_NAME
35 enable_ust_lttng_channel_ok $SESSION_NAME2 $CHAN_NAME2
36
37 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHAN_NAME
38 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME2 $CHAN_NAME
39 enable_ust_lttng_event_ok $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
40
41 add_context_ust_ok $SESSION_NAME $CHAN_NAME "vpid"
42 add_context_ust_ok $SESSION_NAME $CHAN_NAME "vtid"
43 add_context_ust_ok $SESSION_NAME $CHAN_NAME "pthread_id"
44 add_context_ust_ok $SESSION_NAME $CHAN_NAME "procname"
45 add_context_ust_ok $SESSION_NAME2 $CHAN_NAME2 "procname"
46
47 disable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHAN_NAME
48 disable_ust_lttng_event $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
49
50 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHAN_NAME
51 enable_ust_lttng_event_ok $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
52
53 start_lttng_tracing_ok
54 stop_lttng_tracing_ok
55
56 start_lttng_tracing_ok
57 stop_lttng_tracing_ok
58
59 # TODO: Validate trace output is coherent"
60 ok 0 "Validate trace"
61
62 destroy_lttng_session_ok $SESSION_NAME2
63 destroy_lttng_session_ok $SESSION_NAME
64
65 rm -rf $TRACE_PATH
66 }
67
68 # MUST set TESTDIR before calling those functions
69 plan_tests $NUM_TESTS
70
71 print_test_banner "$TEST_DESC"
72
73 start_lttng_sessiond
74
75 test_event_basic
76
77 stop_lttng_sessiond
This page took 0.032229 seconds and 4 git commands to generate.