Skip to content

Commit 5efe968

Browse files
committed
ftrace/selftests: Fix pid test with function graph not showing pids
The pid filtering test will set the pid filters and make sure that both function and function_graph tracing honors the filters. But the function_graph tracer test was failing because the PID was not being filtered properly. That's because the funcgraph-proc option wasn't getting set. Without that option the PID is not shown. Instead we get: + cat trace # tracer: function_graph # # CPU DURATION FUNCTION CALLS # | | | | | | | 3) ! 143.685 us | kernel_clone(); 3) ! 127.055 us | kernel_clone(); 1) ! 127.170 us | kernel_clone(); 3) ! 126.840 us | kernel_clone(); When we should be getting: + cat trace # tracer: function_graph # # CPU TASK/PID DURATION FUNCTION CALLS # | | | | | | | | | 4) bash-939 | # 1070.009 us | kernel_clone(); 4) bash-939 | # 1116.903 us | kernel_clone(); 5) bash-939 | ! 976.133 us | kernel_clone(); 5) bash-939 | ! 954.012 us | kernel_clone(); The test looks for the pids it is filtering and will fail if it can not find them. Without fungraph-proc option set, it will not be displayed and the test will fail. Link: https://lore.kernel.org/all/Zl9JFnzKGuUM10X2@J2N7QTR9R3/ Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Fixes: 35b944a ("selftests/ftrace: Add function_graph tracer to func-filter-pid test") Reported-by: Mark Rutland <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]> Tested-by: Mark Rutland <[email protected]>
1 parent 2431196 commit 5efe968

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# Also test it on an instance directory
99

1010
do_function_fork=1
11+
do_funcgraph_proc=1
1112

1213
if [ ! -f options/function-fork ]; then
1314
do_function_fork=0
@@ -28,6 +29,7 @@ fi
2829

2930
if [ $do_funcgraph_proc -eq 1 ]; then
3031
orig_value2=`cat options/funcgraph-proc`
32+
echo 1 > options/funcgraph-proc
3133
fi
3234

3335
do_reset() {

0 commit comments

Comments
 (0)