Add kernel and UST time namespace context
[lttng-tools.git] / tests / regression / ust / test_event_basic
CommitLineData
8679c86b
CB
1#!/bin/bash
2#
9d16b343 3# Copyright (C) 2013 Christian Babeux <christian.babeux@efficios.com>
8679c86b 4#
9d16b343 5# SPDX-License-Identifier: GPL-2.0-only
8679c86b
CB
6
7TEST_DESC="UST tracer - Basic events"
8
9CURDIR=$(dirname $0)/
10TESTDIR=$CURDIR/../..
8679c86b
CB
11BIN_NAME="gen-ust-events"
12SESSION_NAME="valid_filter"
13EVENT_NAME="tp:tptest"
8679c86b 14
8679c86b 15
8dcef147 16NUM_TESTS=25
8679c86b 17
8dcef147 18source $TESTDIR/utils/utils.sh
8679c86b
CB
19
20function 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
bf6ae429
JR
31 create_lttng_session_ok $SESSION_NAME $TRACE_PATH
32 create_lttng_session_ok $SESSION_NAME2 $TRACE_PATH
8679c86b 33
827caf52
JR
34 enable_ust_lttng_channel_ok $SESSION_NAME $CHAN_NAME
35 enable_ust_lttng_channel_ok $SESSION_NAME2 $CHAN_NAME2
8679c86b 36
8dcef147
JR
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
8679c86b 40
8dcef147
JR
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"
8679c86b 46
8dcef147
JR
47 disable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHAN_NAME
48 disable_ust_lttng_event $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
8679c86b 49
8dcef147
JR
50 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHAN_NAME
51 enable_ust_lttng_event_ok $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
8679c86b 52
e563bbdb 53 start_lttng_tracing_ok
96340a01 54 stop_lttng_tracing_ok
8679c86b 55
e563bbdb 56 start_lttng_tracing_ok
96340a01 57 stop_lttng_tracing_ok
8679c86b 58
a36b26b4 59 # TODO: Validate trace output is coherent"
8679c86b 60 ok 0 "Validate trace"
8679c86b 61
67b4c664
JR
62 destroy_lttng_session_ok $SESSION_NAME2
63 destroy_lttng_session_ok $SESSION_NAME
8679c86b
CB
64
65 rm -rf $TRACE_PATH
66}
67
68# MUST set TESTDIR before calling those functions
69plan_tests $NUM_TESTS
70
e3bef725
CB
71print_test_banner "$TEST_DESC"
72
8679c86b
CB
73start_lttng_sessiond
74
75test_event_basic
76
77stop_lttng_sessiond
This page took 0.044331 seconds and 4 git commands to generate.