* Format of funcgraph_{entry, exit} ftrace event
@ 2022-08-09 13:32 Matteo Bertolino
2022-08-09 15:54 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Matteo Bertolino @ 2022-08-09 13:32 UTC (permalink / raw)
To: linux-trace-users
Dear community,
I wish to ask you some clarifications about the format of two ftrace events: `funcgraph_entry` and `funcgraph_exit`, basically those in `$ANY_DEBUG_FS/tracing/events/ftrace`.
Let me copy and paste them here:
# cat funcgraph_entry/format
name: funcgraph_entry
ID: 11
format:
field:unsigned short common_type; offset:0; size:2; signed:0;
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
field:int common_pid; offset:4; size:4; signed:1;
field:unsigned long func; offset:8; size:8; signed:0;
field:int depth; offset:16; size:4; signed:1;
print fmt: "--> %ps (%d)", (void *)REC->func, REC->depth
AND
# cat funcgraph_exit/format
name: funcgraph_exit
ID: 10
format:
field:unsigned short common_type; offset:0; size:2; signed:0;
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
field:int common_pid; offset:4; size:4; signed:1;
field:unsigned long func; offset:8; size:8; signed:0;
field:int depth; offset:16; size:4; signed:1;
field:unsigned int overrun; offset:20; size:4; signed:0;
field:unsigned long long calltime; offset:24; size:8; signed:0;
field:unsigned long long rettime; offset:32; size:8; signed:0;
print fmt: "<-- %ps (%d) (start: %llx end: %llx) over: %d", (void *)REC->func, REC->depth, REC->calltime, REC->rettime, REC->depth
While writing a `trace.dat`, I know that all the entries have an header, described by the Linux ringbuffer format (file `header_event`):
# compressed entry header
type_len : 5 bits
time_delta : 27 bits
array : 32 bits
padding : type == 29
time_extend : type == 30
time_stamp : type == 31
data max type_len == 28
Such header includes a timestamp (that can be a delta of the timestamp present in the `header_page`).
I have one question for the ftrace's community:
Why are the following fields of a `funcgraph_exit` entry useful? ` calltime` and ` rettime`.
They look like redundant for me, because the timing information is already present on the `header_event`.
Please can you clarify me whether I am wrong?
Best Regards && have lovely holidays,
Matteo
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Format of funcgraph_{entry, exit} ftrace event
2022-08-09 13:32 Format of funcgraph_{entry, exit} ftrace event Matteo Bertolino
@ 2022-08-09 15:54 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2022-08-09 15:54 UTC (permalink / raw)
To: Matteo Bertolino; +Cc: linux-trace-users
On Tue, 9 Aug 2022 13:32:04 +0000
Matteo Bertolino <matteo.bertolino@huawei.com> wrote:
>
>
> While writing a `trace.dat`, I know that all the entries have an header, described by the Linux ringbuffer format (file `header_event`):
> # compressed entry header
> type_len : 5 bits
> time_delta : 27 bits
> array : 32 bits
>
> padding : type == 29
> time_extend : type == 30
> time_stamp : type == 31
> data max type_len == 28
>
> Such header includes a timestamp (that can be a delta of the timestamp present in the `header_page`).
>
> I have one question for the ftrace's community:
> Why are the following fields of a `funcgraph_exit` entry useful? ` calltime` and ` rettime`.
> They look like redundant for me, because the timing information is already present on the `header_event`.
The function graph infrastructure records the calltime and rettime and
that can be used by other users than the tracer. That is, the users are
not guaranteed to have timestamps of their own. Yes it is redundant for
the tracing, but it is also a way to test to make sure the timings
being recorded are accurate for the other use cases.
-- Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-09 15:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-09 13:32 Format of funcgraph_{entry, exit} ftrace event Matteo Bertolino
2022-08-09 15:54 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).