From: Julien Desfossez Date: Mon, 5 Aug 2013 19:04:04 +0000 (-0400) Subject: Test: enable kernel events after start X-Git-Tag: v2.3.0-rc3~65 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=85ed2b26a0f80c02c989b8be80f2cfc6d5cc5776;p=lttng-tools.git Test: enable kernel events after start This test detects if we actually append new metadata when enabling a kernel event after a start. Signed-off-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/regression/kernel/test_event_basic b/tests/regression/kernel/test_event_basic index 5c19744d3..a182f9f21 100755 --- a/tests/regression/kernel/test_event_basic +++ b/tests/regression/kernel/test_event_basic @@ -19,7 +19,7 @@ TEST_DESC="Kernel tracer - Basic event" CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../.. -NUM_TESTS=12 +NUM_TESTS=20 source $TESTDIR/utils/utils.sh @@ -46,6 +46,27 @@ function test_event_basic() rm -rf $TRACE_PATH } +function test_enable_after_start() +{ + TRACE_PATH=$(mktemp -d) + SESSION_NAME="kernel_enable_after_start" + + create_lttng_session $SESSION_NAME $TRACE_PATH + + lttng_enable_kernel_event $SESSION_NAME "sched_switch" + + start_lttng_tracing + lttng_enable_kernel_event $SESSION_NAME "sched_process_exit" + stop_lttng_tracing + + validate_trace "sched_switch" $TRACE_PATH + validate_trace "sched_process_exit" $TRACE_PATH + + destroy_lttng_session $SESSION_NAME + + rm -rf $TRACE_PATH +} + # MUST set TESTDIR before calling those functions plan_tests $NUM_TESTS @@ -62,6 +83,7 @@ skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || start_lttng_sessiond test_event_basic + test_enable_after_start stop_lttng_sessiond }