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 06/24] tools lib traceevent, perf tools: Rename pevent parse APIs
Date: Tue, 21 Aug 2018 16:33:10 +0300 [thread overview]
Message-ID: <20180821133328.3249-7-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_parse_event, pevent_parse_format, pevent_parse_header_page
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.469749700@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 | 18 +++++++++---------
lib/trace-cmd/trace-blk-hack.c | 2 +-
lib/trace-cmd/trace-input.c | 6 +++---
lib/trace-cmd/trace-util.c | 4 ++--
lib/traceevent/event-parse.c | 22 +++++++++++-----------
tracecmd/trace-record.c | 4 ++--
6 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index db910b5..93b040e 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -627,15 +627,15 @@ void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
void pevent_print_event(struct tep_handle *pevent, struct trace_seq *s,
struct tep_record *record, bool use_trace_clock);
-int pevent_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long size,
- int long_size);
-
-enum pevent_errno pevent_parse_event(struct tep_handle *pevent, const char *buf,
- unsigned long size, const char *sys);
-enum pevent_errno pevent_parse_format(struct tep_handle *pevent,
- struct event_format **eventp,
- const char *buf,
- unsigned long size, const char *sys);
+int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long size,
+ int long_size);
+
+enum pevent_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
+ unsigned long size, const char *sys);
+enum pevent_errno tep_parse_format(struct tep_handle *pevent,
+ struct event_format **eventp,
+ const char *buf,
+ unsigned long size, const char *sys);
void pevent_free_format(struct event_format *event);
void pevent_free_format_field(struct format_field *field);
diff --git a/lib/trace-cmd/trace-blk-hack.c b/lib/trace-cmd/trace-blk-hack.c
index 9dec648..2883c68 100644
--- a/lib/trace-cmd/trace-blk-hack.c
+++ b/lib/trace-cmd/trace-blk-hack.c
@@ -139,7 +139,7 @@ int tracecmd_blk_hack(struct tracecmd_input *handle)
/* Parse this event */
l += r;
- pevent_parse_event(pevent, buf, l, "ftrace");
+ tep_parse_event(pevent, buf, l, "ftrace");
return 0;
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index ad6fc90..ef55177 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -333,7 +333,7 @@ static int read_header_files(struct tracecmd_input *handle)
if (do_read_check(handle, header, size))
goto failed_read;
- pevent_parse_header_page(pevent, header, size, handle->long_size);
+ tep_parse_header_page(pevent, header, size, handle->long_size);
free(header);
/*
@@ -421,7 +421,7 @@ static int read_ftrace_file(struct tracecmd_input *handle,
if (print || regex_event_buf(buf, size, epreg))
printf("%.*s\n", (int)size, buf);
} else {
- if (pevent_parse_event(pevent, buf, size, "ftrace"))
+ if (tep_parse_event(pevent, buf, size, "ftrace"))
pevent->parsing_failures = 1;
}
free(buf);
@@ -455,7 +455,7 @@ static int read_event_file(struct tracecmd_input *handle,
printf("%.*s\n", (int)size, buf);
}
} else {
- if (pevent_parse_event(pevent, buf, size, system))
+ if (tep_parse_event(pevent, buf, size, system))
pevent->parsing_failures = 1;
}
free(buf);
diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index 2058dc3..7d4a2a4 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -1077,7 +1077,7 @@ static int load_events(struct tep_handle *pevent, const char *system,
if (len < 0)
goto free_format;
- ret = pevent_parse_event(pevent, buf, len, system);
+ ret = tep_parse_event(pevent, buf, len, system);
free(buf);
free_format:
free(format);
@@ -1109,7 +1109,7 @@ static int read_header(struct tep_handle *pevent, const char *events_dir)
if (len < 0)
goto out;
- pevent_parse_header_page(pevent, buf, len, sizeof(long));
+ tep_parse_header_page(pevent, buf, len, sizeof(long));
free(buf);
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 9142f28..49689b2 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -5916,7 +5916,7 @@ static void parse_header_field(const char *field,
}
/**
- * pevent_parse_header_page - parse the data stored in the header page
+ * tep_parse_header_page - parse the data stored in the header page
* @pevent: the handle to the pevent
* @buf: the buffer storing the header page format string
* @size: the size of @buf
@@ -5927,8 +5927,8 @@ static void parse_header_field(const char *field,
*
* /sys/kernel/debug/tracing/events/header_page
*/
-int pevent_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long size,
- int long_size)
+int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long size,
+ int long_size)
{
int ignore;
@@ -6157,7 +6157,7 @@ event_add_failed:
}
/**
- * pevent_parse_format - parse the event format
+ * tep_parse_format - parse the event format
* @pevent: the handle to the pevent
* @eventp: returned format
* @buf: the buffer storing the event format string
@@ -6171,16 +6171,16 @@ event_add_failed:
*
* /sys/kernel/debug/tracing/events/.../.../format
*/
-enum pevent_errno pevent_parse_format(struct tep_handle *pevent,
- struct event_format **eventp,
- const char *buf,
- unsigned long size, const char *sys)
+enum pevent_errno tep_parse_format(struct tep_handle *pevent,
+ struct event_format **eventp,
+ const char *buf,
+ unsigned long size, const char *sys)
{
return __pevent_parse_event(pevent, eventp, buf, size, sys);
}
/**
- * pevent_parse_event - parse the event format
+ * tep_parse_event - parse the event format
* @pevent: the handle to the pevent
* @buf: the buffer storing the event format string
* @size: the size of @buf
@@ -6193,8 +6193,8 @@ enum pevent_errno pevent_parse_format(struct tep_handle *pevent,
*
* /sys/kernel/debug/tracing/events/.../.../format
*/
-enum pevent_errno pevent_parse_event(struct tep_handle *pevent, const char *buf,
- unsigned long size, const char *sys)
+enum pevent_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
+ unsigned long size, const char *sys)
{
struct event_format *event = NULL;
return __pevent_parse_event(pevent, &event, buf, size, sys);
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 5e57f4a..6952492 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3506,7 +3506,7 @@ static char *get_date_to_ts(void)
buf = read_file("events/header_page", &size);
if (!buf)
goto out_pevent;
- ret = pevent_parse_header_page(pevent, buf, size, sizeof(unsigned long));
+ ret = tep_parse_header_page(pevent, buf, size, sizeof(unsigned long));
free(buf);
if (ret < 0) {
warning("Can't parse header page, --date ignored");
@@ -3517,7 +3517,7 @@ static char *get_date_to_ts(void)
buf = read_file("events/ftrace/print/format", &size);
if (!buf)
goto out_pevent;
- ret = pevent_parse_event(pevent, buf, size, "ftrace");
+ ret = tep_parse_event(pevent, buf, size, "ftrace");
free(buf);
if (ret < 0) {
warning("Can't parse print event, --date ignored");
--
2.17.1
next prev parent reply other threads:[~2018-08-21 16:53 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 ` Tzvetomir Stoyanov (VMware) [this message]
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 ` [PATCH 14/24] tools lib traceevent: Rename pevent_function* APIs Tzvetomir Stoyanov (VMware)
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-7-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 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).