Re: [PATCH] fgraph: Move trace_clock_local() for return time to function_graph tracer

From: Steven Rostedt
Date: Tue Jan 14 2025 - 10:06:13 EST


On Tue, 14 Jan 2025 10:18:06 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:

> > I'd rather just nuke the calltime and rettime from struct ftrace_graph_ret.
>
> Yeah, this one is good to me. But this will make a slightly different time
> for the same function when we enable multiple function graph tracer on
> different instances (mine records it once and reuse it but this will record
> on each instance). We may need to notice it on the document. :)

And I believe it's separate for each instance now anyway, so I was going to
send this to Linus as well:

diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
index 272464bb7c60..2b74f96d09d5 100644
--- a/Documentation/trace/ftrace.rst
+++ b/Documentation/trace/ftrace.rst
@@ -810,6 +810,12 @@ Here is the list of current tracers that may be configured.
to draw a graph of function calls similar to C code
source.

+ Note that the function graph calculates the timings of when the
+ function starts and returns internally and for each instance. If
+ there are two instances that run function graph tracer and traces
+ the same functions, the length of the timings may be slightly off as
+ each read the timestamp separately and not at the same time.
+
"blk"

The block tracer. The tracer used by the blktrace user


>
> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>

Thanks,

-- Steve