aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>2018-08-08 14:03:00 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-08-13 14:25:36 -0400
commitca2921dd90268dc37cd5096eb985da4288aa7041 (patch)
tree8e24ca63c8d8d83c548ba2df262c7ad43c3432d5
parent3cf477836e24187f2f3acbbf48c80a478d979093 (diff)
tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs
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 "traceevent_". This changes APIs: traceevent_plugin_list_options, traceevent_plugin_free_options_list, traceevent_plugin_add_options, traceevent_plugin_remove_options, traceevent_print_plugins 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/20180808180702.089951638@goodmis.org Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/lib/traceevent/event-parse.h16
-rw-r--r--tools/lib/traceevent/event-plugin.c28
-rw-r--r--tools/lib/traceevent/plugin_function.c4
3 files changed, 24 insertions, 24 deletions
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 81f34132fc47..ec327849a7dc 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -438,14 +438,14 @@ struct plugin_list;
438struct plugin_list *tep_load_plugins(struct tep_handle *pevent); 438struct plugin_list *tep_load_plugins(struct tep_handle *pevent);
439void tep_unload_plugins(struct plugin_list *plugin_list, 439void tep_unload_plugins(struct plugin_list *plugin_list,
440 struct tep_handle *pevent); 440 struct tep_handle *pevent);
441char **traceevent_plugin_list_options(void); 441char **tep_plugin_list_options(void);
442void traceevent_plugin_free_options_list(char **list); 442void tep_plugin_free_options_list(char **list);
443int traceevent_plugin_add_options(const char *name, 443int tep_plugin_add_options(const char *name,
444 struct tep_plugin_option *options); 444 struct tep_plugin_option *options);
445void traceevent_plugin_remove_options(struct tep_plugin_option *options); 445void tep_plugin_remove_options(struct tep_plugin_option *options);
446void traceevent_print_plugins(struct trace_seq *s, 446void tep_print_plugins(struct trace_seq *s,
447 const char *prefix, const char *suffix, 447 const char *prefix, const char *suffix,
448 const struct plugin_list *list); 448 const struct plugin_list *list);
449 449
450struct cmdline; 450struct cmdline;
451struct cmdline_list; 451struct cmdline_list;
diff --git a/tools/lib/traceevent/event-plugin.c b/tools/lib/traceevent/event-plugin.c
index c837a73c03e6..8e324ed46547 100644
--- a/tools/lib/traceevent/event-plugin.c
+++ b/tools/lib/traceevent/event-plugin.c
@@ -97,7 +97,7 @@ static int update_option_value(struct tep_plugin_option *op, const char *val)
97} 97}
98 98
99/** 99/**
100 * traceevent_plugin_list_options - get list of plugin options 100 * tep_plugin_list_options - get list of plugin options
101 * 101 *
102 * Returns an array of char strings that list the currently registered 102 * Returns an array of char strings that list the currently registered
103 * plugin options in the format of <plugin>:<option>. This list can be 103 * plugin options in the format of <plugin>:<option>. This list can be
@@ -106,9 +106,9 @@ static int update_option_value(struct tep_plugin_option *op, const char *val)
106 * Returns NULL if there's no options registered. On error it returns 106 * Returns NULL if there's no options registered. On error it returns
107 * INVALID_PLUGIN_LIST_OPTION 107 * INVALID_PLUGIN_LIST_OPTION
108 * 108 *
109 * Must be freed with traceevent_plugin_free_options_list(). 109 * Must be freed with tep_plugin_free_options_list().
110 */ 110 */
111char **traceevent_plugin_list_options(void) 111char **tep_plugin_list_options(void)
112{ 112{
113 struct registered_plugin_options *reg; 113 struct registered_plugin_options *reg;
114 struct tep_plugin_option *op; 114 struct tep_plugin_option *op;
@@ -146,7 +146,7 @@ char **traceevent_plugin_list_options(void)
146 return INVALID_PLUGIN_LIST_OPTION; 146 return INVALID_PLUGIN_LIST_OPTION;
147} 147}
148 148
149void traceevent_plugin_free_options_list(char **list) 149void tep_plugin_free_options_list(char **list)
150{ 150{
151 int i; 151 int i;
152 152
@@ -215,14 +215,14 @@ update_option(const char *file, struct tep_plugin_option *option)
215} 215}
216 216
217/** 217/**
218 * traceevent_plugin_add_options - Add a set of options by a plugin 218 * tep_plugin_add_options - Add a set of options by a plugin
219 * @name: The name of the plugin adding the options 219 * @name: The name of the plugin adding the options
220 * @options: The set of options being loaded 220 * @options: The set of options being loaded
221 * 221 *
222 * Sets the options with the values that have been added by user. 222 * Sets the options with the values that have been added by user.
223 */ 223 */
224int traceevent_plugin_add_options(const char *name, 224int tep_plugin_add_options(const char *name,
225 struct tep_plugin_option *options) 225 struct tep_plugin_option *options)
226{ 226{
227 struct registered_plugin_options *reg; 227 struct registered_plugin_options *reg;
228 228
@@ -241,10 +241,10 @@ int traceevent_plugin_add_options(const char *name,
241} 241}
242 242
243/** 243/**
244 * traceevent_plugin_remove_options - remove plugin options that were registered 244 * tep_plugin_remove_options - remove plugin options that were registered
245 * @options: Options to removed that were registered with traceevent_plugin_add_options 245 * @options: Options to removed that were registered with tep_plugin_add_options
246 */ 246 */
247void traceevent_plugin_remove_options(struct tep_plugin_option *options) 247void tep_plugin_remove_options(struct tep_plugin_option *options)
248{ 248{
249 struct registered_plugin_options **last; 249 struct registered_plugin_options **last;
250 struct registered_plugin_options *reg; 250 struct registered_plugin_options *reg;
@@ -260,7 +260,7 @@ void traceevent_plugin_remove_options(struct tep_plugin_option *options)
260} 260}
261 261
262/** 262/**
263 * traceevent_print_plugins - print out the list of plugins loaded 263 * tep_print_plugins - print out the list of plugins loaded
264 * @s: the trace_seq descripter to write to 264 * @s: the trace_seq descripter to write to
265 * @prefix: The prefix string to add before listing the option name 265 * @prefix: The prefix string to add before listing the option name
266 * @suffix: The suffix string ot append after the option name 266 * @suffix: The suffix string ot append after the option name
@@ -270,9 +270,9 @@ void traceevent_plugin_remove_options(struct tep_plugin_option *options)
270 * returned by tep_load_plugins(). Use @prefix and @suffix for formating: 270 * returned by tep_load_plugins(). Use @prefix and @suffix for formating:
271 * @prefix = " ", @suffix = "\n". 271 * @prefix = " ", @suffix = "\n".
272 */ 272 */
273void traceevent_print_plugins(struct trace_seq *s, 273void tep_print_plugins(struct trace_seq *s,
274 const char *prefix, const char *suffix, 274 const char *prefix, const char *suffix,
275 const struct plugin_list *list) 275 const struct plugin_list *list)
276{ 276{
277 while (list) { 277 while (list) {
278 trace_seq_printf(s, "%s%s%s", prefix, list->name, suffix); 278 trace_seq_printf(s, "%s%s%s", prefix, list->name, suffix);
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c
index 342be570ee8c..57165da1bd51 100644
--- a/tools/lib/traceevent/plugin_function.c
+++ b/tools/lib/traceevent/plugin_function.c
@@ -168,7 +168,7 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
168 pevent_register_event_handler(pevent, -1, "ftrace", "function", 168 pevent_register_event_handler(pevent, -1, "ftrace", "function",
169 function_handler, NULL); 169 function_handler, NULL);
170 170
171 traceevent_plugin_add_options("ftrace", plugin_options); 171 tep_plugin_add_options("ftrace", plugin_options);
172 172
173 return 0; 173 return 0;
174} 174}
@@ -186,7 +186,7 @@ void TEP_PLUGIN_UNLOADER(struct tep_handle *pevent)
186 free(fstack[i].stack); 186 free(fstack[i].stack);
187 } 187 }
188 188
189 traceevent_plugin_remove_options(plugin_options); 189 tep_plugin_remove_options(plugin_options);
190 190
191 free(fstack); 191 free(fstack);
192 fstack = NULL; 192 fstack = NULL;