1libtraceevent(3) 2================ 3 4NAME 5---- 6tep_find_event,tep_find_event_by_name,tep_find_event_by_record - 7Find events by given key. 8 9SYNOPSIS 10-------- 11[verse] 12-- 13*#include <event-parse.h>* 14 15struct tep_event pass:[*]*tep_find_event*(struct tep_handle pass:[*]_tep_, int _id_); 16struct tep_event pass:[*]*tep_find_event_by_name*(struct tep_handle pass:[*]_tep_, const char pass:[*]_sys_, const char pass:[*]_name_); 17struct tep_event pass:[*]*tep_find_event_by_record*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_record_); 18-- 19 20DESCRIPTION 21----------- 22This set of functions can be used to search for an event, based on a given 23criteria. All functions require a pointer to a _tep_, trace event parser 24context. 25 26The _tep_find_event()_ function searches for an event by given event _id_. The 27event ID is assigned dynamically and can be viewed in event's format file, 28"ID" field. 29 30The tep_find_event_by_name()_ function searches for an event by given 31event _name_, under the system _sys_. If the _sys_ is NULL (not specified), 32the first event with _name_ is returned. 33 34The tep_find_event_by_record()_ function searches for an event from a given 35_record_. 36 37RETURN VALUE 38------------ 39All these functions return a pointer to the found event, or NULL if there is no 40such event. 41 42EXAMPLE 43------- 44[source,c] 45-- 46#include <event-parse.h> 47... 48struct tep_handle *tep = tep_alloc(); 49... 50struct tep_event *event; 51 52event = tep_find_event(tep, 1857); 53if (event == NULL) { 54 /* There is no event with ID 1857 */ 55} 56 57event = tep_find_event_by_name(tep, "kvm", "kvm_exit"); 58if (event == NULL) { 59 /* There is no kvm_exit event, from kvm system */ 60} 61 62void event_from_record(struct tep_record *record) 63{ 64 struct tep_event *event = tep_find_event_by_record(tep, record); 65 if (event == NULL) { 66 /* There is no event from given record */ 67 } 68} 69... 70-- 71 72FILES 73----- 74[verse] 75-- 76*event-parse.h* 77 Header file to include in order to have access to the library APIs. 78*-ltraceevent* 79 Linker switch to add when building a program that uses the library. 80-- 81 82SEE ALSO 83-------- 84_libtraceevent(3)_, _trace-cmd(1)_ 85 86AUTHOR 87------ 88[verse] 89-- 90*Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*. 91*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page. 92-- 93REPORTING BUGS 94-------------- 95Report bugs to <linux-trace-devel@vger.kernel.org> 96 97LICENSE 98------- 99libtraceevent is Free Software licensed under the GNU LGPL 2.1 100 101RESOURCES 102--------- 103https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 104