# 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
{
local trace_path="$1"
- files="$(ls -A "$trace_path")"
+ # Do not double quote `$trace_path` below as we want wildcards to be
+ # expanded.
+ files="$(ls -A $trace_path)"
ret=$?
if [ $ret -ne 0 ]; then
fail "Failed to list content of directory \"$trace_path\""