6a5776e23a7441ef6aa60982e436ec65eab5290e
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"
20 TESTDIR
=$CURDIR/..
/..
/..
22 SESSION_NAME
="per-session"
23 EVENT_NAME
="ust_gen_nevents:tptest"
26 source $TESTDIR/utils
/utils.sh
28 print_test_banner
"$TEST_DESC"
30 if [ ! -x "$CURDIR/gen-nevents" ]; then
31 BAIL_OUT
"No UST nevents binary detected."
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 .
/$CURDIR/gen-nevents
$NR_ITER
45 ok $?
"Start application to trace"
47 stop_lttng_tracing
$SESSION_NAME
48 destroy_lttng_session
$SESSION_NAME
50 trace_matches
$EVENT_NAME $NR_ITER $TRACE_PATH
58 .
/$CURDIR/gen-nevents
100 &
59 ok $?
"Start application to trace"
61 # BEFORE application is spawned
62 create_lttng_session
$SESSION_NAME $TRACE_PATH
63 enable_ust_lttng_event
$SESSION_NAME $EVENT_NAME
64 start_lttng_tracing
$SESSION_NAME
66 # At least hit one event
69 stop_lttng_tracing
$SESSION_NAME
70 destroy_lttng_session
$SESSION_NAME
72 out
=$
(babeltrace
$TRACE_PATH |
grep $EVENT_NAME |
wc -l)
73 if [ $out -eq 0 ]; then
74 fail
"Trace validation"
75 diag
"No event(s) found. We are supposed to have at least one."
78 pass
"Trace validation"
79 diag
"Found $out event(s). Coherent."
86 # MUST set TESTDIR before calling those functions
91 diag
"Start application BEFORE tracing was started"
93 TRACE_PATH
=$
(mktemp
-d)
97 if [ $out -ne 0 ]; then
104 diag
"Start application AFTER tracing was started"
106 TRACE_PATH
=$
(mktemp
-d)
110 if [ $out -ne 0 ]; then
This page took 0.037367 seconds and 4 git commands to generate.