All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>,
	"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
Subject: [RFC][PATCH v2 18/24] tools/lib/traceevent: Rename pevent_data_ APIs
Date: Wed, 08 Aug 2018 14:03:03 -0400	[thread overview]
Message-ID: <20180808180702.678020020@goodmis.org> (raw)
In-Reply-To: 20180808180245.352784763@goodmis.org

From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>

In order to make libtraceevent into a proper library, variables, data
structures and functions require a unique prefix to prevent name space
conflicts. That prefix will be "tep_" and not "pevent_". This changes
APIs: pevent_data_lat_fmt, pevent_data_type, pevent_data_event_from_type,
pevent_data_pid, pevent_data_preempt_count, pevent_data_flags,
pevent_data_comm_from_pid, pevent_data_pid_from_comm, pevent_cmdline_pid

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 tools/lib/traceevent/event-parse.c  | 44 ++++++++++++++---------------
 tools/lib/traceevent/event-parse.h  | 22 +++++++--------
 tools/lib/traceevent/parse-filter.c |  6 ++--
 3 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 0de470c07be9..4f924bf42b92 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -5140,7 +5140,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
 }
 
 /**
- * pevent_data_lat_fmt - parse the data for the latency format
+ * tep_data_lat_fmt - parse the data for the latency format
  * @pevent: a handle to the pevent
  * @s: the trace_seq to write to
  * @record: the record to read from
@@ -5149,8 +5149,8 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
  * need rescheduling, in hard/soft interrupt, preempt count
  * and lock depth) and places it into the trace_seq.
  */
-void pevent_data_lat_fmt(struct tep_handle *pevent,
-			 struct trace_seq *s, struct tep_record *record)
+void tep_data_lat_fmt(struct tep_handle *pevent,
+		      struct trace_seq *s, struct tep_record *record)
 {
 	static int check_lock_depth = 1;
 	static int check_migrate_disable = 1;
@@ -5223,55 +5223,55 @@ void pevent_data_lat_fmt(struct tep_handle *pevent,
 }
 
 /**
- * pevent_data_type - parse out the given event type
+ * tep_data_type - parse out the given event type
  * @pevent: a handle to the pevent
  * @rec: the record to read from
  *
  * This returns the event id from the @rec.
  */
-int pevent_data_type(struct tep_handle *pevent, struct tep_record *rec)
+int tep_data_type(struct tep_handle *pevent, struct tep_record *rec)
 {
 	return trace_parse_common_type(pevent, rec->data);
 }
 
 /**
- * pevent_data_event_from_type - find the event by a given type
+ * tep_data_event_from_type - find the event by a given type
  * @pevent: a handle to the pevent
  * @type: the type of the event.
  *
  * This returns the event form a given @type;
  */
-struct event_format *pevent_data_event_from_type(struct tep_handle *pevent, int type)
+struct event_format *tep_data_event_from_type(struct tep_handle *pevent, int type)
 {
 	return tep_find_event(pevent, type);
 }
 
 /**
- * pevent_data_pid - parse the PID from record
+ * tep_data_pid - parse the PID from record
  * @pevent: a handle to the pevent
  * @rec: the record to parse
  *
  * This returns the PID from a record.
  */
-int pevent_data_pid(struct tep_handle *pevent, struct tep_record *rec)
+int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec)
 {
 	return parse_common_pid(pevent, rec->data);
 }
 
 /**
- * pevent_data_preempt_count - parse the preempt count from the record
+ * tep_data_preempt_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_preempt_count(struct tep_handle *pevent, struct tep_record *rec)
+int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec)
 {
 	return parse_common_pc(pevent, rec->data);
 }
 
 /**
- * pevent_data_flags - parse the latency flags from the record
+ * tep_data_flags - parse the latency flags from the record
  * @pevent: a handle to the pevent
  * @rec: the record to parse
  *
@@ -5279,20 +5279,20 @@ int pevent_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec)
  *
  *  Use trace_flag_type enum for the flags (see event-parse.h).
  */
-int pevent_data_flags(struct tep_handle *pevent, struct tep_record *rec)
+int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec)
 {
 	return parse_common_flags(pevent, rec->data);
 }
 
 /**
- * pevent_data_comm_from_pid - return the command line from PID
+ * tep_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
  *
  * This returns a pointer to the command line that has the given
  * @pid.
  */
-const char *pevent_data_comm_from_pid(struct tep_handle *pevent, int pid)
+const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid)
 {
 	const char *comm;
 
@@ -5317,7 +5317,7 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne
 }
 
 /**
- * pevent_data_pid_from_comm - return the pid from a given comm
+ * tep_data_pid_from_comm - return the pid from a given comm
  * @pevent: a handle to the pevent
  * @comm: the cmdline to find the pid from
  * @next: the cmdline structure to find the next comm
@@ -5329,8 +5329,8 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne
  * next pid.
  * Also, it does a linear seach, so it may be slow.
  */
-struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char *comm,
-					  struct cmdline *next)
+struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm,
+				       struct cmdline *next)
 {
 	struct cmdline *cmdline;
 
@@ -5365,13 +5365,13 @@ struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char
 }
 
 /**
- * pevent_cmdline_pid - return the pid associated to a given cmdline
+ * tep_cmdline_pid - return the pid associated to a given cmdline
  * @cmdline: The cmdline structure to get the pid from
  *
  * Returns the pid for a give cmdline. If @cmdline is NULL, then
  * -1 is returned.
  */
-int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)
+int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)
 {
 	struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline;
 
@@ -5391,7 +5391,7 @@ int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)
 }
 
 /**
- * pevent_data_comm_from_pid - parse the data into the print format
+ * tep_event_info - parse the data into the print format
  * @s: the trace_seq to write to
  * @event: the handle to the event
  * @record: the record to read from
@@ -5511,7 +5511,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
 	}
 
 	if (pevent->latency_format) {
-		pevent_data_lat_fmt(pevent, s, record);
+		tep_data_lat_fmt(pevent, s, record);
 	}
 
 	if (use_usec_format) {
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index dc0d2d3b7c33..2c4da2f1d4ed 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -705,18 +705,18 @@ pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const char
 struct event_format *
 pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record);
 
-void pevent_data_lat_fmt(struct tep_handle *pevent,
-			 struct trace_seq *s, struct tep_record *record);
-int pevent_data_type(struct tep_handle *pevent, struct tep_record *rec);
-struct event_format *pevent_data_event_from_type(struct tep_handle *pevent, int type);
-int pevent_data_pid(struct tep_handle *pevent, struct tep_record *rec);
-int pevent_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec);
-int pevent_data_flags(struct tep_handle *pevent, struct tep_record *rec);
-const char *pevent_data_comm_from_pid(struct tep_handle *pevent, int pid);
+void tep_data_lat_fmt(struct tep_handle *pevent,
+		      struct trace_seq *s, struct tep_record *record);
+int tep_data_type(struct tep_handle *pevent, struct tep_record *rec);
+struct event_format *tep_data_event_from_type(struct tep_handle *pevent, int type);
+int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec);
+int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec);
+int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec);
+const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid);
 struct cmdline;
-struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char *comm,
-					  struct cmdline *next);
-int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline);
+struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm,
+				       struct cmdline *next);
+int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline);
 
 void tep_print_field(struct trace_seq *s, void *data,
 		     struct format_field *field);
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index f3d812676169..474d820e97e1 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -1705,8 +1705,8 @@ get_comm(struct event_format *event, struct tep_record *record)
 	const char *comm;
 	int pid;
 
-	pid = pevent_data_pid(event->pevent, record);
-	comm = pevent_data_comm_from_pid(event->pevent, pid);
+	pid = tep_data_pid(event->pevent, record);
+	comm = tep_data_comm_from_pid(event->pevent, pid);
 	return comm;
 }
 
@@ -2060,7 +2060,7 @@ enum tep_errno tep_filter_match(struct event_filter *filter,
 	if (!filter->filters)
 		return TEP_ERRNO__NO_FILTER;
 
-	event_id = pevent_data_type(pevent, record);
+	event_id = tep_data_type(pevent, record);
 
 	filter_type = find_filter_type(filter, event_id);
 	if (!filter_type)
-- 
2.18.0



  parent reply	other threads:[~2018-08-08 18:08 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 18:02 [RFC][PATCH v2 00/24] tools lib traceevent: Rename pevent to tep for preparation for library Steven Rostedt
2018-08-08 18:02 ` [RFC][PATCH v2 01/24] tools/lib/traceevent, tools/perf: Rename struct pevent to struct tep_handle Steven Rostedt
2018-08-18 11:43   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 02/24] tools/lib/traceevent, tools/perf: Rename struct pevent_record to struct tep_record Steven Rostedt
2018-08-18 11:44   ` [tip:perf/urgent] tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record' tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 03/24] tools/lib/traceevent, tools/perf: Rename pevent plugin related APIs Steven Rostedt
2018-08-18 11:44   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 04/24] tools/lib/traceevent, tools/perf: Rename pevent alloc / free APIs Steven Rostedt
2018-08-18 11:45   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 05/24] tools/lib/traceevent, tools/perf: Rename pevent find APIs Steven Rostedt
2018-08-18 11:45   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 06/24] tools/lib/traceevent, tools/perf: Rename pevent parse APIs Steven Rostedt
2018-08-18 11:46   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 07/24] tools/lib/traceevent, tools/perf: Rename pevent print APIs Steven Rostedt
2018-08-18 11:46   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 08/24] tools/lib/traceevent, tools/perf: Rename pevent_read_number_* APIs Steven Rostedt
2018-08-18 11:47   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 09/24] tools/lib/traceevent, tools/perf: Rename pevent_register_* APIs Steven Rostedt
2018-08-18 11:47   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 10/24] tools/lib/traceevent, tools/perf: Rename pevent_set_* APIs Steven Rostedt
2018-08-18 11:48   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 11/24] tools/lib/traceevent, tools/perf: Rename traceevent_* APIs Steven Rostedt
2018-08-18 11:48   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 12/24] tools/lib/traceevent, tools/perf: Rename enum pevent_flag to enum tep_flag Steven Rostedt
2018-08-18 11:49   ` [tip:perf/urgent] tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag' tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 13/24] tools/lib/traceevent, tools/lib/lockdep/: Rename enunm pevent_errno to enum tep_errno Steven Rostedt
2018-08-18 11:49   ` [tip:perf/urgent] tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno' tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:02 ` [RFC][PATCH v2 14/24] tools/lib/traceevent: Rename pevent_function* APIs Steven Rostedt
2018-08-18 11:50   ` [tip:perf/urgent] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:03 ` [RFC][PATCH v2 15/24] tools/lib/traceevent, tools/perf: Rename traceevent_plugin_* APIs Steven Rostedt
2018-08-18 11:50   ` [tip:perf/urgent] tools lib traceevent, perf tools: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:03 ` [RFC][PATCH v2 16/24] tools/lib/traceevent: Rename pevent_filter* APIs Steven Rostedt
2018-08-18 11:51   ` [tip:perf/urgent] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:03 ` [RFC][PATCH v2 17/24] tools/lib/traceevent: Rename pevent_register / unregister APIs Steven Rostedt
2018-08-18 11:51   ` [tip:perf/urgent] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:03 ` Steven Rostedt [this message]
2018-08-18 11:52   ` [tip:perf/urgent] tools lib traceevent: Rename pevent_data_ APIs tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:03 ` [RFC][PATCH v2 19/24] tools/lib/traceevent: Rename pevent field APIs Steven Rostedt
2018-08-18 11:52   ` [tip:perf/urgent] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:03 ` [RFC][PATCH v2 20/24] tools/lib/traceevent: Rename pevent_find_* APIs Steven Rostedt
2018-08-18 11:53   ` [tip:perf/urgent] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:03 ` [RFC][PATCH v2 21/24] tools/lib/traceevent: Rename various pevent get/set/is APIs Steven Rostedt
2018-08-18 11:53   ` [tip:perf/urgent] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-22 14:36     ` Steven Rostedt
2018-08-23 13:59       ` Arnaldo Carvalho de Melo
2018-08-08 18:03 ` [RFC][PATCH v2 22/24] tools/lib/traceevent: Rename internal parser related APIs Steven Rostedt
2018-08-18 11:54   ` [tip:perf/urgent] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:03 ` [RFC][PATCH v2 23/24] tools/lib/traceevent: Rename various pevent APIs Steven Rostedt
2018-08-18 11:54   ` [tip:perf/urgent] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov (VMware)
2018-08-08 18:03 ` [RFC][PATCH v2 24/24] tools/lib/traceevent: Rename static variables and functions in event-parse.c Steven Rostedt
2018-08-18 11:55   ` [tip:perf/urgent] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov (VMware)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180808180702.678020020@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tz.stoyanov@gmail.com \
    --cc=y.karadz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.