'\" t
.\" Title: libtraceevent
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1
.\" Date: 11/26/2020
.\" Manual: libtraceevent Manual
.\" Source: libtraceevent 1.1.0
.\" Language: English
.\"
.TH "LIBTRACEEVENT" "3" "11/26/2020" "libtraceevent 1\&.1\&.0" "libtraceevent Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
tep_find_event, tep_find_event_by_name, tep_find_event_by_record \- Find events by given key\&.
.SH "SYNOPSIS"
.sp
.nf
\fB#include \fR
struct tep_event *\fBtep_find_event\fR(struct tep_handle *\fItep\fR, int \fIid\fR);
struct tep_event *\fBtep_find_event_by_name\fR(struct tep_handle *\fItep\fR, const char *\fIsys\fR, const char *\fIname\fR);
struct tep_event *\fBtep_find_event_by_record\fR(struct tep_handle *\fItep\fR, struct tep_record *\fIrecord\fR);
.fi
.SH "DESCRIPTION"
.sp
This set of functions can be used to search for an event, based on a given criteria\&. All functions require a pointer to a \fItep\fR, trace event parser context\&.
.sp
The \fItep_find_event()\fR function searches for an event by given event \fIid\fR\&. The event ID is assigned dynamically and can be viewed in event\(cqs format file, "ID" field\&.
.sp
The tep_find_event_by_name()_ function searches for an event by given event \fIname\fR, under the system \fIsys\fR\&. If the \fIsys\fR is NULL (not specified), the first event with \fIname\fR is returned\&.
.sp
The tep_find_event_by_record()_ function searches for an event from a given \fIrecord\fR\&.
.SH "RETURN VALUE"
.sp
All these functions return a pointer to the found event, or NULL if there is no such event\&.
.SH "EXAMPLE"
.sp
.if n \{\
.RS 4
.\}
.nf
#include
\&.\&.\&.
struct tep_handle *tep = tep_alloc();
\&.\&.\&.
struct tep_event *event;
event = tep_find_event(tep, 1857);
if (event == NULL) {
/* There is no event with ID 1857 */
}
event = tep_find_event_by_name(tep, "kvm", "kvm_exit");
if (event == NULL) {
/* There is no kvm_exit event, from kvm system */
}
void event_from_record(struct tep_record *record)
{
struct tep_event *event = tep_find_event_by_record(tep, record);
if (event == NULL) {
/* There is no event from given record */
}
}
\&.\&.\&.
.fi
.if n \{\
.RE
.\}
.SH "FILES"
.sp
.if n \{\
.RS 4
.\}
.nf
\fBevent\-parse\&.h\fR
Header file to include in order to have access to the library APIs\&.
\fB\-ltraceevent\fR
Linker switch to add when building a program that uses the library\&.
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.sp
\fIlibtraceevent(3)\fR, \fItrace\-cmd(1)\fR
.SH "AUTHOR"
.sp
.if n \{\
.RS 4
.\}
.nf
\fBSteven Rostedt\fR <\m[blue]\fBrostedt@goodmis\&.org\fR\m[]\&\s-2\u[1]\d\s+2>, author of \fBlibtraceevent\fR\&.
\fBTzvetomir Stoyanov\fR <\m[blue]\fBtz\&.stoyanov@gmail\&.com\fR\m[]\&\s-2\u[2]\d\s+2>, author of this man page\&.
.fi
.if n \{\
.RE
.\}
.SH "REPORTING BUGS"
.sp
Report bugs to <\m[blue]\fBlinux\-trace\-devel@vger\&.kernel\&.org\fR\m[]\&\s-2\u[3]\d\s+2>
.SH "LICENSE"
.sp
libtraceevent is Free Software licensed under the GNU LGPL 2\&.1
.SH "RESOURCES"
.sp
\m[blue]\fBhttps://git\&.kernel\&.org/pub/scm/linux/kernel/git/torvalds/linux\&.git\fR\m[]
.SH "NOTES"
.IP " 1." 4
rostedt@goodmis.org
.RS 4
\%mailto:rostedt@goodmis.org
.RE
.IP " 2." 4
tz.stoyanov@gmail.com
.RS 4
\%mailto:tz.stoyanov@gmail.com
.RE
.IP " 3." 4
linux-trace-devel@vger.kernel.org
.RS 4
\%mailto:linux-trace-devel@vger.kernel.org
.RE