test: UST tracing destroy flush behavior with tracefile rotation
[lttng-tools.git] / tests / regression / ust / test_event_basic
CommitLineData
8679c86b
CB
1#!/bin/bash
2#
3# Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
4#
5# This program is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License, version 2 only, as
7# published by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12# more details.
13#
14# You should have received a copy of the GNU General Public License along with
15# this program; if not, write to the Free Software Foundation, Inc., 51
16# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18TEST_DESC="UST tracer - Basic events"
19
20CURDIR=$(dirname $0)/
21TESTDIR=$CURDIR/../..
22LTTNG_BIN="lttng"
23BIN_NAME="gen-ust-events"
24SESSION_NAME="valid_filter"
25EVENT_NAME="tp:tptest"
8679c86b 26
8679c86b 27
8dcef147 28NUM_TESTS=25
8679c86b 29
8dcef147 30source $TESTDIR/utils/utils.sh
8679c86b
CB
31
32function test_event_basic()
33{
34 TRACE_PATH=$(mktemp -d)
35 SESSION_NAME="ust_event_basic"
36 SESSION_NAME2="ust_event_basic2"
37 CHAN_NAME="mychan"
38 CHAN_NAME2="mychan2"
39 EVENT_NAME="tp1"
40 EVENT_NAME2="ev2"
41 EVENT_NAME3="ev3"
42
bf6ae429
JR
43 create_lttng_session_ok $SESSION_NAME $TRACE_PATH
44 create_lttng_session_ok $SESSION_NAME2 $TRACE_PATH
8679c86b 45
827caf52
JR
46 enable_ust_lttng_channel_ok $SESSION_NAME $CHAN_NAME
47 enable_ust_lttng_channel_ok $SESSION_NAME2 $CHAN_NAME2
8679c86b 48
8dcef147
JR
49 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHAN_NAME
50 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME2 $CHAN_NAME
51 enable_ust_lttng_event_ok $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
8679c86b 52
8dcef147
JR
53 add_context_ust_ok $SESSION_NAME $CHAN_NAME "vpid"
54 add_context_ust_ok $SESSION_NAME $CHAN_NAME "vtid"
55 add_context_ust_ok $SESSION_NAME $CHAN_NAME "pthread_id"
56 add_context_ust_ok $SESSION_NAME $CHAN_NAME "procname"
57 add_context_ust_ok $SESSION_NAME2 $CHAN_NAME2 "procname"
8679c86b 58
8dcef147
JR
59 disable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHAN_NAME
60 disable_ust_lttng_event $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
8679c86b 61
8dcef147
JR
62 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHAN_NAME
63 enable_ust_lttng_event_ok $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
8679c86b 64
e563bbdb 65 start_lttng_tracing_ok
96340a01 66 stop_lttng_tracing_ok
8679c86b 67
e563bbdb 68 start_lttng_tracing_ok
96340a01 69 stop_lttng_tracing_ok
8679c86b 70
a36b26b4 71 # TODO: Validate trace output is coherent"
8679c86b 72 ok 0 "Validate trace"
8679c86b 73
67b4c664
JR
74 destroy_lttng_session_ok $SESSION_NAME2
75 destroy_lttng_session_ok $SESSION_NAME
8679c86b
CB
76
77 rm -rf $TRACE_PATH
78}
79
80# MUST set TESTDIR before calling those functions
81plan_tests $NUM_TESTS
82
e3bef725
CB
83print_test_banner "$TEST_DESC"
84
8679c86b
CB
85start_lttng_sessiond
86
87test_event_basic
88
89stop_lttng_sessiond
This page took 0.033415 seconds and 4 git commands to generate.