Test the parsing of perf raw context
authorJulien Desfossez <jdesfossez@efficios.com>
Tue, 5 Jul 2016 15:50:47 +0000 (11:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 8 Jul 2016 19:23:56 +0000 (15:23 -0400)
Only test the parsing of the new option in fast_regression since the
real integration test requires particular hardware and kernel
configuration which might not be available.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/fast_regression
tests/regression/Makefile.am
tests/regression/ust/test_event_perf

index 8edbecaddfd2fe12e54c29f0811903ce2e6651d2..23211f49a27b4d603d10deac587b000996c67485 100644 (file)
@@ -31,3 +31,4 @@ regression/ust/clock-override/test_clock_override
 regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
 regression/ust/test_event_basic
 regression/ust/test_event_tracef
+regression/ust/test_event_perf
index f2fa9d7aa293a7e68235695d7550900e3d29e384..01cff148cc2c595e60bf585781f18f17ca8d24fd 100644 (file)
@@ -38,7 +38,8 @@ TESTS += ust/before-after/test_before_after \
        ust/getcpu-override/test_getcpu_override \
        ust/clock-override/test_clock_override \
        ust/test_event_basic \
-       ust/test_event_tracef
+       ust/test_event_tracef \
+       ust/test_event_perf
 endif # HAVE_LIBLTTNG_UST_CTL
 
 if PYTHON_BINDING
index a01418ab55167cd60c64c4b921961411120ef525..3328fe8f1686a9e9dd45cf31b40cdc08a334e12d 100755 (executable)
@@ -23,7 +23,7 @@ TESTDIR=$CURDIR/../..
 LTTNG_BIN="lttng"
 SESSION_NAME="perf_counters"
 EVENT_NAME="tp:tptest"
-NUM_TESTS=10
+NUM_TESTS=24
 NR_ITER=1
 NR_USEC_WAIT=1
 TESTAPP_PATH="$TESTDIR/utils/testapp"
@@ -42,14 +42,33 @@ function enable_ust_lttng_event_per_chan()
        ok $? "Enable event $event_name for session $sess_name in channel $chan_name"
 }
 
-function add_ust_lttng_context()
+# Only test parsing of the enabling by raw ID
+function test_parsing_raw()
 {
-       sess_name="$1"
-       chan_name="$2"
-       type="$3"
+       TRACE_PATH=$(mktemp -d)
+       SESSION_NAME="ust_event_basic"
+       CHAN_NAME="mychan"
+
+       create_lttng_session_ok $SESSION_NAME $TRACE_PATH
+
+       enable_ust_lttng_channel_ok $SESSION_NAME $CHAN_NAME
+
+       enable_ust_lttng_event_per_chan $SESSION_NAME $EVENT_NAME $CHAN_NAME
 
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN add-context -s $sess_name -c $chan_name -t $type -u >/dev/null 2>&1
-       ok $? "Add context $type for session $sess_name in channel $chan_name"
+       add_context_ust_ok $SESSION_NAME $CHAN_NAME "perf:thread:raw:r0110:test"
+       add_context_ust_fail $SESSION_NAME $CHAN_NAME "perf:thread:raw:rZZZ:test"
+       add_context_ust_fail $SESSION_NAME $CHAN_NAME "perf:thread:raw:b0110:test"
+       add_context_ust_fail $SESSION_NAME $CHAN_NAME "perf:thread:raw:r0110:"
+       add_context_ust_fail $SESSION_NAME $CHAN_NAME "perf:thread:raw:r0110::"
+       add_context_ust_fail $SESSION_NAME $CHAN_NAME "perf:thread:raw:r:test"
+       add_context_ust_fail $SESSION_NAME $CHAN_NAME "perf:thread:raw:r::"
+       add_context_ust_fail $SESSION_NAME $CHAN_NAME "perf:thread:raw::"
+       add_context_ust_fail $SESSION_NAME $CHAN_NAME "perf:thread:raw"
+       add_context_ust_fail $SESSION_NAME $CHAN_NAME "perf:thread:raw:r0110:test:wrong"
+
+       destroy_lttng_session_ok $SESSION_NAME
+
+       rm -rf $TRACE_PATH
 }
 
 function test_event_basic()
@@ -64,7 +83,7 @@ function test_event_basic()
 
        enable_ust_lttng_event_per_chan $SESSION_NAME $EVENT_NAME $CHAN_NAME
 
-       add_ust_lttng_context $SESSION_NAME $CHAN_NAME "perf:thread:page-fault"
+       add_context_ust_ok $SESSION_NAME $CHAN_NAME "perf:thread:page-fault"
 
        start_lttng_tracing_ok
 
@@ -89,11 +108,13 @@ else
         isroot=0
 fi
 
-skip $isroot "Root access is needed. Skipping UST perf tests." ${NUM_TESTS} ||
-{
-       start_lttng_sessiond
+start_lttng_sessiond
 
-       test_event_basic
+test_parsing_raw
 
-       stop_lttng_sessiond
+skip $isroot "Root access is needed. Skipping UST perf tests." 8 ||
+{
+       test_event_basic
 }
+
+stop_lttng_sessiond
This page took 0.027008 seconds and 4 git commands to generate.