From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 2/7] trace-cmd,libtraceevent: Remove TEP_PLUGIN_OPTIONS
Date: Wed, 22 Jan 2020 16:59:57 +0200 [thread overview]
Message-ID: <20200122150002.763233-3-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20200122150002.763233-1-tz.stoyanov@gmail.com>
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(-)
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",
--
2.24.1
next prev parent reply other threads:[~2020-01-22 15:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-22 14:59 [PATCH 0/7] trace-cmd,libtraceevent: Rework of plugin options APIs Tzvetomir Stoyanov (VMware)
2020-01-22 14:59 ` [PATCH 1/7] trace-cmd,libtraceevent: Plugin options rework Tzvetomir Stoyanov (VMware)
2020-01-22 14:59 ` Tzvetomir Stoyanov (VMware) [this message]
2020-01-22 14:59 ` [PATCH 3/7] trace-cmd,libtraceevent: Check for plugin options duplication Tzvetomir Stoyanov (VMware)
2020-01-22 14:59 ` [PATCH 4/7] trace-cmd,libtraceevent: Check for plugin duplication Tzvetomir Stoyanov (VMware)
2020-01-22 15:00 ` [PATCH 5/7] trace-cmd,libtraceevent: Remove API for plugin options print Tzvetomir Stoyanov (VMware)
2020-01-22 15:00 ` [PATCH 6/7] trace-cmd,libtraceevent: Remove API for plugin print Tzvetomir Stoyanov (VMware)
2020-01-22 15:00 ` [PATCH 7/7] trace-cmd, kernelshark, libtraceevent: Changed tep_plugin_add_option() API Tzvetomir Stoyanov (VMware)
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=20200122150002.763233-3-tz.stoyanov@gmail.com \
--to=tz.stoyanov@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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).