46b97f4433159ac7b8f449310f9edf82ec6c1aec
3 # Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
5 # This library is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Lesser General Public License as published by the Free
7 # Software Foundation; version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 TEST_DESC
="UST tracer - Start tracing before and after execution"
22 SESSION_NAME
="per-session"
23 EVENT_NAME
="ust_gen_nevents:tptest"
25 source $TESTDIR/utils.sh
27 print_test_banner
"$TEST_DESC"
29 if [ ! -x "$CURDIR/gen-nevents" ]; then
30 echo -e "No UST nevents binary detected. Passing."
34 # MUST set TESTDIR before calling those functions
39 # BEFORE application is spawned
40 create_lttng_session
$SESSION_NAME $TRACE_PATH
41 enable_ust_lttng_event
$SESSION_NAME $EVENT_NAME
42 start_lttng_tracing
$SESSION_NAME
44 echo -n "Starting application... "
45 .
/$CURDIR/gen-nevents
$NR_ITER
48 stop_lttng_tracing
$SESSION_NAME
49 destroy_lttng_session
$SESSION_NAME
51 trace_matches
$EVENT_NAME $NR_ITER $TRACE_PATH
59 echo -n "Starting application... "
60 .
/$CURDIR/gen-nevents
100 &
63 # BEFORE application is spawned
64 create_lttng_session
$SESSION_NAME $TRACE_PATH
65 enable_ust_lttng_event
$SESSION_NAME $EVENT_NAME
66 start_lttng_tracing
$SESSION_NAME
68 # At least hit one event
71 stop_lttng_tracing
$SESSION_NAME
72 destroy_lttng_session
$SESSION_NAME
74 out
=$
(babeltrace
$TRACE_PATH |
grep $EVENT_NAME |
wc -l)
75 if [ $out -eq 0 ]; then
76 echo -n "No event found. Suppose to have at least one... "
80 echo -n "Found $out event(s). Coherent... "
88 # MUST set TESTDIR before calling those functions
93 echo "=== Start application BEFORE tracing was started ==="
95 TRACE_PATH
=$
(mktemp
-d)
99 if [ $out -ne 0 ]; then
107 echo "=== Start application AFTER tracing was started ==="
109 TRACE_PATH
=$
(mktemp
-d)
113 if [ $out -ne 0 ]; then
This page took 0.031463 seconds and 3 git commands to generate.