# Check that perf/timer probes trigger in both kernel and user space.
set test "pt_user_mode"

if {! [installtest_p]} { untested "$test"; return }
# Notice we don't need to check for perf probe support (perf_probes_p)
# here, since perf probes are optional in the script.

set effective_pid [exec /usr/bin/id -u]
if { $effective_pid != 0 } {
    untested "$test (perf probes require root access)"
    return
}

proc run_test_load {} {
    # do something silly that uses both user and kernel time.
    catch { exec dd if=/dev/zero of=/dev/null bs=17 count=502432 conv=ebcdic }
    return 0
}

stap_run $test run_test_load $all_pass_string $srcdir/$subdir/$test.stp
