0001 libtraceevent(3)
0002 ================
0003
0004 NAME
0005 ----
0006 tep_find_event,tep_find_event_by_name,tep_find_event_by_record -
0007 Find events by given key.
0008
0009 SYNOPSIS
0010 --------
0011 [verse]
0012 --
0013 *#include <event-parse.h>*
0014
0015 struct tep_event pass:[*]*tep_find_event*(struct tep_handle pass:[*]_tep_, int _id_);
0016 struct tep_event pass:[*]*tep_find_event_by_name*(struct tep_handle pass:[*]_tep_, const char pass:[*]_sys_, const char pass:[*]_name_);
0017 struct tep_event pass:[*]*tep_find_event_by_record*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_record_);
0018 --
0019
0020 DESCRIPTION
0021 -----------
0022 This set of functions can be used to search for an event, based on a given
0023 criteria. All functions require a pointer to a _tep_, trace event parser
0024 context.
0025
0026 The _tep_find_event()_ function searches for an event by given event _id_. The
0027 event ID is assigned dynamically and can be viewed in event's format file,
0028 "ID" field.
0029
0030 The tep_find_event_by_name()_ function searches for an event by given
0031 event _name_, under the system _sys_. If the _sys_ is NULL (not specified),
0032 the first event with _name_ is returned.
0033
0034 The tep_find_event_by_record()_ function searches for an event from a given
0035 _record_.
0036
0037 RETURN VALUE
0038 ------------
0039 All these functions return a pointer to the found event, or NULL if there is no
0040 such event.
0041
0042 EXAMPLE
0043 -------
0044 [source,c]
0045 --
0046 #include <event-parse.h>
0047 ...
0048 struct tep_handle *tep = tep_alloc();
0049 ...
0050 struct tep_event *event;
0051
0052 event = tep_find_event(tep, 1857);
0053 if (event == NULL) {
0054 /* There is no event with ID 1857 */
0055 }
0056
0057 event = tep_find_event_by_name(tep, "kvm", "kvm_exit");
0058 if (event == NULL) {
0059 /* There is no kvm_exit event, from kvm system */
0060 }
0061
0062 void event_from_record(struct tep_record *record)
0063 {
0064 struct tep_event *event = tep_find_event_by_record(tep, record);
0065 if (event == NULL) {
0066 /* There is no event from given record */
0067 }
0068 }
0069 ...
0070 --
0071
0072 FILES
0073 -----
0074 [verse]
0075 --
0076 *event-parse.h*
0077 Header file to include in order to have access to the library APIs.
0078 *-ltraceevent*
0079 Linker switch to add when building a program that uses the library.
0080 --
0081
0082 SEE ALSO
0083 --------
0084 _libtraceevent(3)_, _trace-cmd(1)_
0085
0086 AUTHOR
0087 ------
0088 [verse]
0089 --
0090 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
0091 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
0092 --
0093 REPORTING BUGS
0094 --------------
0095 Report bugs to <linux-trace-devel@vger.kernel.org>
0096
0097 LICENSE
0098 -------
0099 libtraceevent is Free Software licensed under the GNU LGPL 2.1
0100
0101 RESOURCES
0102 ---------
0103 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git