Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1527676
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2] tools lib traceevent: Add retrieval of preempt count and latency flags |
| Date | 2016-11-22 17:40 +0100 |
| Message-ID | <sGmgV-1eL-5@gated-at.bofh.it> (permalink) |
| References | <sF0it-4V9-3@gated-at.bofh.it> <sF0it-4V9-5@gated-at.bofh.it> <sGddD-3HP-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
---
tools/lib/traceevent/event-parse.c | 30 ++++++++++++++++++++++++++++--
tools/lib/traceevent/event-parse.h | 2 ++
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 664c90c8e22b..6e2dfcbf9e30 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -5191,11 +5191,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)
{
@@ -5203,6 +5203,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
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 9ffde377e89d..82b83c4d621c 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -712,6 +712,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_prempt_count(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,
--
2.1.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] tools lib traceevent: A couple of updates Steven Rostedt <rostedt@goodmis.org> - 2016-11-19 00:00 +0100
[PATCH 1/2] tools lib traceevent: Add retrieval of preempt count and latency flags Steven Rostedt <rostedt@goodmis.org> - 2016-11-19 00:00 +0100
Re: [PATCH 1/2] tools lib traceevent: Add retrieval of preempt count and latency flags Namhyung Kim <namhyung@kernel.org> - 2016-11-22 08:00 +0100
Re: [PATCH 1/2] tools lib traceevent: Add retrieval of preempt count and latency flags Steven Rostedt <rostedt@goodmis.org> - 2016-11-22 15:40 +0100
[PATCH v2] tools lib traceevent: Add retrieval of preempt count and latency flags Steven Rostedt <rostedt@goodmis.org> - 2016-11-22 17:40 +0100
Re: [PATCH v2] tools lib traceevent: Add retrieval of preempt count and latency flags Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-22 19:10 +0100
Re: [PATCH v2] tools lib traceevent: Add retrieval of preempt count and latency flags Namhyung Kim <namhyung@kernel.org> - 2016-11-23 05:50 +0100
[tip:perf/core] tools lib traceevent: Add retrieval of preempt count and latency flags tip-bot for Steven Rostedt <tipbot@zytor.com> - 2016-11-24 05:20 +0100
[PATCH 2/2] tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number Steven Rostedt <rostedt@goodmis.org> - 2016-11-19 00:00 +0100
Re: [PATCH 2/2] tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-19 00:50 +0100
Re: [PATCH 2/2] tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number Steven Rostedt <rostedt@goodmis.org> - 2016-11-21 17:50 +0100
Re: [PATCH 2/2] tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-21 20:20 +0100
Re: [PATCH 2/2] tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number Namhyung Kim <namhyung@kernel.org> - 2016-11-22 08:00 +0100
[tip:perf/core] tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number tip-bot for Steven Rostedt <tipbot@zytor.com> - 2016-11-24 05:20 +0100
csiph-web