Format of funcgraph_{entry, exit} ftrace event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux