Back to home page

OSCL-LXR

 
 

    


0001 libtraceevent(3)
0002 ================
0003 
0004 NAME
0005 ----
0006 tep_event_common_fields, tep_event_fields - Get a list of fields for an event.
0007 
0008 SYNOPSIS
0009 --------
0010 [verse]
0011 --
0012 *#include <event-parse.h>*
0013 
0014 struct tep_format_field pass:[*]pass:[*]*tep_event_common_fields*(struct tep_event pass:[*]_event_);
0015 struct tep_format_field pass:[*]pass:[*]*tep_event_fields*(struct tep_event pass:[*]_event_);
0016 --
0017 
0018 DESCRIPTION
0019 -----------
0020 The _tep_event_common_fields()_ function returns an array of pointers to common
0021 fields for the _event_. The array is allocated in the function and must be freed
0022 by free(). The last element of the array is NULL.
0023 
0024 The _tep_event_fields()_ function returns an array of pointers to event specific
0025 fields for the _event_. The array is allocated in the function and must be freed
0026 by free(). The last element of the array is NULL.
0027 
0028 RETURN VALUE
0029 ------------
0030 Both _tep_event_common_fields()_ and _tep_event_fields()_ functions return
0031 an array of pointers to tep_format_field structures in case of success, or
0032 NULL in case of an error.
0033 
0034 EXAMPLE
0035 -------
0036 [source,c]
0037 --
0038 #include <event-parse.h>
0039 ...
0040 struct tep_handle *tep = tep_alloc();
0041 ...
0042 int i;
0043 struct tep_format_field **fields;
0044 struct tep_event *event = tep_find_event_by_name(tep, "kvm", "kvm_exit");
0045 if (event != NULL) {
0046         fields = tep_event_common_fields(event);
0047         if (fields != NULL) {
0048                 i = 0;
0049                 while (fields[i]) {
0050                         /*
0051                           walk through the list of the common fields
0052                           of the kvm_exit event
0053                         */
0054                         i++;
0055                 }
0056                 free(fields);
0057         }
0058         fields = tep_event_fields(event);
0059         if (fields != NULL) {
0060                 i = 0;
0061                 while (fields[i]) {
0062                         /*
0063                           walk through the list of the event specific
0064                           fields of the kvm_exit event
0065                         */
0066                         i++;
0067                 }
0068                 free(fields);
0069         }
0070 }
0071 ...
0072 --
0073 
0074 FILES
0075 -----
0076 [verse]
0077 --
0078 *event-parse.h*
0079         Header file to include in order to have access to the library APIs.
0080 *-ltraceevent*
0081         Linker switch to add when building a program that uses the library.
0082 --
0083 
0084 SEE ALSO
0085 --------
0086 _libtraceevent(3)_, _trace-cmd(1)_
0087 
0088 AUTHOR
0089 ------
0090 [verse]
0091 --
0092 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
0093 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
0094 --
0095 REPORTING BUGS
0096 --------------
0097 Report bugs to  <linux-trace-devel@vger.kernel.org>
0098 
0099 LICENSE
0100 -------
0101 libtraceevent is Free Software licensed under the GNU LGPL 2.1
0102 
0103 RESOURCES
0104 ---------
0105 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git