public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [for-next][PATCH 02/15] ftrace/selftests: Fix pid test with function graph not showing pids
Date: Thu, 06 Jun 2024 08:10:06 -0400	[thread overview]
Message-ID: <20240606121104.719232091@goodmis.org> (raw)
In-Reply-To: 20240606121004.857581251@goodmis.org

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

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/20240604152550.0c01d7cd@gandalf.local.home

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fixes: 35b944a997e2 ("selftests/ftrace: Add function_graph tracer to func-filter-pid test")
Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Tested-by: Mark Rutland <mark.rutland@arm.com>
---
 tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
index c6fc9d31a496..8dcce001881d 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
@@ -8,6 +8,7 @@
 # Also test it on an instance directory
 
 do_function_fork=1
+do_funcgraph_proc=1
 
 if [ ! -f options/function-fork ]; then
     do_function_fork=0
@@ -28,6 +29,7 @@ fi
 
 if [ $do_funcgraph_proc -eq 1 ]; then
     orig_value2=`cat options/funcgraph-proc`
+    echo 1 > options/funcgraph-proc
 fi
 
 do_reset() {
-- 
2.43.0



  parent reply	other threads:[~2024-06-06 12:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 12:10 [for-next][PATCH 00/15] ftrace: Updates for 6.11 Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 01/15] ftrace: Add back ftrace_update_trampoline() to ftrace_update_pid_func() Steven Rostedt
2024-06-06 12:10 ` Steven Rostedt [this message]
2024-06-06 12:10 ` [for-next][PATCH 03/15] ftrace: Rename dup_hash() and comment it Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 04/15] ftrace: Remove "ftrace_hash" parameter from __ftrace_hash_rec_update() Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 05/15] ftrace: Add comments to ftrace_hash_rec_disable/enable() Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 06/15] ftrace: Convert "inc" parameter to bool in ftrace_hash_rec_update_modify() Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 07/15] ftrace: Add comments to ftrace_hash_move() and friends Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 08/15] ftrace: Declare function_trace_op in header to quiet sparse warning Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 09/15] ftrace: Assign ftrace_list_end to ftrace_ops_list type cast to RCU Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 10/15] ftrace: Assign RCU list variable with rcu_assign_ptr() Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 11/15] ftrace: Fix prototypes for ftrace_startup/shutdown_subops() Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 12/15] function_graph: Make fgraph_do_direct static key static Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 13/15] function_graph: Do not update pid func if CONFIG_DYNAMIC_FTRACE not enabled Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 14/15] ftrace: Hide one more entry in stack trace when ftrace_pid is enabled Steven Rostedt
2024-06-06 12:10 ` [for-next][PATCH 15/15] fgraph: Remove some unused functions Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240606121104.719232091@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox