6 tep_parse_event, tep_parse_format - Parse the event format information
12 *#include <event-parse.h>*
14 enum tep_errno *tep_parse_event*(struct tep_handle pass:[*]_tep_, const char pass:[*]_buf_, unsigned long _size_, const char pass:[*]_sys_);
15 enum tep_errno *tep_parse_format*(struct tep_handle pass:[*]_tep_, struct tep_event pass:[*]pass:[*]_eventp_, const char pass:[*]_buf_, unsigned long _size_, const char pass:[*]_sys_);
20 The _tep_parse_event()_ function parses the event format and creates an event
21 structure to quickly parse raw data for a given event. The _tep_ argument is
22 the trace event parser context. The created event structure is stored in the
23 _tep_ context. The _buf_ argument is a buffer with _size_, where the event
24 format data is. The event format data can be taken from
25 tracefs/events/.../.../format files. The _sys_ argument is the system of
28 The _tep_parse_format()_ function does the same as _tep_parse_event()_. The only
29 difference is in the extra _eventp_ argument, where the newly created event
30 structure is returned.
34 Both _tep_parse_event()_ and _tep_parse_format()_ functions return 0 on success,
35 or TEP_ERRNO__... in case of an error.
41 #include <event-parse.h>
43 struct tep_handle *tep = tep_alloc();
47 struct tep_event *event = NULL;
48 buf = read_file("/sys/kernel/tracing/events/ftrace/print/format", &size);
49 if (tep_parse_event(tep, buf, size, "ftrace") != 0) {
50 /* Failed to parse the ftrace print format */
53 if (tep_parse_format(tep, &event, buf, size, "ftrace") != 0) {
54 /* Failed to parse the ftrace print format */
64 Header file to include in order to have access to the library APIs.
66 Linker switch to add when building a program that uses the library.
71 _libtraceevent(3)_, _trace-cmd(1)_
77 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
78 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
82 Report bugs to <linux-trace-devel@vger.kernel.org>
86 libtraceevent is Free Software licensed under the GNU LGPL 2.1
90 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git