All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Yordan Karadzhov <y.karadz@gmail.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 14/24] tools lib traceevent: Rename pevent_function* APIs
Date: Tue, 21 Aug 2018 16:33:18 +0300	[thread overview]
Message-ID: <20180821133328.3249-15-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20180821133328.3249-1-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_function_handler, pevent_func_handler,
pevent_func_arg_type, PEVENT_FUNC_ARG_VOID, PEVENT_FUNC_ARG_INT,
PEVENT_FUNC_ARG_LONG, PEVENT_FUNC_ARG_STRING, PEVENT_FUNC_ARG_PTRS,
PEVENT_FUNC_ARG_MAX_TYPES

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Link: http://lkml.kernel.org/r/20180808180701.935881193@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 include/traceevent/event-parse.h | 30 ++++++++--------
 lib/traceevent/event-parse.c     | 62 ++++++++++++++++----------------
 plugins/plugin_cfg80211.c        |  6 ++--
 plugins/plugin_jbd2.c            | 12 +++----
 plugins/plugin_kvm.c             |  6 ++--
 plugins/plugin_scsi.c            | 10 +++---
 plugins/plugin_xen.c             |  6 ++--
 7 files changed, 66 insertions(+), 66 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 4d4637d..89f4c64 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -255,10 +255,10 @@ struct print_arg_op {
 	struct print_arg	*right;
 };
 
-struct pevent_function_handler;
+struct tep_function_handler;
 
 struct print_arg_func {
-	struct pevent_function_handler	*func;
+	struct tep_function_handler	*func;
 	struct print_arg		*args;
 };
 
@@ -347,16 +347,16 @@ enum event_type {
 	EVENT_SQUOTE,
 };
 
-typedef unsigned long long (*pevent_func_handler)(struct trace_seq *s,
-					     unsigned long long *args);
+typedef unsigned long long (*tep_func_handler)(struct trace_seq *s,
+					       unsigned long long *args);
 
-enum pevent_func_arg_type {
-	PEVENT_FUNC_ARG_VOID,
-	PEVENT_FUNC_ARG_INT,
-	PEVENT_FUNC_ARG_LONG,
-	PEVENT_FUNC_ARG_STRING,
-	PEVENT_FUNC_ARG_PTR,
-	PEVENT_FUNC_ARG_MAX_TYPES
+enum tep_func_arg_type {
+	TEP_FUNC_ARG_VOID,
+	TEP_FUNC_ARG_INT,
+	TEP_FUNC_ARG_LONG,
+	TEP_FUNC_ARG_STRING,
+	TEP_FUNC_ARG_PTR,
+	TEP_FUNC_ARG_MAX_TYPES
 };
 
 enum tep_flag {
@@ -510,7 +510,7 @@ struct tep_handle {
 	struct format_field *bprint_buf_field;
 
 	struct event_handler *handlers;
-	struct pevent_function_handler *func_handlers;
+	struct tep_function_handler *func_handlers;
 
 	int parsing_failures;
 
@@ -668,11 +668,11 @@ int pevent_unregister_event_handler(struct tep_handle *pevent, int id,
 				    const char *sys_name, const char *event_name,
 				    tep_event_handler_func func, void *context);
 int pevent_register_print_function(struct tep_handle *pevent,
-				   pevent_func_handler func,
-				   enum pevent_func_arg_type ret_type,
+				   tep_func_handler func,
+				   enum tep_func_arg_type ret_type,
 				   char *name, ...);
 int pevent_unregister_print_function(struct tep_handle *pevent,
-				     pevent_func_handler func, char *name);
+				     tep_func_handler func, char *name);
 
 struct format_field *tep_find_common_field(struct event_format *event, const char *name);
 struct format_field *tep_find_field(struct event_format *event, const char *name);
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index b717eb8..5e4f493 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -80,14 +80,14 @@ struct event_handler {
 
 struct pevent_func_params {
 	struct pevent_func_params	*next;
-	enum pevent_func_arg_type	type;
+	enum tep_func_arg_type		type;
 };
 
-struct pevent_function_handler {
-	struct pevent_function_handler	*next;
-	enum pevent_func_arg_type	ret_type;
+struct tep_function_handler {
+	struct tep_function_handler	*next;
+	enum tep_func_arg_type		ret_type;
 	char				*name;
-	pevent_func_handler		func;
+	tep_func_handler		func;
 	struct pevent_func_params	*params;
 	int				nr_args;
 };
@@ -96,7 +96,7 @@ static unsigned long long
 process_defined_func(struct trace_seq *s, void *data, int size,
 		     struct event_format *event, struct print_arg *arg);
 
-static void free_func_handle(struct pevent_function_handler *func);
+static void free_func_handle(struct tep_function_handler *func);
 
 /**
  * pevent_buffer_init - init buffer for parsing
@@ -2900,10 +2900,10 @@ process_bitmask(struct event_format *event __maybe_unused, struct print_arg *arg
 	return EVENT_ERROR;
 }
 
-static struct pevent_function_handler *
+static struct tep_function_handler *
 find_func_handler(struct tep_handle *pevent, char *func_name)
 {
-	struct pevent_function_handler *func;
+	struct tep_function_handler *func;
 
 	if (!pevent)
 		return NULL;
@@ -2918,8 +2918,8 @@ find_func_handler(struct tep_handle *pevent, char *func_name)
 
 static void remove_func_handler(struct tep_handle *pevent, char *func_name)
 {
-	struct pevent_function_handler *func;
-	struct pevent_function_handler **next;
+	struct tep_function_handler *func;
+	struct tep_function_handler **next;
 
 	next = &pevent->func_handlers;
 	while ((func = *next)) {
@@ -2933,7 +2933,7 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name)
 }
 
 static enum event_type
-process_func_handler(struct event_format *event, struct pevent_function_handler *func,
+process_func_handler(struct event_format *event, struct tep_function_handler *func,
 		     struct print_arg *arg, char **tok)
 {
 	struct print_arg **next_arg;
@@ -2994,7 +2994,7 @@ static enum event_type
 process_function(struct event_format *event, struct print_arg *arg,
 		 char *token, char **tok)
 {
-	struct pevent_function_handler *func;
+	struct tep_function_handler *func;
 
 	if (strcmp(token, "__print_flags") == 0) {
 		free_token(token);
@@ -4118,7 +4118,7 @@ static unsigned long long
 process_defined_func(struct trace_seq *s, void *data, int size,
 		     struct event_format *event, struct print_arg *arg)
 {
-	struct pevent_function_handler *func_handle = arg->func.func;
+	struct tep_function_handler *func_handle = arg->func.func;
 	struct pevent_func_params *param;
 	unsigned long long *args;
 	unsigned long long ret;
@@ -4145,12 +4145,12 @@ process_defined_func(struct trace_seq *s, void *data, int size,
 
 	for (i = 0; i < func_handle->nr_args; i++) {
 		switch (param->type) {
-		case PEVENT_FUNC_ARG_INT:
-		case PEVENT_FUNC_ARG_LONG:
-		case PEVENT_FUNC_ARG_PTR:
+		case TEP_FUNC_ARG_INT:
+		case TEP_FUNC_ARG_LONG:
+		case TEP_FUNC_ARG_PTR:
 			args[i] = eval_num_arg(data, size, event, farg);
 			break;
-		case PEVENT_FUNC_ARG_STRING:
+		case TEP_FUNC_ARG_STRING:
 			trace_seq_init(&str);
 			print_str_arg(&str, data, size, event, "%s", -1, farg);
 			trace_seq_terminate(&str);
@@ -6447,7 +6447,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt,
 	return -1;
 }
 
-static void free_func_handle(struct pevent_function_handler *func)
+static void free_func_handle(struct tep_function_handler *func)
 {
 	struct pevent_func_params *params;
 
@@ -6468,24 +6468,24 @@ static void free_func_handle(struct pevent_function_handler *func)
  * @func: the function to process the helper function
  * @ret_type: the return type of the helper function
  * @name: the name of the helper function
- * @parameters: A list of enum pevent_func_arg_type
+ * @parameters: A list of enum tep_func_arg_type
  *
  * Some events may have helper functions in the print format arguments.
  * This allows a plugin to dynamically create a way to process one
  * of these functions.
  *
- * The @parameters is a variable list of pevent_func_arg_type enums that
- * must end with PEVENT_FUNC_ARG_VOID.
+ * The @parameters is a variable list of tep_func_arg_type enums that
+ * must end with TEP_FUNC_ARG_VOID.
  */
 int pevent_register_print_function(struct tep_handle *pevent,
-				   pevent_func_handler func,
-				   enum pevent_func_arg_type ret_type,
+				   tep_func_handler func,
+				   enum tep_func_arg_type ret_type,
 				   char *name, ...)
 {
-	struct pevent_function_handler *func_handle;
+	struct tep_function_handler *func_handle;
 	struct pevent_func_params **next_param;
 	struct pevent_func_params *param;
-	enum pevent_func_arg_type type;
+	enum tep_func_arg_type type;
 	va_list ap;
 	int ret;
 
@@ -6518,11 +6518,11 @@ int pevent_register_print_function(struct tep_handle *pevent,
 	next_param = &(func_handle->params);
 	va_start(ap, name);
 	for (;;) {
-		type = va_arg(ap, enum pevent_func_arg_type);
-		if (type == PEVENT_FUNC_ARG_VOID)
+		type = va_arg(ap, enum tep_func_arg_type);
+		if (type == TEP_FUNC_ARG_VOID)
 			break;
 
-		if (type >= PEVENT_FUNC_ARG_MAX_TYPES) {
+		if (type >= TEP_FUNC_ARG_MAX_TYPES) {
 			do_warning("Invalid argument type %d", type);
 			ret = TEP_ERRNO__INVALID_ARG_TYPE;
 			goto out_free;
@@ -6565,9 +6565,9 @@ int pevent_register_print_function(struct tep_handle *pevent,
  * Returns 0 if the handler was removed successully, -1 otherwise.
  */
 int pevent_unregister_print_function(struct tep_handle *pevent,
-				     pevent_func_handler func, char *name)
+				     tep_func_handler func, char *name)
 {
-	struct pevent_function_handler *func_handle;
+	struct tep_function_handler *func_handle;
 
 	func_handle = find_func_handler(pevent, name);
 	if (func_handle && func_handle->func == func) {
@@ -6805,7 +6805,7 @@ void tep_free(struct tep_handle *pevent)
 	struct cmdline_list *cmdlist, *cmdnext;
 	struct func_list *funclist, *funcnext;
 	struct printk_list *printklist, *printknext;
-	struct pevent_function_handler *func_handler;
+	struct tep_function_handler *func_handler;
 	struct event_handler *handle;
 	int i;
 
diff --git a/plugins/plugin_cfg80211.c b/plugins/plugin_cfg80211.c
index c189bbc..e0421e3 100644
--- a/plugins/plugin_cfg80211.c
+++ b/plugins/plugin_cfg80211.c
@@ -29,10 +29,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
 {
 	pevent_register_print_function(pevent,
 				       process___le16_to_cpup,
-				       PEVENT_FUNC_ARG_INT,
+				       TEP_FUNC_ARG_INT,
 				       "__le16_to_cpup",
-				       PEVENT_FUNC_ARG_PTR,
-				       PEVENT_FUNC_ARG_VOID);
+				       TEP_FUNC_ARG_PTR,
+				       TEP_FUNC_ARG_VOID);
 	return 0;
 }
 
diff --git a/plugins/plugin_jbd2.c b/plugins/plugin_jbd2.c
index c942229..0dd1633 100644
--- a/plugins/plugin_jbd2.c
+++ b/plugins/plugin_jbd2.c
@@ -38,17 +38,17 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
 {
 	pevent_register_print_function(pevent,
 				       process_jbd2_dev_to_name,
-				       PEVENT_FUNC_ARG_STRING,
+				       TEP_FUNC_ARG_STRING,
 				       "jbd2_dev_to_name",
-				       PEVENT_FUNC_ARG_INT,
-				       PEVENT_FUNC_ARG_VOID);
+				       TEP_FUNC_ARG_INT,
+				       TEP_FUNC_ARG_VOID);
 
 	pevent_register_print_function(pevent,
 				       process_jiffies_to_msecs,
-				       PEVENT_FUNC_ARG_LONG,
+				       TEP_FUNC_ARG_LONG,
 				       "jiffies_to_msecs",
-				       PEVENT_FUNC_ARG_LONG,
-				       PEVENT_FUNC_ARG_VOID);
+				       TEP_FUNC_ARG_LONG,
+				       TEP_FUNC_ARG_VOID);
 	return 0;
 }
 
diff --git a/plugins/plugin_kvm.c b/plugins/plugin_kvm.c
index 0244768..a7626ac 100644
--- a/plugins/plugin_kvm.c
+++ b/plugins/plugin_kvm.c
@@ -472,10 +472,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
 
 	pevent_register_print_function(pevent,
 				       process_is_writable_pte,
-				       PEVENT_FUNC_ARG_INT,
+				       TEP_FUNC_ARG_INT,
 				       "is_writable_pte",
-				       PEVENT_FUNC_ARG_LONG,
-				       PEVENT_FUNC_ARG_VOID);
+				       TEP_FUNC_ARG_LONG,
+				       TEP_FUNC_ARG_VOID);
 	return 0;
 }
 
diff --git a/plugins/plugin_scsi.c b/plugins/plugin_scsi.c
index bb9aea6..ce38df7 100644
--- a/plugins/plugin_scsi.c
+++ b/plugins/plugin_scsi.c
@@ -417,12 +417,12 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
 {
 	pevent_register_print_function(pevent,
 				       process_scsi_trace_parse_cdb,
-				       PEVENT_FUNC_ARG_STRING,
+				       TEP_FUNC_ARG_STRING,
 				       "scsi_trace_parse_cdb",
-				       PEVENT_FUNC_ARG_PTR,
-				       PEVENT_FUNC_ARG_PTR,
-				       PEVENT_FUNC_ARG_INT,
-				       PEVENT_FUNC_ARG_VOID);
+				       TEP_FUNC_ARG_PTR,
+				       TEP_FUNC_ARG_PTR,
+				       TEP_FUNC_ARG_INT,
+				       TEP_FUNC_ARG_VOID);
 	return 0;
 }
 
diff --git a/plugins/plugin_xen.c b/plugins/plugin_xen.c
index 1973dd8..2ffbd91 100644
--- a/plugins/plugin_xen.c
+++ b/plugins/plugin_xen.c
@@ -123,10 +123,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
 {
 	pevent_register_print_function(pevent,
 				       process_xen_hypercall_name,
-				       PEVENT_FUNC_ARG_STRING,
+				       TEP_FUNC_ARG_STRING,
 				       "xen_hypercall_name",
-				       PEVENT_FUNC_ARG_INT,
-				       PEVENT_FUNC_ARG_VOID);
+				       TEP_FUNC_ARG_INT,
+				       TEP_FUNC_ARG_VOID);
 	return 0;
 }
 
-- 
2.17.1

  parent reply	other threads:[~2018-08-21 16:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21 13:33 [PATCH 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 02/24] tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record' Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 03/24] tools lib traceevent, perf tools: Rename pevent plugin related APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 04/24] tools lib traceevent, perf tools: Rename pevent alloc / free APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 05/24] tools lib traceevent, perf tools: Rename pevent find APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 06/24] tools lib traceevent, perf tools: Rename pevent parse APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 07/24] tools lib traceevent, perf tools: Rename pevent print APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 08/24] tools lib traceevent, perf tools: Rename pevent_read_number_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 09/24] tools lib traceevent, perf tools: Rename pevent_register_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 10/24] tools lib traceevent, perf tools: Rename pevent_set_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 11/24] tools lib traceevent, perf tools: Rename traceevent_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 12/24] tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag' Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 13/24] tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno' Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` Tzvetomir Stoyanov (VMware) [this message]
2018-08-21 13:33 ` [PATCH 15/24] tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 16/24] tools lib traceevent: Rename pevent_filter* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 17/24] tools lib traceevent: Rename pevent_register / unregister APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 18/24] tools lib traceevent: Rename pevent_data_ APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 19/24] tools lib traceevent: Rename pevent field APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 20/24] tools lib traceevent: Rename pevent_find_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 21/24] tools lib traceevent: Rename various pevent get/set/is APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 22/24] tools lib traceevent: Rename internal parser related APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 23/24] tools lib traceevent: Rename various pevent APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 24/24] tools lib traceevent: Rename static variables and functions in event-parse.c Tzvetomir Stoyanov (VMware)
     [not found] ` <20180821133328.3249-2-tz.stoyanov@gmail.com>
     [not found]   ` <20180823140648.GB2077@redhat.com>
2018-08-24  0:56     ` [PATCH 01/24] tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle Steven Rostedt

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=20180821133328.3249-15-tz.stoyanov@gmail.com \
    --to=tz.stoyanov@gmail.com \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --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.