Commit | Line | Data |
---|---|---|
38150970 MD |
1 | #!/bin/bash |
2 | # | |
3 | # Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com> | |
4 | # Copyright (C) - 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
5 | # | |
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. | |
9 | # | |
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 | |
13 | # more details. | |
14 | # | |
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. | |
18 | ||
19 | TEST_DESC="UST tracer - tracef events" | |
20 | ||
21 | CURDIR=$(dirname $0)/ | |
22 | TESTDIR=$CURDIR/../.. | |
38150970 MD |
23 | TESTAPP_PATH="$TESTDIR/utils/testapp" |
24 | TESTAPP_NAME="gen-ust-tracef" | |
25 | TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" | |
26 | SESSION_NAME="tracef" | |
27 | EVENT_NAME="lttng_ust_tracef:event" | |
28 | NUM_TESTS=9 | |
29 | NR_ITER=100 | |
30 | ||
31 | source $TESTDIR/utils/utils.sh | |
32 | ||
33 | if [ ! -x "$TESTAPP_BIN" ]; then | |
34 | BAIL_OUT "No UST nevents binary detected." | |
35 | fi | |
36 | ||
37 | function test_event_tracef() | |
38 | { | |
bf6ae429 | 39 | create_lttng_session_ok $SESSION_NAME $TRACE_PATH |
c4926bb5 | 40 | enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME |
e563bbdb | 41 | start_lttng_tracing_ok $SESSION_NAME |
38150970 MD |
42 | |
43 | $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT | |
44 | ok $? "Traced application stopped." | |
45 | ||
96340a01 | 46 | stop_lttng_tracing_ok $SESSION_NAME |
67b4c664 | 47 | destroy_lttng_session_ok $SESSION_NAME |
38150970 | 48 | |
d53addeb | 49 | trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH |
38150970 MD |
50 | |
51 | return $? | |
52 | } | |
53 | ||
54 | # MUST set TESTDIR before calling those functions | |
55 | plan_tests $NUM_TESTS | |
56 | ||
57 | print_test_banner "$TEST_DESC" | |
58 | ||
59 | start_lttng_sessiond | |
60 | ||
61 | TRACE_PATH=$(mktemp -d) | |
62 | test_event_tracef | |
63 | out=$? | |
64 | if [ $out -ne 0 ]; then | |
65 | stop_lttng_sessiond | |
66 | exit $out | |
67 | fi | |
68 | ||
69 | stop_lttng_sessiond | |
70 | ||
71 | rm -rf $TRACE_PATH |