1LIBTRACEEVENT(3)             libtraceevent Manual             LIBTRACEEVENT(3)
2
3
4

NAME

6       tep_get_event, tep_get_first_event, tep_get_events_count - Access
7       events.
8

SYNOPSIS

10       #include <event-parse.h>
11
12       struct tep_event *tep_get_event(struct tep_handle *tep, int index);
13       struct tep_event *tep_get_first_event(struct tep_handle *tep);
14       int tep_get_events_count(struct tep_handle *tep);
15

DESCRIPTION

17       The tep_get_event() function returns a pointer to event at the given
18       index. The tep argument is trace event parser context, the index is the
19       index of the requested event.
20
21       The tep_get_first_event() function returns a pointer to the first
22       event. As events are stored in an array, this function returns the
23       pointer to the beginning of the array. The tep argument is trace event
24       parser context.
25
26       The tep_get_events_count() function returns the number of the events in
27       the array. The tep argument is trace event parser context.
28

RETURN VALUE

30       The tep_get_event() returns a pointer to the event located at index.
31       NULL is returned in case of error, in case there are no events or index
32       is out of range.
33
34       The tep_get_first_event() returns a pointer to the first event. NULL is
35       returned in case of error, or in case there are no events.
36
37       The tep_get_events_count() returns the number of the events. 0 is
38       returned in case of error, or in case there are no events.
39

EXAMPLE

41           #include <event-parse.h>
42           ...
43           struct tep_handle *tep = tep_alloc();
44           ...
45           int i,count = tep_get_events_count(tep);
46           struct tep_event *event, *events = tep_get_first_event(tep);
47
48           if (events == NULL) {
49                   /* There are no events */
50           } else {
51                   for (i = 0; i < count; i++) {
52                           event = (events+i);
53                           /* process events[i] */
54                   }
55
56                   /* Get the last event */
57                   event = tep_get_event(tep, count-1);
58           }
59

FILES

61           event-parse.h
62                   Header file to include in order to have access to the library APIs.
63           -ltraceevent
64                   Linker switch to add when building a program that uses the library.
65

SEE ALSO

67       libtraceevent(3), trace-cmd(1)
68

AUTHOR

70           Steven Rostedt <rostedt@goodmis.org[1]>, author of libtraceevent.
71           Tzvetomir Stoyanov <tz.stoyanov@gmail.com[2]>, author of this man page.
72

REPORTING BUGS

74       Report bugs to <linux-trace-devel@vger.kernel.org[3]>
75

LICENSE

77       libtraceevent is Free Software licensed under the GNU LGPL 2.1
78

RESOURCES

80       https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
81

NOTES

83        1. rostedt@goodmis.org
84           mailto:rostedt@goodmis.org
85
86        2. tz.stoyanov@gmail.com
87           mailto:tz.stoyanov@gmail.com
88
89        3. linux-trace-devel@vger.kernel.org
90           mailto:linux-trace-devel@vger.kernel.org
91
92
93
94libtraceevent 1.1.1               02/08/2021                  LIBTRACEEVENT(3)
Impressum