From 03f1168604d69a01bb891d2c8745acbd8050a545 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Thu, 14 May 2020 14:56:05 -0400 Subject: [PATCH] Tests: accept built-in kernel modules MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When validating that the kernel tracer is available on the system also consider that it might be built directly in the kernel. Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau Change-Id: I2b0e1767b8a6d561ad94ba38546cb183d9e98a95 --- tests/utils/utils.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 88a4ddd20..0583b5c19 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 -- 2.34.1