6 tep_find_common_field, tep_find_field, tep_find_any_field -
7 Search for a field in an event.
13 *#include <event-parse.h>*
15 struct tep_format_field pass:[*]*tep_find_common_field*(struct tep_event pass:[*]_event_, const char pass:[*]_name_);
16 struct tep_format_field pass:[*]*tep_find_field*(struct tep_event_ormat pass:[*]_event_, const char pass:[*]_name_);
17 struct tep_format_field pass:[*]*tep_find_any_field*(struct tep_event pass:[*]_event_, const char pass:[*]_name_);
22 These functions search for a field with given name in an event. The field
23 returned can be used to find the field content from within a data record.
25 The _tep_find_common_field()_ function searches for a common field with _name_
28 The _tep_find_field()_ function searches for an event specific field with
29 _name_ in the _event_.
31 The _tep_find_any_field()_ function searches for any field with _name_ in the
36 The _tep_find_common_field(), _tep_find_field()_ and _tep_find_any_field()_
37 functions return a pointer to the found field, or NULL in case there is no field
38 with the requested name.
44 #include <event-parse.h>
46 void get_htimer_info(struct tep_handle *tep, struct tep_record *record)
48 struct tep_format_field *field;
49 struct tep_event *event;
50 long long softexpires;
54 event = tep_find_event_by_name(tep, "timer", "hrtimer_start");
56 field = tep_find_common_field(event, "common_pid");
58 /* Cannot find "common_pid" field in the event */
60 /* Get pid from the data record */
61 pid = tep_read_number(tep, record->data + field->offset,
65 field = tep_find_field(event, "softexpires");
67 /* Cannot find "softexpires" event specific field in the event */
69 /* Get softexpires parameter from the data record */
70 softexpires = tep_read_number(tep, record->data + field->offset,
74 field = tep_find_any_field(event, "mode");
76 /* Cannot find "mode" field in the event */
79 /* Get mode parameter from the data record */
80 mode = tep_read_number(tep, record->data + field->offset,
92 Header file to include in order to have access to the library APIs.
94 Linker switch to add when building a program that uses the library.
99 _libtraceevent(3)_, _trace-cmd(1)_
105 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
106 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
110 Report bugs to <linux-trace-devel@vger.kernel.org>
114 libtraceevent is Free Software licensed under the GNU LGPL 2.1
118 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git