linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Ideals for tep plugin options
Date: Mon, 6 Jan 2020 11:30:26 -0500	[thread overview]
Message-ID: <20200106113026.75893f92@gandalf.local.home> (raw)

Hi Tzvetomir,

I was looking at the plugin options, and I believe it needs to be
updated.

1) the tep_plugin_option structure:

  - rename "file" to "plugin"
  - remove "plugin_alias"

2) Currently we have the following plugin option functions exported in
trace-cmd:

 char **tep_plugin_list_options(void);
 void tep_plugin_free_options_list(char **list);
 int tep_plugin_add_options(const char *name,
			   struct tep_plugin_option *options);
 int tep_plugin_add_option(const char *name, const char *val);
 void tep_plugin_remove_options(struct tep_plugin_option *options);
 void tep_plugin_print_options(struct trace_seq *s);
 void tep_print_plugins(struct trace_seq *s,
			const char *prefix, const char *suffix,
			const struct tep_plugin_list *list);

What we should only have is:

 int tep_plugin_add_options(const char *plugin,
			  struct tep_plugin_option *options);
 int tep_plugin_set_option(const char *plugin, const char *name,
			  const char *val);
 int tep_plugin_remove_options(struct tep_plugin_option *options);
 struct tep_plugin_option const * const tep_plugin_options_list(void);


Where:

  tep_plugin_add_options() is basically the same as we have now. But we
    should change it so that if "plugin" is already registered, it
    should fail with -EBUSY.

 tep_plugin_set_option() lets us update the option. If "plugin" is
   NULL, then it will ignore that value, and will set all options with
   "name" to "val", regardless of what plugin it belongs to.

 tep_plugin_remove_options() is basically the same as what we have now,
   and removes the options from the list.

 tep_plugin_options_list() returns an immutable list of all the
   registered plugin options. This is the list that the application can
   use to see what options are registered, as well as their default
   (and current) values.

Does this make sense?

-- Steve

             reply	other threads:[~2020-01-06 16:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-06 16:30 Steven Rostedt [this message]
2020-01-09 13:21 ` Ideals for tep plugin options Tzvetomir (Ceco) Stoyanov

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=20200106113026.75893f92@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=tstoyanov@vmware.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).