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