3 # Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
4 # Copyright (C) - 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 # This program is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License, version 2 only, as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 # You should have received a copy of the GNU General Public License along with
16 # this program; if not, write to the Free Software Foundation, Inc., 51
17 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 TEST_DESC
="UST tracer - Event wildcard"
22 TESTDIR
=$CURDIR/..
/..
/..
24 TESTAPP_PATH
="$TESTDIR/utils/testapp"
25 TESTAPP_NAME
="gen-ust-events"
26 TESTAPP_BIN
="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
27 SESSION_NAME
="wildcard"
28 EVENT_NAME
="tp:tptest"
32 source $TESTDIR/utils
/utils.sh
34 if [ ! -x "$TESTAPP_BIN" ]; then
35 BAIL_OUT
"No UST nevents binary detected."
38 function test_event_wildcard
()
40 TRACE_PATH
=$
(mktemp
-d)
44 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
45 enable_ust_lttng_event_ok
$SESSION_NAME "$WILDCARD"
47 start_lttng_tracing_ok
49 $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
50 ok $?
"Traced application stopped."
53 destroy_lttng_session_ok
$SESSION_NAME
55 if [ ${FIND} -eq 1 ]; then
56 trace_matches
$EVENT_NAME $NR_ITER $TRACE_PATH
58 validate_trace_empty
$TRACE_PATH
64 function test_event_wildcard_fail
()
66 TRACE_PATH
=$
(mktemp
-d)
69 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
70 enable_ust_lttng_event_fail
$SESSION_NAME "$WILDCARD"
71 destroy_lttng_session_ok
$SESSION_NAME
77 # MUST set TESTDIR before calling those functions
80 print_test_banner
"$TEST_DESC"
84 test_event_wildcard
1 'tp:tp*'
85 test_event_wildcard
1 '*'
86 test_event_wildcard
1 'tp:tptest*'
87 test_event_wildcard
0 'tp:abc*'
89 test_event_wildcard_fail
'tp:*tp'
90 test_event_wildcard_fail
'tp:tp**'
91 test_event_wildcard_fail
'*tp:tp*'