Skip to contentSkip to conversation

Documentation: ftrace: clarify filters with dynamic ftrace and graph

PATCH Superseded Steffen Maier 3 participants 5 messages Apr 13, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: ftrace: clarify filters with dynamic ftrace and graph

I fell into the trap of having set up function tracer with a very limited filter and then switched over to function_graph and was erroneously wondering why the latter did not trace what I expected, which was the full unabridged graph recursion.

Cc Steven Rostedt <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 Documentation/trace/ftrace.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/trace/ftrace.rst +6 -1
index e45f0786f3f9..68835d062344 100644
@@ -224,6 +224,7 @@ of ftrace. Here is a list of some of the key files:
 	has a side effect of enabling or disabling specific functions
 	to be traced. Echoing names of functions into this file
 	will limit the trace to only those functions.
+	This influences both the tracers "function" and "function_graph"!
 
 	The functions listed in "available_filter_functions" are what
 	can be written into this file.
@@ -265,6 +266,9 @@ of ftrace. Here is a list of some of the key files:
 	Functions listed in this file will cause the function graph
 	tracer to only trace these functions and the functions that
 	they call. (See the section "dynamic ftrace" for more details).
+	With dynamic ftrace, the graph tracer can only trace functions that
+	set_ftrace_filter minus set_ftrace_notrace armed; this also influences
+	the ability to chase function call chains.
 
   set_graph_notrace:
 
@@ -277,7 +281,8 @@ of ftrace. Here is a list of some of the key files:
 
 	This lists the functions that ftrace has processed and can trace.
 	These are the function names that you can pass to
-	"set_ftrace_filter" or "set_ftrace_notrace".
+	"set_ftrace_filter", "set_ftrace_notrace",
+	"set_graph_function", or "set_graph_notrace".
 	(See the section "dynamic ftrace" below for more details.)
 
   dyn_ftrace_total_info:
Signature · 6 lines
2.13.5

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#1 lore raw
Quoted 4 lines · On Fri, 13 Apr 2018 11:26:16 +0200 Steffen Maier <[email protected]> wrote:

I fell into the trap of having set up function tracer with a very limited filter and then switched over to function_graph and was erroneously wondering why the latter did not trace what I expected, which was the full unabridged graph recursion.

I didn't realize that the documentation doesn't state this. I mention it in all my talks that talk about function and function_graph tracer and set_ftrace_filter.

Quoted 15 lines
Cc Steven Rostedt <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 Documentation/trace/ftrace.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/trace/ftrace.rst +0 -0
index e45f0786f3f9..68835d062344 100644

Documentation/trace/ftrace.rst of ftrace. Here is a list of some of the key files: · line 227

Quoted 4 lines
Documentation/trace/ftrace.rst +1 -0
@@ -224,6 +224,7 @@ of ftrace. Here is a list of some of the key files:
 	has a side effect of enabling or disabling specific functions
 	to be traced. Echoing names of functions into this file
 	will limit the trace to only those functions.
+	This influences both the tracers "function" and "function_graph"!

I know you probably were a bit upset about the documentation not emphasizing that this affects function_graph, but there's no reason to have an exclamation point at the end of that statement.

It states that it affects what functions are traced without mentioning tracers. The assumption was that any "function type" tracing will be affected by it. Which is no longer true, because stack tracer has its own filter files.

We should also mention that function profiling is affected by that too.

Documentation/trace/ftrace.rst of ftrace. Here is a list of some of the key files: · line 271

Quoted 10 lines
Documentation/trace/ftrace.rst +3 -0
 	The functions listed in "available_filter_functions" are what
 	can be written into this file.
@@ -265,6 +266,9 @@ of ftrace. Here is a list of some of the key files:
 	Functions listed in this file will cause the function graph
 	tracer to only trace these functions and the functions that
 	they call. (See the section "dynamic ftrace" for more details).
+	With dynamic ftrace, the graph tracer can only trace functions that
+	set_ftrace_filter minus set_ftrace_notrace armed; this also influences
+	the ability to chase function call chains.

Again, the above seems a bit emotional ;-) Just something like this:

Note, set_ftrace_filter and set_ftrace_notrace still affects what functions are being traced.

Documentation/trace/ftrace.rst of ftrace. Here is a list of some of the key files: · line 286

Quoted 11 lines
Documentation/trace/ftrace.rst +2 -1
   set_graph_notrace:
 
@@ -277,7 +281,8 @@ of ftrace. Here is a list of some of the key files:
 
 	This lists the functions that ftrace has processed and can trace.
 	These are the function names that you can pass to
-	"set_ftrace_filter" or "set_ftrace_notrace".
+	"set_ftrace_filter", "set_ftrace_notrace",
+	"set_graph_function", or "set_graph_notrace".
 	(See the section "dynamic ftrace" below for more details.)

This part is fine.

-- Steve

-- Steve

Documentation/trace/ftrace.rst of ftrace. Here is a list of some of the key files: · line 288

Quoted 2 lines
Documentation/trace/ftrace.rst +0 -0
   dyn_ftrace_total_info:

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

PATCH v2 1/1 Documentation: ftrace: clarify filters with dynamic ftrace and graph

I fell into the trap of having set up function tracer with a very limited filter and then switched over to function_graph and was erroneously wondering why the latter did not trace what I expected, which was the full unabridged graph recursion.

Cc Steven Rostedt <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jonathan Corbet <[email protected]>

---

Changes since v1:
Integrated review comments by Steven Rostedt
* less emotional phrasing
* also mention function profiling with set_ftrace_filter (hopefully I got that right as I don't have experience with it)

 Documentation/trace/ftrace.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/trace/ftrace.rst +6 -1
index e45f0786f3f9..9bbd3aefadb2 100644
@@ -224,6 +224,8 @@ of ftrace. Here is a list of some of the key files:
 	has a side effect of enabling or disabling specific functions
 	to be traced. Echoing names of functions into this file
 	will limit the trace to only those functions.
+	This influences the tracers "function" and "function_graph"
+	and thus also function profiling (see "function_profile_enabled").
 
 	The functions listed in "available_filter_functions" are what
 	can be written into this file.
@@ -265,6 +267,8 @@ of ftrace. Here is a list of some of the key files:
 	Functions listed in this file will cause the function graph
 	tracer to only trace these functions and the functions that
 	they call. (See the section "dynamic ftrace" for more details).
+	Note, set_ftrace_filter and set_ftrace_notrace still affects
+	what functions are being traced.
 
   set_graph_notrace:
 
@@ -277,7 +281,8 @@ of ftrace. Here is a list of some of the key files:
 
 	This lists the functions that ftrace has processed and can trace.
 	These are the function names that you can pass to
-	"set_ftrace_filter" or "set_ftrace_notrace".
+	"set_ftrace_filter", "set_ftrace_notrace",
+	"set_graph_function", or "set_graph_notrace".
 	(See the section "dynamic ftrace" below for more details.)
 
   dyn_ftrace_total_info:
Signature · 6 lines
2.13.5

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer Reviewed-by on v2 1/1
#3 lore raw
Quoted 7 lines · On Fri, 13 Apr 2018 17:39:15 +0200 Steffen Maier <[email protected]> wrote:

I fell into the trap of having set up function tracer with a very limited filter and then switched over to function_graph and was erroneously wondering why the latter did not trace what I expected, which was the full unabridged graph recursion.

Looks good.

Quoted 2 lines
Cc Ingo Molnar <[email protected]>
Cc Jonathan Corbet <[email protected]>

Jon, you want to take it in your tree?

-- Steve

Quoted 35 lines

---

Changes since v1:
Integrated review comments by Steven Rostedt
* less emotional phrasing
* also mention function profiling with set_ftrace_filter (hopefully I got that right as I don't have experience with it)

 Documentation/trace/ftrace.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/trace/ftrace.rst +4 -0
index e45f0786f3f9..9bbd3aefadb2 100644
@@ -224,6 +224,8 @@ of ftrace. Here is a list of some of the key files:
 	has a side effect of enabling or disabling specific functions
 	to be traced. Echoing names of functions into this file
 	will limit the trace to only those functions.
+	This influences the tracers "function" and "function_graph"
+	and thus also function profiling (see "function_profile_enabled").
 
 	The functions listed in "available_filter_functions" are what
 	can be written into this file.
@@ -265,6 +267,8 @@ of ftrace. Here is a list of some of the key files:
 	Functions listed in this file will cause the function graph
 	tracer to only trace these functions and the functions that
 	they call. (See the section "dynamic ftrace" for more details).
+	Note, set_ftrace_filter and set_ftrace_notrace still affects
+	what functions are being traced.
 
   set_graph_notrace:
 

Documentation/trace/ftrace.rst of ftrace. Here is a list of some of the key files: · line 288

Quoted 9 lines
Documentation/trace/ftrace.rst +2 -1
@@ -277,7 +281,8 @@ of ftrace. Here is a list of some of the key files:
 
 	This lists the functions that ftrace has processed and can trace.
 	These are the function names that you can pass to
-	"set_ftrace_filter" or "set_ftrace_notrace".
+	"set_ftrace_filter", "set_ftrace_notrace",
+	"set_graph_function", or "set_graph_notrace".
 	(See the section "dynamic ftrace" below for more details.)
 
   dyn_ftrace_total_info:

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html