[2/7] trace-cmd,libtraceevent: Remove TEP_PLUGIN_OPTIONS
diff mbox series

Message ID 20200122150002.763233-3-tz.stoyanov@gmail.com
State New
Headers show
Series
  • trace-cmd,libtraceevent: Rework of plugin options APIs
Related show

Commit Message

Tzvetomir Stoyanov (VMware) Jan. 22, 2020, 2:59 p.m. UTC
When loading a plugin, the current API searches for
TEP_PLUGIN_OPTIONS array in plugin's symbols and loads
any options from it. This API duplicates
 tep_plugin_add_options()
In order to simplify the APIs, The duplicated TEP_PLUGIN_OPTIONS
is removed as an API, as it is not used by any existing plugin.
The tep_plugin_add_options() API is the only way to register
plugin options.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 include/traceevent/event-parse.h | 20 --------------------
 lib/traceevent/event-plugin.c    | 11 -----------
 2 files changed, 31 deletions(-)

Patch
diff mbox series

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 72f7aaf..cb1b46e 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -77,33 +77,13 @@  struct tep_plugin_option {
  *
  *   int TEP_PLUGIN_UNLOADER(struct tep_handle *tep)
  *
- * TEP_PLUGIN_OPTIONS:  (optional)
- *   Plugin options that can be set before loading
- *
- *   struct tep_plugin_option TEP_PLUGIN_OPTIONS[] = {
- *	{
- *		.name = "option-name",
- *		.description = "description of option to show users",
- *	},
- *	{
- *		.name = NULL,
- *	},
- *   };
- *
- *   Array must end with .name = NULL;
- *
- *   If .value is not set, then it is considered a boolean and only
- *   .set will be processed. If .value is defined, then it is considered
- *   a string option and .set will be ignored.
  */
 #define TEP_PLUGIN_LOADER tep_plugin_loader
 #define TEP_PLUGIN_UNLOADER tep_plugin_unloader
-#define TEP_PLUGIN_OPTIONS tep_plugin_options
 #define _MAKE_STR(x)	#x
 #define MAKE_STR(x)	_MAKE_STR(x)
 #define TEP_PLUGIN_LOADER_NAME MAKE_STR(TEP_PLUGIN_LOADER)
 #define TEP_PLUGIN_UNLOADER_NAME MAKE_STR(TEP_PLUGIN_UNLOADER)
-#define TEP_PLUGIN_OPTIONS_NAME MAKE_STR(TEP_PLUGIN_OPTIONS)
 
 enum tep_format_flags {
 	TEP_FIELD_IS_ARRAY	= 1,
diff --git a/lib/traceevent/event-plugin.c b/lib/traceevent/event-plugin.c
index bbe87d4..8c48ccf 100644
--- a/lib/traceevent/event-plugin.c
+++ b/lib/traceevent/event-plugin.c
@@ -427,7 +427,6 @@  load_plugin(struct tep_handle *tep, const char *path,
 	    const char *file, void *data)
 {
 	struct tep_plugin_list **plugin_list = data;
-	struct tep_plugin_option *options;
 	tep_plugin_load_func func;
 	struct tep_plugin_list *list;
 	char *plugin;
@@ -447,16 +446,6 @@  load_plugin(struct tep_handle *tep, const char *path,
 		goto out_free;
 	}
 
-	options = dlsym(handle, TEP_PLUGIN_OPTIONS_NAME);
-	if (options) {
-		while (options->name) {
-			ret = update_option(file, options);
-			if (ret < 0)
-				goto out_free;
-			options++;
-		}
-	}
-
 	func = dlsym(handle, TEP_PLUGIN_LOADER_NAME);
 	if (!func) {
 		warning("could not find func '%s' in plugin '%s'\n%s\n",