linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Yordan Karadzhov <y.karadz@gmail.com>,
	linux-trace-devel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 05/35] tools lib traceevent, perf tools: Rename pevent alloc / free APIs
Date: Wed, 15 Aug 2018 12:05:41 -0300	[thread overview]
Message-ID: <20180815150611.32080-6-acme@kernel.org> (raw)
In-Reply-To: <20180815150611.32080-1-acme@kernel.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_alloc, pevent_free, pevent_event_info and pevent_func_resolver_t

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/20180808180700.152609945@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/event-parse.c  | 24 ++++++++++++------------
 tools/lib/traceevent/event-parse.h  | 12 ++++++------
 tools/perf/builtin-kmem.c           |  2 +-
 tools/perf/util/sort.c              |  2 +-
 tools/perf/util/trace-event-parse.c |  2 +-
 tools/perf/util/trace-event.c       |  6 +++---
 tools/perf/util/trace-event.h       |  2 +-
 7 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 57ed9348d1aa..040180f6ed74 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -438,9 +438,9 @@ __find_func(struct tep_handle *pevent, unsigned long long addr)
 }
 
 struct func_resolver {
-	pevent_func_resolver_t *func;
-	void		       *priv;
-	struct func_map	       map;
+	tep_func_resolver_t	*func;
+	void			*priv;
+	struct func_map		map;
 };
 
 /**
@@ -454,7 +454,7 @@ struct func_resolver {
  * pevent->funclist.
  */
 int pevent_set_function_resolver(struct tep_handle *pevent,
-				 pevent_func_resolver_t *func, void *priv)
+				 tep_func_resolver_t *func, void *priv)
 {
 	struct func_resolver *resolver = malloc(sizeof(*resolver));
 
@@ -5399,8 +5399,8 @@ int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)
  * This parses the raw @data using the given @event information and
  * writes the print format into the trace_seq.
  */
-void pevent_event_info(struct trace_seq *s, struct event_format *event,
-		       struct tep_record *record)
+void tep_event_info(struct trace_seq *s, struct event_format *event,
+		    struct tep_record *record)
 {
 	int print_pretty = 1;
 
@@ -5556,7 +5556,7 @@ void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
 	if (len < 20)
 		trace_seq_printf(s, "%.*s", 20 - len, spaces);
 
-	pevent_event_info(s, event, record);
+	tep_event_info(s, event, record);
 }
 
 void pevent_print_event(struct tep_handle *pevent, struct trace_seq *s,
@@ -6754,9 +6754,9 @@ int pevent_unregister_event_handler(struct tep_handle *pevent, int id,
 }
 
 /**
- * pevent_alloc - create a pevent handle
+ * tep_alloc - create a pevent handle
  */
-struct tep_handle *pevent_alloc(void)
+struct tep_handle *tep_alloc(void)
 {
 	struct tep_handle *pevent = calloc(1, sizeof(*pevent));
 
@@ -6811,10 +6811,10 @@ void pevent_free_format(struct event_format *event)
 }
 
 /**
- * pevent_free - free a pevent handle
+ * tep_free - free a pevent handle
  * @pevent: the pevent handle to free
  */
-void pevent_free(struct tep_handle *pevent)
+void tep_free(struct tep_handle *pevent)
 {
 	struct cmdline_list *cmdlist, *cmdnext;
 	struct func_list *funclist, *funcnext;
@@ -6901,5 +6901,5 @@ void pevent_free(struct tep_handle *pevent)
 
 void pevent_unref(struct tep_handle *pevent)
 {
-	pevent_free(pevent);
+	tep_free(pevent);
 }
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index b4b698c3833e..c229240666b7 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -454,8 +454,8 @@ struct func_list;
 struct event_handler;
 struct func_resolver;
 
-typedef char *(pevent_func_resolver_t)(void *priv,
-				       unsigned long long *addrp, char **modp);
+typedef char *(tep_func_resolver_t)(void *priv,
+				    unsigned long long *addrp, char **modp);
 
 struct tep_handle {
 	int ref_count;
@@ -616,7 +616,7 @@ enum trace_flag_type {
 };
 
 int pevent_set_function_resolver(struct tep_handle *pevent,
-				 pevent_func_resolver_t *func, void *priv);
+				 tep_func_resolver_t *func, void *priv);
 void pevent_reset_function_resolver(struct tep_handle *pevent);
 int pevent_register_comm(struct tep_handle *pevent, const char *comm, int pid);
 int pevent_register_trace_clock(struct tep_handle *pevent, const char *trace_clock);
@@ -722,7 +722,7 @@ void pevent_print_field(struct trace_seq *s, void *data,
 			struct format_field *field);
 void pevent_print_fields(struct trace_seq *s, void *data,
 			 int size __maybe_unused, struct event_format *event);
-void pevent_event_info(struct trace_seq *s, struct event_format *event,
+void tep_event_info(struct trace_seq *s, struct event_format *event,
 		       struct tep_record *record);
 int pevent_strerror(struct tep_handle *pevent, enum pevent_errno errnum,
 		    char *buf, size_t buflen);
@@ -791,8 +791,8 @@ static inline void pevent_set_latency_format(struct tep_handle *pevent, int lat)
 	pevent->latency_format = lat;
 }
 
-struct tep_handle *pevent_alloc(void);
-void pevent_free(struct tep_handle *pevent);
+struct tep_handle *tep_alloc(void);
+void tep_free(struct tep_handle *pevent);
 void pevent_ref(struct tep_handle *pevent);
 void pevent_unref(struct tep_handle *pevent);
 
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index b23e861fa6ae..73c073ade71c 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -747,7 +747,7 @@ static int parse_gfp_flags(struct perf_evsel *evsel, struct perf_sample *sample,
 	}
 
 	trace_seq_init(&seq);
-	pevent_event_info(&seq, evsel->tp_format, &record);
+	tep_event_info(&seq, evsel->tp_format, &record);
 
 	str = strtok_r(seq.buffer, " ", &pos);
 	while (str) {
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 2c9924ab872d..08cdaf2be1af 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -613,7 +613,7 @@ static char *get_trace_output(struct hist_entry *he)
 		pevent_print_fields(&seq, he->raw_data, he->raw_size,
 				    evsel->tp_format);
 	} else {
-		pevent_event_info(&seq, evsel->tp_format, &rec);
+		tep_event_info(&seq, evsel->tp_format, &rec);
 	}
 	/*
 	 * Trim the buffer, it starts at 4KB and we're not going to
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 29af1fb0b888..630d0e81fe87 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -125,7 +125,7 @@ void event_format__fprintf(struct event_format *event,
 	record.data = data;
 
 	trace_seq_init(&s);
-	pevent_event_info(&s, event, &record);
+	tep_event_info(&s, event, &record);
 	trace_seq_do_fprintf(&s, fp);
 	trace_seq_destroy(&s);
 }
diff --git a/tools/perf/util/trace-event.c b/tools/perf/util/trace-event.c
index 7c0cd9a0f575..11066ed43ca4 100644
--- a/tools/perf/util/trace-event.c
+++ b/tools/perf/util/trace-event.c
@@ -28,7 +28,7 @@ static bool tevent_initialized;
 
 int trace_event__init(struct trace_event *t)
 {
-	struct tep_handle *pevent = pevent_alloc();
+	struct tep_handle *pevent = tep_alloc();
 
 	if (pevent) {
 		t->plugin_list = traceevent_load_plugins(pevent);
@@ -55,7 +55,7 @@ static int trace_event__init2(void)
 }
 
 int trace_event__register_resolver(struct machine *machine,
-				   pevent_func_resolver_t *func)
+				   tep_func_resolver_t *func)
 {
 	if (!tevent_initialized && trace_event__init2())
 		return -1;
@@ -66,7 +66,7 @@ int trace_event__register_resolver(struct machine *machine,
 void trace_event__cleanup(struct trace_event *t)
 {
 	traceevent_unload_plugins(t->plugin_list, t->pevent);
-	pevent_free(t->pevent);
+	tep_free(t->pevent);
 }
 
 /*
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index b8f2516e9a65..40204ec3a7a2 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -20,7 +20,7 @@ struct trace_event {
 int trace_event__init(struct trace_event *t);
 void trace_event__cleanup(struct trace_event *t);
 int trace_event__register_resolver(struct machine *machine,
-				   pevent_func_resolver_t *func);
+				   tep_func_resolver_t *func);
 struct event_format*
 trace_event__tp_format(const char *sys, const char *name);
 
-- 
2.14.4


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

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-15 15:05 [GIT PULL 00/35] perf/core improvements and fixes Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 01/35] perf probe powerpc: Fix trace event post-processing Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 02/35] tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 03/35] tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record' Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 04/35] tools lib traceevent, perf tools: Rename pevent plugin related APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` Arnaldo Carvalho de Melo [this message]
2018-08-15 15:05 ` [PATCH 06/35] tools lib traceevent, perf tools: Rename pevent find APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 07/35] tools lib traceevent, perf tools: Rename pevent parse APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 08/35] tools lib traceevent, perf tools: Rename pevent print APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 09/35] tools lib traceevent, perf tools: Rename pevent_read_number_* APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 10/35] tools lib traceevent, perf tools: Rename pevent_register_* APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 11/35] tools lib traceevent, perf tools: Rename pevent_set_* APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 12/35] tools lib traceevent, perf tools: Rename traceevent_* APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 13/35] tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag' Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 14/35] tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno' Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 15/35] tools lib traceevent: Rename pevent_function* APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 16/35] tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 17/35] tools lib traceevent: Rename pevent_filter* APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 18/35] tools lib traceevent: Rename pevent_register / unregister APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 19/35] tools lib traceevent: Rename pevent_data_ APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 20/35] tools lib traceevent: Rename pevent field APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 21/35] tools lib traceevent: Rename pevent_find_* APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 22/35] tools lib traceevent: Rename various pevent get/set/is APIs Arnaldo Carvalho de Melo
2018-08-15 15:05 ` [PATCH 23/35] tools lib traceevent: Rename internal parser related APIs Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 24/35] tools lib traceevent: Rename various pevent APIs Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 25/35] tools lib traceevent: Rename static variables and functions in event-parse.c Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 26/35] perf tools: Check for null when copying nsinfo Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 27/35] perf tools: Fix check-headers.sh AND list path of execution Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 28/35] perf tools: Make check-headers.sh check based on kernel dir Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 29/35] perf tools: Move syscall_64.tbl check into check-headers.sh Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 30/35] perf arm spe: Fix uninitialized record error variable Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 31/35] perf python: Remove -mcet and -fcf-protection when building with clang Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 32/35] perf auxtrace: Fix queue resize Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 33/35] kallsyms: Simplify update_iter_mod() Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 34/35] kallsyms, x86: Export addresses of PTI entry trampolines Arnaldo Carvalho de Melo
2018-08-15 15:06 ` [PATCH 35/35] x86: Add entry trampolines to kcore Arnaldo Carvalho de Melo
2018-08-15 15:21 ` [GIT PULL 00/35] perf/core improvements and fixes Andy Lutomirski
2018-08-18 11:17 ` Ingo Molnar

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=20180815150611.32080-6-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tz.stoyanov@gmail.com \
    --cc=williams@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).