1LIBTRACEEVENT(3) libtraceevent Manual LIBTRACEEVENT(3)
2
3
4
6 tep_parse_header_page - Parses the data stored in the header page.
7
9 #include <event-parse.h>
10
11 int tep_parse_header_page(struct tep_handle *tep, char *buf, unsigned long size, int long_size);
12
14 The tep_parse_header_page() function parses the header page data from
15 buf, and initializes the tep, trace event parser context, with it. The
16 buffer buf is with size, and is supposed to be copied from
17 tracefs/events/header_page.
18
19 Some old kernels do not have header page info, in this case the
20 tep_parse_header_page() function can be called with size equal to 0.
21 The tep context is initialized with default values. The long_size can
22 be used in this use case, to set the size of a long integer to be used.
23
25 The tep_parse_header_page() function returns 0 in case of success, or
26 -1 in case of an error.
27
29 #include <event-parse.h>
30 ...
31 struct tep_handle *tep = tep_alloc();
32 ...
33 char *buf;
34 int size;
35 buf = read_file("/sys/kernel/tracing/events/header_page", &size);
36 if (tep_parse_header_page(tep, buf, size, sizeof(unsigned long)) != 0) {
37 /* Failed to parse the header page */
38 }
39 ...
40
42 event-parse.h
43 Header file to include in order to have access to the library APIs.
44 -ltraceevent
45 Linker switch to add when building a program that uses the library.
46
48 libtraceevent(3), trace-cmd(1)
49
51 Steven Rostedt <rostedt@goodmis.org[1]>, author of libtraceevent.
52 Tzvetomir Stoyanov <tz.stoyanov@gmail.com[2]>, author of this man page.
53
55 Report bugs to <linux-trace-devel@vger.kernel.org[3]>
56
58 libtraceevent is Free Software licensed under the GNU LGPL 2.1
59
61 https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
62
64 1. rostedt@goodmis.org
65 mailto:rostedt@goodmis.org
66
67 2. tz.stoyanov@gmail.com
68 mailto:tz.stoyanov@gmail.com
69
70 3. linux-trace-devel@vger.kernel.org
71 mailto:linux-trace-devel@vger.kernel.org
72
73
74
75libtraceevent 1.7.2 04/05/2023 LIBTRACEEVENT(3)