diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2016-02-10 14:31:24 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-02-10 15:30:53 -0500 |
commit | 72e659581e20fef67bb22e9e2da03eeb1dbc76cd (patch) | |
tree | 8259a598efd2a7a3beef8a477f4bcdd619fa3723 | |
parent | dbc44d738aca8ba0d72749ce26468028e1635c3b (diff) | |
download | trace-cmd-72e659581e20fef67bb22e9e2da03eeb1dbc76cd.tar.gz |
event-parse: 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_pc(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>
-rw-r--r-- | event-parse.c | 30 | ||||
-rw-r--r-- | event-parse.h | 2 |
2 files changed, 30 insertions, 2 deletions
diff --git a/event-parse.c b/event-parse.c index 81a2efad..18e93e43 100644 --- a/event-parse.c +++ b/event-parse.c @@ -5179,11 +5179,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) { @@ -5191,6 +5191,32 @@ int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec) } /** + * pevent_data_pc - 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_pc(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 diff --git a/event-parse.h b/event-parse.h index 10e35ae1..ea653580 100644 --- a/event-parse.h +++ b/event-parse.h @@ -703,6 +703,8 @@ void pevent_data_lat_fmt(struct pevent *pevent, int pevent_data_type(struct pevent *pevent, struct pevent_record *rec); struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type); int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec); +int pevent_data_pc(struct pevent *pevent, struct pevent_record *rec); +int pevent_data_flags(struct pevent *pevent, struct pevent_record *rec); const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid); struct cmdline; struct cmdline *pevent_data_pid_from_comm(struct pevent *pevent, const char *comm, |