xref: /aosp_15_r20/external/libtraceevent/Documentation/libtraceevent-header_page.txt (revision 436bf2bcd5202612ffffe471bbcc1f277cc8d28e)
1libtraceevent(3)
2================
3
4NAME
5----
6tep_get_header_page_size, tep_get_header_timestamp_size, tep_is_old_format -
7Get the data stored in the header page, in kernel context.
8
9SYNOPSIS
10--------
11[verse]
12--
13*#include <event-parse.h>*
14
15int *tep_get_header_page_size*(struct tep_handle pass:[*]_tep_);
16int *tep_get_header_timestamp_size*(struct tep_handle pass:[*]_tep_);
17bool *tep_is_old_format*(struct tep_handle pass:[*]_tep_);
18--
19DESCRIPTION
20-----------
21These functions retrieve information from kernel context, stored in tracefs
22events/header_page. Old kernels do not have header page info, so default values
23from user space context are used.
24
25The *tep_get_header_page_size()* function returns the size of a long integer,
26in kernel context. The _tep_ argument is trace event parser context.
27This information is retrieved from tracefs events/header_page, "commit" field.
28
29The *tep_get_header_timestamp_size()* function returns the size of timestamps,
30in kernel context. The _tep_ argument is trace event parser context. This
31information is retrieved from tracefs events/header_page, "timestamp" field.
32
33The *tep_is_old_format()* function returns true if the kernel predates
34the addition of events/header_page, otherwise it returns false.
35
36RETURN VALUE
37------------
38The *tep_get_header_page_size()* function returns the size of a long integer,
39in bytes.
40
41The *tep_get_header_timestamp_size()* function returns the size of timestamps,
42in bytes.
43
44The *tep_is_old_format()* function returns true, if an old kernel is used to
45generate the tracing data, which has no event/header_page. If the kernel is new,
46or _tep_ is NULL, false is returned.
47
48EXAMPLE
49-------
50[source,c]
51--
52#include <event-parse.h>
53...
54struct tep_handle *tep = tep_alloc();
55...
56	int longsize;
57	int timesize;
58	bool old;
59
60	longsize = tep_get_header_page_size(tep);
61	timesize = tep_get_header_timestamp_size(tep);
62	old = tep_is_old_format(tep);
63
64	printf ("%s kernel is used to generate the tracing data.\n",
65		old?"Old":"New");
66	printf("The size of a long integer is %d bytes.\n", longsize);
67	printf("The timestamps size is %d bytes.\n", timesize);
68...
69--
70
71FILES
72-----
73[verse]
74--
75*event-parse.h*
76	Header file to include in order to have access to the library APIs.
77*-ltraceevent*
78	Linker switch to add when building a program that uses the library.
79--
80
81SEE ALSO
82--------
83*libtraceevent*(3), *trace-cmd*(1)
84
85AUTHOR
86------
87[verse]
88--
89*Steven Rostedt* <[email protected]>, author of *libtraceevent*.
90*Tzvetomir Stoyanov* <[email protected]>, author of this man page.
91--
92REPORTING BUGS
93--------------
94Report bugs to  <[email protected]>
95
96LICENSE
97-------
98libtraceevent is Free Software licensed under the GNU LGPL 2.1
99
100RESOURCES
101---------
102https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
103