6 tep_data_type, tep_data_pid,tep_data_preempt_count, tep_data_flags -
7 Extract common fields from a record.
13 *#include <event-parse.h>*
15 enum *trace_flag_type* {
16 _TRACE_FLAG_IRQS_OFF_,
17 _TRACE_FLAG_IRQS_NOSUPPORT_,
18 _TRACE_FLAG_NEED_RESCHED_,
23 int *tep_data_type*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);
24 int *tep_data_pid*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);
25 int *tep_data_preempt_count*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);
26 int *tep_data_flags*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);
31 This set of functions can be used to extract common fields from a record.
33 The _tep_data_type()_ function gets the event id from the record _rec_.
34 It reads the "common_type" field. The _tep_ argument is the trace event parser
37 The _tep_data_pid()_ function gets the process id from the record _rec_.
38 It reads the "common_pid" field. The _tep_ argument is the trace event parser
41 The _tep_data_preempt_count()_ function gets the preemption count from the
42 record _rec_. It reads the "common_preempt_count" field. The _tep_ argument is
43 the trace event parser context.
45 The _tep_data_flags()_ function gets the latency flags from the record _rec_.
46 It reads the "common_flags" field. The _tep_ argument is the trace event parser
47 context. Supported latency flags are:
50 _TRACE_FLAG_IRQS_OFF_, Interrupts are disabled.
51 _TRACE_FLAG_IRQS_NOSUPPORT_, Reading IRQ flag is not supported by the architecture.
52 _TRACE_FLAG_NEED_RESCHED_, Task needs rescheduling.
53 _TRACE_FLAG_HARDIRQ_, Hard IRQ is running.
54 _TRACE_FLAG_SOFTIRQ_, Soft IRQ is running.
59 The _tep_data_type()_ function returns an integer, representing the event id.
61 The _tep_data_pid()_ function returns an integer, representing the process id
63 The _tep_data_preempt_count()_ function returns an integer, representing the
66 The _tep_data_flags()_ function returns an integer, representing the latency
67 flags. Look at the _trace_flag_type_ enum for supported flags.
69 All these functions in case of an error return a negative integer.
75 #include <event-parse.h>
77 struct tep_handle *tep = tep_alloc();
79 void process_record(struct tep_record *record)
83 data = tep_data_type(tep, record);
85 /* Got the ID of the event */
88 data = tep_data_pid(tep, record);
90 /* Got the process ID */
93 data = tep_data_preempt_count(tep, record);
95 /* Got the preemption count */
98 data = tep_data_flags(tep, record);
100 /* Got the latency flags */
111 Header file to include in order to have access to the library APIs.
113 Linker switch to add when building a program that uses the library.
118 _libtraceevent(3)_, _trace-cmd(1)_
124 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
125 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
129 Report bugs to <linux-trace-devel@vger.kernel.org>
133 libtraceevent is Free Software licensed under the GNU LGPL 2.1
137 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git