Linux Audio

Check our new training course

Loading...
Note: File does not exist in v3.15.
  1libtraceevent(3)
  2================
  3
  4NAME
  5----
  6tep_event_common_fields, tep_event_fields - Get a list of fields for an event.
  7
  8SYNOPSIS
  9--------
 10[verse]
 11--
 12*#include <event-parse.h>*
 13
 14struct tep_format_field pass:[*]pass:[*]*tep_event_common_fields*(struct tep_event pass:[*]_event_);
 15struct tep_format_field pass:[*]pass:[*]*tep_event_fields*(struct tep_event pass:[*]_event_);
 16--
 17
 18DESCRIPTION
 19-----------
 20The _tep_event_common_fields()_ function returns an array of pointers to common
 21fields for the _event_. The array is allocated in the function and must be freed
 22by free(). The last element of the array is NULL.
 23
 24The _tep_event_fields()_ function returns an array of pointers to event specific
 25fields for the _event_. The array is allocated in the function and must be freed
 26by free(). The last element of the array is NULL.
 27
 28RETURN VALUE
 29------------
 30Both _tep_event_common_fields()_ and _tep_event_fields()_ functions return
 31an array of pointers to tep_format_field structures in case of success, or
 32NULL in case of an error.
 33
 34EXAMPLE
 35-------
 36[source,c]
 37--
 38#include <event-parse.h>
 39...
 40struct tep_handle *tep = tep_alloc();
 41...
 42int i;
 43struct tep_format_field **fields;
 44struct tep_event *event = tep_find_event_by_name(tep, "kvm", "kvm_exit");
 45if (event != NULL) {
 46	fields = tep_event_common_fields(event);
 47	if (fields != NULL) {
 48		i = 0;
 49		while (fields[i]) {
 50			/*
 51			  walk through the list of the common fields
 52			  of the kvm_exit event
 53			*/
 54			i++;
 55		}
 56		free(fields);
 57	}
 58	fields = tep_event_fields(event);
 59	if (fields != NULL) {
 60		i = 0;
 61		while (fields[i]) {
 62			/*
 63			  walk through the list of the event specific
 64			  fields of the kvm_exit event
 65			*/
 66			i++;
 67		}
 68		free(fields);
 69	}
 70}
 71...
 72--
 73
 74FILES
 75-----
 76[verse]
 77--
 78*event-parse.h*
 79	Header file to include in order to have access to the library APIs.
 80*-ltraceevent*
 81	Linker switch to add when building a program that uses the library.
 82--
 83
 84SEE ALSO
 85--------
 86_libtraceevent(3)_, _trace-cmd(1)_
 87
 88AUTHOR
 89------
 90[verse]
 91--
 92*Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
 93*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
 94--
 95REPORTING BUGS
 96--------------
 97Report bugs to  <linux-trace-devel@vger.kernel.org>
 98
 99LICENSE
100-------
101libtraceevent is Free Software licensed under the GNU LGPL 2.1
102
103RESOURCES
104---------
105https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git