X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=8e6563d0672098e7c6d2f467bd26e4460a40b636;hp=88a4ddd20c30216d6f19ea07b4160df998cb3c9b;hb=bc3c79aee8149b3e983d38bae4bf455dad927296;hpb=c8e000ef6be08c492f79b51b9752e5d8b9b26d59 diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 88a4ddd20..8e6563d06 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -139,10 +139,19 @@ function conf_proc_count() # Bail out on failure function validate_lttng_modules_present () { + # Check for loadable modules. modprobe -n lttng-tracer 2>/dev/null - if [ $? -ne 0 ]; then - BAIL_OUT "LTTng modules not detected." + if [ $? -eq 0 ]; then + return 0 + fi + + # Check for builtin modules. + ls /proc/lttng > /dev/null 2>&1 + if [ $? -eq 0 ]; then + return 0 fi + + BAIL_OUT "LTTng modules not detected." } function enable_kernel_lttng_event @@ -1170,8 +1179,16 @@ function enable_ust_lttng_event_filter() local sess_name="$1" local event_name="$2" local filter="$3" + local channel_name=$4 + + if [ -z $channel_name ]; then + # default channel if none specified + chan="" + else + chan="-c $channel_name" + fi - $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" -s $sess_name -u --filter "$filter" 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST + $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $chan "$event_name" -s $sess_name -u --filter "$filter" 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST ok $? "Enable event $event_name with filtering for session $sess_name" }