summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-profiler.tc
blob: ffff8646733c6d18b5c8a0b0f3e81ffdc5e440f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function profiler with function graph tracing
# requires: function_profile_enabled set_ftrace_filter function_graph:tracer

# The function graph tracer can now be run along side of the function
# profiler. But there was a bug that caused the combination of the two
# to crash. It also required the function graph tracer to be started
# first.
#
# This test triggers that bug
#
# We need both function_graph and profiling to run this test

fail() { # mesg
    echo $1
    exit_fail
}

echo "Enabling function graph tracer:"
echo function_graph > current_tracer
echo "enable profiler"

# Older kernels do not allow function_profile to be enabled with
# function graph tracer. If the below fails, mark it as unsupported
echo 1 > function_profile_enabled || exit_unsupported

# Let it run for a bit to make sure nothing explodes
sleep 1

exit 0