All of lore.kernel.org
 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 23/35] tools lib traceevent: Rename internal parser related APIs
Date: Wed, 15 Aug 2018 12:05:59 -0300	[thread overview]
Message-ID: <20180815150611.32080-24-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_buffer_init, pevent_read_token, pevent_free_token,
pevent_peek_char, pevent_get_input_buf, pevent_get_input_buf_ptr

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/20180808180703.275281085@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/lib/traceevent/parse-filter.c | 16 ++++++++--------
 3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index d367f7f2f2fc..8215e6ff36eb 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -73,12 +73,12 @@ static void init_input_buf(const char *buf, unsigned long long size)
 	input_buf_ptr = 0;
 }
 
-const char *pevent_get_input_buf(void)
+const char *tep_get_input_buf(void)
 {
 	return input_buf;
 }
 
-unsigned long long pevent_get_input_buf_ptr(void)
+unsigned long long tep_get_input_buf_ptr(void)
 {
 	return input_buf_ptr;
 }
@@ -113,14 +113,14 @@ process_defined_func(struct trace_seq *s, void *data, int size,
 static void free_func_handle(struct tep_function_handler *func);
 
 /**
- * pevent_buffer_init - init buffer for parsing
+ * tep_buffer_init - init buffer for parsing
  * @buf: buffer to parse
  * @size: the size of the buffer
  *
- * For use with pevent_read_token(), this initializes the internal
- * buffer that pevent_read_token() will parse.
+ * For use with tep_read_token(), this initializes the internal
+ * buffer that tep_read_token() will parse.
  */
-void pevent_buffer_init(const char *buf, unsigned long long size)
+void tep_buffer_init(const char *buf, unsigned long long size)
 {
 	init_input_buf(buf, size);
 }
@@ -913,11 +913,11 @@ static int __peek_char(void)
 }
 
 /**
- * pevent_peek_char - peek at the next character that will be read
+ * tep_peek_char - peek at the next character that will be read
  *
  * Returns the next character read, or -1 if end of buffer.
  */
-int pevent_peek_char(void)
+int tep_peek_char(void)
 {
 	return __peek_char();
 }
@@ -1157,7 +1157,7 @@ static enum event_type read_token(char **tok)
 }
 
 /**
- * pevent_read_token - access to utilites to use the pevent parser
+ * tep_read_token - access to utilites to use the pevent parser
  * @tok: The token to return
  *
  * This will parse tokens from the string given by
@@ -1165,16 +1165,16 @@ static enum event_type read_token(char **tok)
  *
  * Returns the token type.
  */
-enum event_type pevent_read_token(char **tok)
+enum event_type tep_read_token(char **tok)
 {
 	return read_token(tok);
 }
 
 /**
- * pevent_free_token - free a token returned by pevent_read_token
+ * tep_free_token - free a token returned by tep_read_token
  * @token: the token to free
  */
-void pevent_free_token(char *token)
+void tep_free_token(char *token)
 {
 	free_token(token);
 }
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 7f8921431cf1..c41547353b4c 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -797,12 +797,12 @@ void pevent_ref(struct tep_handle *pevent);
 void pevent_unref(struct tep_handle *pevent);
 
 /* access to the internal parser */
-void pevent_buffer_init(const char *buf, unsigned long long size);
-enum event_type pevent_read_token(char **tok);
-void pevent_free_token(char *token);
-int pevent_peek_char(void);
-const char *pevent_get_input_buf(void);
-unsigned long long pevent_get_input_buf_ptr(void);
+void tep_buffer_init(const char *buf, unsigned long long size);
+enum event_type tep_read_token(char **tok);
+void tep_free_token(char *token);
+int tep_peek_char(void);
+const char *tep_get_input_buf(void);
+unsigned long long tep_get_input_buf_ptr(void);
 
 /* for debugging */
 void tep_print_funcs(struct tep_handle *pevent);
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index 3efab9b4298f..5e3f29736a25 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -51,8 +51,8 @@ static void show_error(char *error_buf, const char *fmt, ...)
 	int len;
 	int i;
 
-	input = pevent_get_input_buf();
-	index = pevent_get_input_buf_ptr();
+	input = tep_get_input_buf();
+	index = tep_get_input_buf_ptr();
 	len = input ? strlen(input) : 0;
 
 	if (len) {
@@ -72,7 +72,7 @@ static void show_error(char *error_buf, const char *fmt, ...)
 
 static void free_token(char *token)
 {
-	pevent_free_token(token);
+	tep_free_token(token);
 }
 
 static enum event_type read_token(char **tok)
@@ -82,13 +82,13 @@ static enum event_type read_token(char **tok)
 
 	do {
 		free_token(token);
-		type = pevent_read_token(&token);
+		type = tep_read_token(&token);
 	} while (type == EVENT_NEWLINE || type == EVENT_SPACE);
 
 	/* If token is = or ! check to see if the next char is ~ */
 	if (token &&
 	    (strcmp(token, "=") == 0 || strcmp(token, "!") == 0) &&
-	    pevent_peek_char() == '~') {
+	    tep_peek_char() == '~') {
 		/* append it */
 		*tok = malloc(3);
 		if (*tok == NULL) {
@@ -98,7 +98,7 @@ static enum event_type read_token(char **tok)
 		sprintf(*tok, "%c%c", *token, '~');
 		free_token(token);
 		/* Now remove the '~' from the buffer */
-		pevent_read_token(&token);
+		tep_read_token(&token);
 		free_token(token);
 	} else
 		*tok = token;
@@ -1198,7 +1198,7 @@ process_event(struct event_format *event, const char *filter_str,
 {
 	int ret;
 
-	pevent_buffer_init(filter_str, strlen(filter_str));
+	tep_buffer_init(filter_str, strlen(filter_str));
 
 	ret = process_filter(event, parg, error_str, 0);
 	if (ret < 0)
@@ -1254,7 +1254,7 @@ filter_event(struct event_filter *filter, struct event_format *event,
 static void filter_init_error_buf(struct event_filter *filter)
 {
 	/* clear buffer to reset show error */
-	pevent_buffer_init("", 0);
+	tep_buffer_init("", 0);
 	filter->error_buffer[0] = '\0';
 }
 
-- 
2.14.4


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

Thread overview: 41+ 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 ` 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 ` [PATCH 05/35] tools lib traceevent, perf tools: Rename pevent alloc / free APIs Arnaldo Carvalho de Melo
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 ` Arnaldo Carvalho de Melo [this message]
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-15 15:21   ` Andy Lutomirski
2018-08-18 11:17 ` Ingo Molnar
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-24-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 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.