Tests: add kernel --function basic test case
[lttng-tools.git] / tests / regression / ust / test_event_tracef
CommitLineData
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
8TEST_DESC="UST tracer - tracef events"
9
10CURDIR=$(dirname $0)/
11TESTDIR=$CURDIR/../..
38150970
MD
12TESTAPP_PATH="$TESTDIR/utils/testapp"
13TESTAPP_NAME="gen-ust-tracef"
14TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
15SESSION_NAME="tracef"
16EVENT_NAME="lttng_ust_tracef:event"
17NUM_TESTS=9
18NR_ITER=100
19
20source $TESTDIR/utils/utils.sh
21
22if [ ! -x "$TESTAPP_BIN" ]; then
23 BAIL_OUT "No UST nevents binary detected."
24fi
25
26function 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
44plan_tests $NUM_TESTS
45
46print_test_banner "$TEST_DESC"
47
48start_lttng_sessiond
49
50TRACE_PATH=$(mktemp -d)
51test_event_tracef
52out=$?
53if [ $out -ne 0 ]; then
54 stop_lttng_sessiond
55 exit $out
56fi
57
58stop_lttng_sessiond
59
60rm -rf $TRACE_PATH
This page took 0.038576 seconds and 4 git commands to generate.