Gen-ust-events: use options instead of arguments
[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/../..
8679c86b
CB
22BIN_NAME="gen-ust-events"
23SESSION_NAME="valid_filter"
24EVENT_NAME="tp:tptest"
8679c86b 25
8679c86b 26
8dcef147 27NUM_TESTS=25
8679c86b 28
8dcef147 29source $TESTDIR/utils/utils.sh
8679c86b
CB
30
31function test_event_basic()
32{
33 TRACE_PATH=$(mktemp -d)
34 SESSION_NAME="ust_event_basic"
35 SESSION_NAME2="ust_event_basic2"
36 CHAN_NAME="mychan"
37 CHAN_NAME2="mychan2"
38 EVENT_NAME="tp1"
39 EVENT_NAME2="ev2"
40 EVENT_NAME3="ev3"
41
bf6ae429
JR
42 create_lttng_session_ok $SESSION_NAME $TRACE_PATH
43 create_lttng_session_ok $SESSION_NAME2 $TRACE_PATH
8679c86b 44
827caf52
JR
45 enable_ust_lttng_channel_ok $SESSION_NAME $CHAN_NAME
46 enable_ust_lttng_channel_ok $SESSION_NAME2 $CHAN_NAME2
8679c86b 47
8dcef147
JR
48 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHAN_NAME
49 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME2 $CHAN_NAME
50 enable_ust_lttng_event_ok $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
8679c86b 51
8dcef147
JR
52 add_context_ust_ok $SESSION_NAME $CHAN_NAME "vpid"
53 add_context_ust_ok $SESSION_NAME $CHAN_NAME "vtid"
54 add_context_ust_ok $SESSION_NAME $CHAN_NAME "pthread_id"
55 add_context_ust_ok $SESSION_NAME $CHAN_NAME "procname"
56 add_context_ust_ok $SESSION_NAME2 $CHAN_NAME2 "procname"
8679c86b 57
8dcef147
JR
58 disable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHAN_NAME
59 disable_ust_lttng_event $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
8679c86b 60
8dcef147
JR
61 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHAN_NAME
62 enable_ust_lttng_event_ok $SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
8679c86b 63
e563bbdb 64 start_lttng_tracing_ok
96340a01 65 stop_lttng_tracing_ok
8679c86b 66
e563bbdb 67 start_lttng_tracing_ok
96340a01 68 stop_lttng_tracing_ok
8679c86b 69
a36b26b4 70 # TODO: Validate trace output is coherent"
8679c86b 71 ok 0 "Validate trace"
8679c86b 72
67b4c664
JR
73 destroy_lttng_session_ok $SESSION_NAME2
74 destroy_lttng_session_ok $SESSION_NAME
8679c86b
CB
75
76 rm -rf $TRACE_PATH
77}
78
79# MUST set TESTDIR before calling those functions
80plan_tests $NUM_TESTS
81
e3bef725
CB
82print_test_banner "$TEST_DESC"
83
8679c86b
CB
84start_lttng_sessiond
85
86test_event_basic
87
88stop_lttng_sessiond
This page took 0.052219 seconds and 5 git commands to generate.