LIBTRACEEVENT(3)
π LIBTRACEEVENT(3) β the libtraceevent manual, bestie edition π
okay so welcome to the libtraceevent manual page, and today's episode is all about peeking at the header page β that little chunk of kernel-context info that lives in tracefs and tells you how big stuff is π
β¨ NAME β¨
tep_get_header_page_size, tep_get_header_timestamp_size, tep_is_old_format β get the data stored in the header page, in kernel context π«Ά
πΈ SYNOPSIS πΈ
#include <event-parse.h>
int tep_get_header_page_size(struct tep_handle *tep);
int tep_get_header_timestamp_size(struct tep_handle *tep);
bool tep_is_old_format(struct tep_handle *tep);
π DESCRIPTION π
So these three functions go and grab info from kernel context, and that info is stored in tracefs events/header_page. But plot twist π: old kernels literally don't have header page info at all, so in that case the default values from user space context get used instead. not me crying over backwards compatibility fr fr.
The tep_get_header_page_size() function returns the size of a long integer, in kernel context. The tep argument is the trace event parser context. This info is retrieved from tracefs events/header_page, the "commit" field. lowkey iconic, highkey useful.
The tep_get_header_timestamp_size() function returns the size of timestamps, in kernel context. The tep argument is the trace event parser context. This info is retrieved from tracefs events/header_page, the "timestamp" field. the way it just... knows π¦
The tep_is_old_format() function returns true if the kernel predates the addition of events/header_page, otherwise it returns false. vibe check on your kernel, basically π
β RETURN VALUE β
tep_get_header_page_size()β returns the size of a long integer, in bytes. one number, no drama.tep_get_header_timestamp_size()β returns the size of timestamps, in bytes. same energy.tep_is_old_format()β returnstrueif an old kernel is being used to generate the tracing data, which has noevent/header_page. If the kernel is new, ortepisNULL,falseis returned. yes bestie,NULLgives youfalse, it does not crash out π
π EXAMPLE π
#include <event-parse.h>
...
struct tep_handle *tep = tep_alloc();
...
int longsize;
int timesize;
bool old;
longsize = tep_get_header_page_size(tep);
timesize = tep_get_header_timestamp_size(tep);
old = tep_is_old_format(tep);
printf ("%s kernel is used to generate the tracing data.\n",
old?"Old":"New");
printf("The size of a long integer is %d bytes.\n", longsize);
printf("The timestamps size is %d bytes.\n", timesize);
...
look at that. main character code right there π
π FILES π
event-parse.hβ the header file you include so you can actually touch the library APIs.-ltraceeventβ the linker switch you add when building a program that uses the library. don't forget it or the linker will simply not know you π
π SEE ALSO π
libtraceevent(3), trace-cmd(1)
π AUTHOR π
- Steven Rostedt
<rostedt@goodmis.org[1]>, author of libtraceevent. - Tzvetomir Stoyanov
<tz.stoyanov@gmail.com[2]>, author of this man page.
π REPORTING BUGS π
Report bugs to <linux-trace-devel@vger.kernel.org[3]> π«Ά
π LICENSE π
libtraceevent is Free Software licensed under the GNU LGPL 2.1.
π§ RESOURCES π§
https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
π NOTES π
rostedt@goodmis.orgβmailto:rostedt@goodmis.orgtz.stoyanov@gmail.comβmailto:tz.stoyanov@gmail.comlinux-trace-devel@vger.kernel.orgβmailto:linux-trace-devel@vger.kernel.org
aaaaand that's the whole page, bestie π this was libtraceevent 1.9.0, served fresh on 06/15/2026, and it's your girl LIBTRACEEVENT(3) signing off β go read your header pages, stay hydrated, slay β¨π¦π
π¦ where this page comes from
- ubuntu stonking: libtraceevent-doc 1:1.9.0-2 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms