diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2016-11-22 19:31:58 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-23 16:44:03 +0300 |
commit | c52d9e4e677b0407fe553e9211802e2505a2f244 (patch) | |
tree | e29777a93f6525a2cfa96ea62ac813a4d9277826 /tools/lib/traceevent/event-parse.c | |
parent | bb5a7316b909612a382b30b568c6b0345b4b6768 (diff) | |
download | linux-c52d9e4e677b0407fe553e9211802e2505a2f244.tar.xz |
tools lib traceevent: Add retrieval of preempt count and latency flags
Add a way to retrieve the preempt count as well as the latency flags from a
pevent_record.
int pevent_data_preempt_count(pevent, record);
returns the preempt count of a record.
int pevent_data_flags(pevent, record);
returns the latency flags for a record.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20161122113158.03a010a8@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/traceevent/event-parse.c')
-rw-r--r-- | tools/lib/traceevent/event-parse.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index c1ad1ffa7335..14a4f623c1a5 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -5192,11 +5192,11 @@ struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type } /** - * pevent_data_pid - parse the PID from raw data + * pevent_data_pid - parse the PID from record * @pevent: a handle to the pevent * @rec: the record to parse * - * This returns the PID from a raw data. + * This returns the PID from a record. */ int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec) { @@ -5204,6 +5204,32 @@ int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec) } /** + * pevent_data_prempt_count - parse the preempt count from the record + * @pevent: a handle to the pevent + * @rec: the record to parse + * + * This returns the preempt count from a record. + */ +int pevent_data_prempt_count(struct pevent *pevent, struct pevent_record *rec) +{ + return parse_common_pc(pevent, rec->data); +} + +/** + * pevent_data_flags - parse the latency flags from the record + * @pevent: a handle to the pevent + * @rec: the record to parse + * + * This returns the latency flags from a record. + * + * Use trace_flag_type enum for the flags (see event-parse.h). + */ +int pevent_data_flags(struct pevent *pevent, struct pevent_record *rec) +{ + return parse_common_flags(pevent, rec->data); +} + +/** * pevent_data_comm_from_pid - return the command line from PID * @pevent: a handle to the pevent * @pid: the PID of the task to search for |