port: add support for BSD mktemp
[lttng-tools.git] / tests / regression / kernel / test_callstack
index 42c3fcce404195accc5c047113900ad41d3a6d88..ecbba30661f0ee233a83400848fc0eb6ba751c0c 100755 (executable)
@@ -36,8 +36,7 @@ function run_workload()
        # shift the first argument, passing along the other args if any to the
        # test app.
        shift
-       local start_file_sync
-       start_file_sync=$(mktemp -u)
+       local start_file_sync=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_first.XXXXXX")
 
        lttng_untrack_all
 
@@ -61,7 +60,7 @@ function run_workload()
 
 function test_user_callstack()
 {
-       TRACE_PATH=$(mktemp -d)
+       TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX")
        # This is the expected userspace callstack. (see gen-syscall-events-callstack.c)
        USER_CS_EXPECTED="main fct_a fct_b fct_c my_gettid"
        EVENT_NAME="gettid"
@@ -85,7 +84,7 @@ function test_user_callstack()
 
 function test_kernel_callstack()
 {
-       TRACE_PATH=$(mktemp -d)
+       TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX")
        # Those are symbol expected to be present in the kernel callstack. This
        # is not an exhaustive list since it's kernel dependent.
 
@@ -135,6 +134,8 @@ plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
+bail_out_if_no_babeltrace
+
 if [ "$(id -u)" == "0" ]; then
        isroot=1
 else
@@ -143,18 +144,14 @@ fi
 
 skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" ||
 {
-       which "$BABELTRACE_BIN" > /dev/null
-       test $? -ne 0
-       skip $? "Babeltrace binary not found. Skipping callstack tests" "$NUM_TESTS" ||
-       {
-               start_lttng_sessiond
+       validate_lttng_modules_present
+       start_lttng_sessiond
 
-               if test $RUN_USERSPACE_TEST == 1; then
-                       test_user_callstack
-               fi
+       if test $RUN_USERSPACE_TEST == 1; then
+               test_user_callstack
+       fi
 
-               test_kernel_callstack
+       test_kernel_callstack
 
-               stop_lttng_sessiond
-       }
+       stop_lttng_sessiond
 }
This page took 0.023754 seconds and 4 git commands to generate.