1LIBTRACEEVENT(3)             libtraceevent Manual             LIBTRACEEVENT(3)
2
3
4

NAME

6       tep_get_header_page_size, tep_get_header_timestamp_size,
7       tep_is_old_format - Get the data stored in the header page, in kernel
8       context.
9

SYNOPSIS

11       #include <event-parse.h>
12
13       int tep_get_header_page_size(struct tep_handle *tep);
14       int tep_get_header_timestamp_size(struct tep_handle *tep);
15       bool tep_is_old_format(struct tep_handle *tep);
16

DESCRIPTION

18       These functions retrieve information from kernel context, stored in
19       tracefs events/header_page. Old kernels do not have header page info,
20       so default values from user space context are used.
21
22       The tep_get_header_page_size() function returns the size of a long
23       integer, in kernel context. The tep argument is trace event parser
24       context. This information is retrieved from tracefs events/header_page,
25       "commit" field.
26
27       The tep_get_header_timestamp_size() function returns the size of
28       timestamps, in kernel context. The tep argument is trace event parser
29       context. This information is retrieved from tracefs events/header_page,
30       "timestamp" field.
31
32       The tep_is_old_format() function returns true if the kernel predates
33       the addition of events/header_page, otherwise it returns false.
34

RETURN VALUE

36       The tep_get_header_page_size() function returns the size of a long
37       integer, in bytes.
38
39       The tep_get_header_timestamp_size() function returns the size of
40       timestamps, in bytes.
41
42       The tep_is_old_format() function returns true, if an old kernel is used
43       to generate the tracing data, which has no event/header_page. If the
44       kernel is new, or tep is NULL, false is returned.
45

EXAMPLE

47           #include <event-parse.h>
48           ...
49           struct tep_handle *tep = tep_alloc();
50           ...
51                   int longsize;
52                   int timesize;
53                   bool old;
54
55                   longsize = tep_get_header_page_size(tep);
56                   timesize = tep_get_header_timestamp_size(tep);
57                   old = tep_is_old_format(tep);
58
59                   printf ("%s kernel is used to generate the tracing data.\n",
60                           old?"Old":"New");
61                   printf("The size of a long integer is %d bytes.\n", longsize);
62                   printf("The timestamps size is %d bytes.\n", timesize);
63           ...
64

FILES

66           event-parse.h
67                   Header file to include in order to have access to the library APIs.
68           -ltraceevent
69                   Linker switch to add when building a program that uses the library.
70

SEE ALSO

72       libtraceevent(3), trace-cmd(1)
73

AUTHOR

75           Steven Rostedt <rostedt@goodmis.org[1]>, author of libtraceevent.
76           Tzvetomir Stoyanov <tz.stoyanov@gmail.com[2]>, author of this man page.
77

REPORTING BUGS

79       Report bugs to <linux-trace-devel@vger.kernel.org[3]>
80

LICENSE

82       libtraceevent is Free Software licensed under the GNU LGPL 2.1
83

RESOURCES

85       https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
86

NOTES

88        1. rostedt@goodmis.org
89           mailto:rostedt@goodmis.org
90
91        2. tz.stoyanov@gmail.com
92           mailto:tz.stoyanov@gmail.com
93
94        3. linux-trace-devel@vger.kernel.org
95           mailto:linux-trace-devel@vger.kernel.org
96
97
98
99libtraceevent 1.2.1               07/22/2021                  LIBTRACEEVENT(3)
Impressum