# Re: \[PATCH\] fgraph: Move trace\_clock\_local() for return time to function\_graph tracer

- From: Steven Rostedt \<rostedt@goodmis.org\>
- Date: 2025-01-14 15:05:53 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2025/01/2889636
- Thread: https://ratatoskr.run/linux-trace-kernel/2024/12/2871694/t.md

```text
On Tue, 14 Jan 2025 10:18:06 +0900
Masami Hiramatsu (Google) [ref] 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@kernel.org>

Thanks,

-- Steve

```
