3 # Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
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.
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
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.
18 TEST_DESC
="UST tracer - Basic events"
23 BIN_NAME
="gen-ust-events"
24 SESSION_NAME
="valid_filter"
25 EVENT_NAME
="tp:tptest"
28 source $TESTDIR/utils
/utils.sh
30 print_test_banner
"$TEST_DESC"
32 function enable_ust_lttng_event_per_chan
()
38 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$event_name" -s $sess_name -c $chan_name -u >/dev
/null
2>&1
39 ok $?
"Enable event $event_name for session $sess_name in channel $chan_name"
42 function disable_ust_lttng_event_per_chan
()
48 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN disable-event
"$event_name" -s $sess_name -c $chan_name -u >/dev
/null
2>&1
49 ok $?
"Disable event $event_name for session $sess_name in channel $chan_name"
52 function add_ust_lttng_context
()
58 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN add-context
-s $sess_name -c $chan_name -t $type -u >/dev
/null
2>&1
59 ok $?
"Add context $type for session $sess_name in channel $chan_name"
62 function test_event_basic
()
64 TRACE_PATH
=$
(mktemp
-d)
65 SESSION_NAME
="ust_event_basic"
66 SESSION_NAME2
="ust_event_basic2"
73 create_lttng_session
$SESSION_NAME $TRACE_PATH
74 create_lttng_session
$SESSION_NAME2 $TRACE_PATH
76 enable_ust_lttng_channel
$SESSION_NAME $CHAN_NAME
77 enable_ust_lttng_channel
$SESSION_NAME2 $CHAN_NAME2
79 enable_ust_lttng_event_per_chan
$SESSION_NAME $EVENT_NAME $CHAN_NAME
80 enable_ust_lttng_event_per_chan
$SESSION_NAME $EVENT_NAME2 $CHAN_NAME
81 enable_ust_lttng_event_per_chan
$SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
83 add_ust_lttng_context
$SESSION_NAME $CHAN_NAME "vpid"
84 add_ust_lttng_context
$SESSION_NAME $CHAN_NAME "vtid"
85 add_ust_lttng_context
$SESSION_NAME $CHAN_NAME "pthread_id"
86 add_ust_lttng_context
$SESSION_NAME $CHAN_NAME "procname"
87 add_ust_lttng_context
$SESSION_NAME2 $CHAN_NAME2 "procname"
89 disable_ust_lttng_event_per_chan
$SESSION_NAME $EVENT_NAME $CHAN_NAME
90 disable_ust_lttng_event_per_chan
$SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
92 enable_ust_lttng_event_per_chan
$SESSION_NAME $EVENT_NAME $CHAN_NAME
93 enable_ust_lttng_event_per_chan
$SESSION_NAME2 $EVENT_NAME3 $CHAN_NAME2
101 TODO
="Validate trace output is coherent"
102 ok
0 "Validate trace"
105 destroy_lttng_session
$SESSION_NAME2
106 destroy_lttng_session
$SESSION_NAME
111 # MUST set TESTDIR before calling those functions
112 plan_tests
$NUM_TESTS