Back to home page

OSCL-LXR

 
 

    


0001 libtraceevent(3)
0002 ================
0003 
0004 NAME
0005 ----
0006 tep_get_event, tep_get_first_event, tep_get_events_count - Access events.
0007 
0008 SYNOPSIS
0009 --------
0010 [verse]
0011 --
0012 *#include <event-parse.h>*
0013 
0014 struct tep_event pass:[*]*tep_get_event*(struct tep_handle pass:[*]_tep_, int _index_);
0015 struct tep_event pass:[*]*tep_get_first_event*(struct tep_handle pass:[*]_tep_);
0016 int *tep_get_events_count*(struct tep_handle pass:[*]_tep_);
0017 --
0018 
0019 DESCRIPTION
0020 -----------
0021 The _tep_get_event()_ function returns a pointer to event at the given _index_.
0022 The _tep_ argument is trace event parser context, the _index_ is the index of
0023 the requested event.
0024 
0025 The _tep_get_first_event()_ function returns a pointer to the first event.
0026 As events are stored in an array, this function returns the pointer to the
0027 beginning of the array. The _tep_ argument is trace event parser context.
0028 
0029 The _tep_get_events_count()_ function returns the number of the events
0030 in the array. The _tep_ argument is trace event parser context.
0031 
0032 RETURN VALUE
0033 ------------
0034 The _tep_get_event()_ returns a pointer to the event located at _index_.
0035 NULL is returned in case of error, in case there are no events or _index_ is
0036 out of range.
0037 
0038 The _tep_get_first_event()_ returns a pointer to the first event. NULL is
0039 returned in case of error, or in case there are no events.
0040 
0041 The _tep_get_events_count()_ returns the number of the events. 0 is
0042 returned in case of error, or in case there are no events.
0043 
0044 EXAMPLE
0045 -------
0046 [source,c]
0047 --
0048 #include <event-parse.h>
0049 ...
0050 struct tep_handle *tep = tep_alloc();
0051 ...
0052 int i,count = tep_get_events_count(tep);
0053 struct tep_event *event, *events = tep_get_first_event(tep);
0054 
0055 if (events == NULL) {
0056         /* There are no events */
0057 } else {
0058         for (i = 0; i < count; i++) {
0059                 event = (events+i);
0060                 /* process events[i] */
0061         }
0062 
0063         /* Get the last event */
0064         event = tep_get_event(tep, count-1);
0065 }
0066 --
0067 
0068 FILES
0069 -----
0070 [verse]
0071 --
0072 *event-parse.h*
0073         Header file to include in order to have access to the library APIs.
0074 *-ltraceevent*
0075         Linker switch to add when building a program that uses the library.
0076 --
0077 
0078 SEE ALSO
0079 --------
0080 _libtraceevent(3)_, _trace-cmd(1)_
0081 
0082 AUTHOR
0083 ------
0084 [verse]
0085 --
0086 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
0087 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
0088 --
0089 REPORTING BUGS
0090 --------------
0091 Report bugs to  <linux-trace-devel@vger.kernel.org>
0092 
0093 LICENSE
0094 -------
0095 libtraceevent is Free Software licensed under the GNU LGPL 2.1
0096 
0097 RESOURCES
0098 ---------
0099 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git