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 04/24] tools lib traceevent, perf tools: Rename pevent alloc / free APIs
Date: Tue, 21 Aug 2018 16:33:08 +0300 [thread overview]
Message-ID: <20180821133328.3249-5-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_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>
---
include/traceevent/event-parse.h | 12 ++++++------
kernel-shark-qt/src/libkshark.c | 2 +-
kernel-shark/trace-capture.c | 2 +-
kernel-shark/trace-plot-cpu.c | 2 +-
kernel-shark/trace-plot-task.c | 2 +-
kernel-shark/trace-view-store.c | 2 +-
lib/trace-cmd/trace-input.c | 4 ++--
lib/trace-cmd/trace-util.c | 4 ++--
lib/traceevent/event-parse.c | 24 ++++++++++++------------
tracecmd/trace-check-events.c | 4 ++--
tracecmd/trace-list.c | 8 ++++----
tracecmd/trace-record.c | 4 ++--
12 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index ada1efa..a4a2bc9 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -440,8 +440,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;
@@ -604,7 +604,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);
@@ -710,7 +710,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);
@@ -779,8 +779,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/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c
index 230ba77..bb23afe 100644
--- a/kernel-shark-qt/src/libkshark.c
+++ b/kernel-shark-qt/src/libkshark.c
@@ -855,7 +855,7 @@ static const char *kshark_get_info(struct tep_handle *pe,
return NULL;
trace_seq_reset(&seq);
- pevent_event_info(&seq, event, record);
+ tep_event_info(&seq, event, record);
/*
* The event info string contains a trailing newline.
diff --git a/kernel-shark/trace-capture.c b/kernel-shark/trace-capture.c
index 19df28a..d80a5c2 100644
--- a/kernel-shark/trace-capture.c
+++ b/kernel-shark/trace-capture.c
@@ -1561,7 +1561,7 @@ static void tracing_dialog(struct shark_info *info, const char *tracing)
gtk_widget_destroy(dialog);
if (pevent)
- pevent_free(pevent);
+ tep_free(pevent);
if (plugins)
tracecmd_free_list(plugins);
diff --git a/kernel-shark/trace-plot-cpu.c b/kernel-shark/trace-plot-cpu.c
index dc161a4..39b96f7 100644
--- a/kernel-shark/trace-plot-cpu.c
+++ b/kernel-shark/trace-plot-cpu.c
@@ -406,7 +406,7 @@ int cpu_plot_display_info(struct graph_info *ginfo,
trace_seq_putc(s, '\n');
pevent_data_lat_fmt(pevent, s, record);
trace_seq_putc(s, '\n');
- pevent_event_info(s, event, record);
+ tep_event_info(s, event, record);
trace_seq_putc(s, '\n');
} else
trace_seq_printf(s, "UNKNOW EVENT %d\n", type);
diff --git a/kernel-shark/trace-plot-task.c b/kernel-shark/trace-plot-task.c
index 4dedd8a..11930ed 100644
--- a/kernel-shark/trace-plot-task.c
+++ b/kernel-shark/trace-plot-task.c
@@ -766,7 +766,7 @@ int task_plot_display_info(struct graph_info *ginfo,
trace_seq_putc(s, '\n');
pevent_data_lat_fmt(pevent, s, record);
trace_seq_putc(s, '\n');
- pevent_event_info(s, event, record);
+ tep_event_info(s, event, record);
trace_seq_putc(s, '\n');
} else
trace_seq_printf(s, "UNKNOW EVENT %d\n", type);
diff --git a/kernel-shark/trace-view-store.c b/kernel-shark/trace-view-store.c
index 2e2a125..3f0bbf1 100644
--- a/kernel-shark/trace-view-store.c
+++ b/kernel-shark/trace-view-store.c
@@ -499,7 +499,7 @@ trace_view_store_get_value (GtkTreeModel *tree_model,
}
trace_seq_init(&s);
- pevent_event_info(&s, event, data);
+ tep_event_info(&s, event, data);
g_value_set_string(value, s.buffer);
trace_seq_destroy(&s);
break;
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 7354bbf..ad6fc90 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -2635,7 +2635,7 @@ struct tracecmd_input *tracecmd_alloc_fd(int fd)
if (do_read_check(handle, buf, 1))
goto failed_read;
- handle->pevent = pevent_alloc();
+ handle->pevent = tep_alloc();
if (!handle->pevent)
goto failed_read;
@@ -2804,7 +2804,7 @@ void tracecmd_close(struct tracecmd_input *handle)
else {
/* Only main handle frees plugins and pevent */
tracecmd_unload_plugins(handle->plugin_list, handle->pevent);
- pevent_free(handle->pevent);
+ tep_free(handle->pevent);
}
free(handle);
}
diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index 4a66457..2058dc3 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -1130,12 +1130,12 @@ struct tep_handle *tracecmd_local_events(const char *tracing_dir)
{
struct tep_handle *pevent = NULL;
- pevent = pevent_alloc();
+ pevent = tep_alloc();
if (!pevent)
return NULL;
if (tracecmd_fill_local_events(tracing_dir, pevent)) {
- pevent_free(pevent);
+ tep_free(pevent);
pevent = NULL;
}
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index f00a02b..f67af97 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -424,9 +424,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;
};
/**
@@ -440,7 +440,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));
@@ -5385,8 +5385,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;
@@ -5542,7 +5542,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,
@@ -6740,9 +6740,9 @@ not_found:
}
/**
- * 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));
@@ -6797,10 +6797,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;
@@ -6887,5 +6887,5 @@ void pevent_free(struct tep_handle *pevent)
void pevent_unref(struct tep_handle *pevent)
{
- pevent_free(pevent);
+ tep_free(pevent);
}
diff --git a/tracecmd/trace-check-events.c b/tracecmd/trace-check-events.c
index a8e7711..63c9918 100644
--- a/tracecmd/trace-check-events.c
+++ b/tracecmd/trace-check-events.c
@@ -38,7 +38,7 @@ void trace_check_events(int argc, char **argv)
exit(EINVAL);
}
- pevent = pevent_alloc();
+ pevent = tep_alloc();
if (!pevent)
exit(EINVAL);
list = tracecmd_load_plugins(pevent);
@@ -46,7 +46,7 @@ void trace_check_events(int argc, char **argv)
if (ret || pevent->parsing_failures)
ret = EINVAL;
tracecmd_unload_plugins(list, pevent);
- pevent_free(pevent);
+ tep_free(pevent);
return;
}
diff --git a/tracecmd/trace-list.c b/tracecmd/trace-list.c
index 1368dae..1eae38b 100644
--- a/tracecmd/trace-list.c
+++ b/tracecmd/trace-list.c
@@ -313,7 +313,7 @@ static void show_plugin_options(void)
tracecmd_ftrace_load_options();
- pevent = pevent_alloc();
+ pevent = tep_alloc();
if (!pevent)
die("Can not allocate pevent\n");
@@ -323,7 +323,7 @@ static void show_plugin_options(void)
trace_util_print_plugin_options(&s);
trace_seq_do_printf(&s);
tracecmd_unload_plugins(list, pevent);
- pevent_free(pevent);
+ tep_free(pevent);
}
@@ -339,7 +339,7 @@ static void show_plugins(void)
struct plugin_list *list;
struct trace_seq s;
- pevent = pevent_alloc();
+ pevent = tep_alloc();
if (!pevent)
die("Can not allocate pevent\n");
@@ -349,7 +349,7 @@ static void show_plugins(void)
trace_util_print_plugins(&s, " ", "\n", list);
trace_seq_do_printf(&s);
tracecmd_unload_plugins(list, pevent);
- pevent_free(pevent);
+ tep_free(pevent);
}
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 45e5feb..8fb923e 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3497,7 +3497,7 @@ static char *get_date_to_ts(void)
int i;
/* Set up a pevent to read the raw format */
- pevent = pevent_alloc();
+ pevent = tep_alloc();
if (!pevent) {
warning("failed to alloc pevent, --date ignored");
return NULL;
@@ -3578,7 +3578,7 @@ static char *get_date_to_ts(void)
snprintf(date2ts, 19, "0x%llx", min_stamp - min_ts / 1000);
out_pevent:
- pevent_free(pevent);
+ tep_free(pevent);
return date2ts;
}
--
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 ` Tzvetomir Stoyanov (VMware) [this message]
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 ` [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-5-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).