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 - Testing low events throughput"
20 TESTDIR
=$CURDIR/..
/..
/..
22 SESSION_NAME
="low-throughput"
26 source $TESTDIR/utils
/utils.sh
28 if [ ! -x "$CURDIR/$BIN_NAME" ]; then
29 BAIL_OUT
"No UST nevents binary detected."
32 TRACE_PATH
=$
(mktemp
-d)
34 # MUST set TESTDIR before calling those functions
38 print_test_banner
"$TEST_DESC"
42 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
44 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME
45 start_lttng_tracing_ok
$SESSION_NAME
47 # This is going to take 20 minutes
48 .
/$CURDIR/$BIN_NAME >/dev
/null
2>&1
50 stop_lttng_tracing
$SESSION_NAME
51 destroy_lttng_session
$SESSION_NAME
60 babeltrace
$TRACE_PATH |
while read event
;
62 val
=$
(echo $event | cut
-f10 -d" ")
64 th
=$
(echo $event | cut
-f13 -d " ")
66 if [ $th = '"one"' ]; then
68 # We expect here a continous value from 1 to 20
69 if [ $last_val -ne $val ]; then
70 diag
"One minute event failed ($val)"
74 elif [ $th = '"ten"' ]; then
75 # Test 10 minutes counter
76 if [ $val -ne 10 ]; then
77 # Test 20 minutes counter
78 if [ $val -ne 20 ]; then
79 diag
"Ten minutes event failed ($val)"
84 elif [ $th = '"twenty"' ]; then
85 # Test 20 minutes counter
86 if [ $val -ne 20 ]; then
87 diag
"Twenty minutes event failed ($val)"
94 ok
$out "Trace validation"