1libtraceevent(3)
2================
3
4NAME
5----
6tep_parse_header_page - Parses the data stored in the header page.
7
8SYNOPSIS
9--------
10[verse]
11--
12*#include <event-parse.h>*
13
14int *tep_parse_header_page*(struct tep_handle pass:[*]_tep_, char pass:[*]_buf_, unsigned long _size_, int _long_size_);
15--
16
17DESCRIPTION
18-----------
19The _tep_parse_header_page()_ function parses the header page data from _buf_,
20and initializes the _tep_, trace event parser context, with it. The buffer
21_buf_ is with _size_, and is supposed to be copied from
22tracefs/events/header_page.
23
24Some old kernels do not have header page info, in this case the
25_tep_parse_header_page()_ function  can be called with _size_ equal to 0. The
26_tep_ context is initialized with default values. The _long_size_ can be used in
27this use case, to set the size of a long integer to be used.
28
29RETURN VALUE
30------------
31The _tep_parse_header_page()_ function returns 0 in case of success, or -1
32in case of an error.
33
34EXAMPLE
35-------
36[source,c]
37--
38#include <event-parse.h>
39...
40struct tep_handle *tep = tep_alloc();
41...
42char *buf;
43int size;
44buf = read_file("/sys/kernel/tracing/events/header_page", &size);
45if (tep_parse_header_page(tep, buf, size, sizeof(unsigned long)) != 0) {
46	/* Failed to parse the header page */
47}
48...
49--
50
51FILES
52-----
53[verse]
54--
55*event-parse.h*
56	Header file to include in order to have access to the library APIs.
57*-ltraceevent*
58	Linker switch to add when building a program that uses the library.
59--
60
61SEE ALSO
62--------
63_libtraceevent(3)_, _trace-cmd(1)_
64
65AUTHOR
66------
67[verse]
68--
69*Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
70*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
71--
72REPORTING BUGS
73--------------
74Report bugs to  <linux-trace-devel@vger.kernel.org>
75
76LICENSE
77-------
78libtraceevent is Free Software licensed under the GNU LGPL 2.1
79
80RESOURCES
81---------
82https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
83