diff mbox series

[v4,39/46] tools/lib/traceevent: Man pages for tep_load_plugins() and tep_unload_plugin()

Message ID 20190308133654.21264-40-tstoyanov@vmware.com (mailing list archive)
State Superseded
Headers show
Series Libtraceevent MAN pages | expand

Commit Message

Tzvetomir Stoyanov March 8, 2019, 1:36 p.m. UTC
Create man pages for tep_load_plugins() and tep_unload_plugin()
as part of the libtraceevent APIs.

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
---
 .../Documentation/libtraceevent-plugins.txt   | 98 +++++++++++++++++++
 1 file changed, 98 insertions(+)
 create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt

Comments

Steven Rostedt March 13, 2019, 8:27 p.m. UTC | #1
On Fri,  8 Mar 2019 15:36:47 +0200
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:

> Create man pages for tep_load_plugins() and tep_unload_plugin()
> as part of the libtraceevent APIs.
> 
> Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> ---
>  .../Documentation/libtraceevent-plugins.txt   | 98 +++++++++++++++++++
>  1 file changed, 98 insertions(+)
>  create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
> 
> diff --git a/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt b/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
> new file mode 100644
> index 000000000000..0f40d14944c0
> --- /dev/null
> +++ b/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
> @@ -0,0 +1,98 @@
> +libtraceevent(3)
> +================
> +
> +NAME
> +----
> +tep_load_plugins,tep_unload_plugins - Load  / unload traceevent plugins
> +
> +SYNOPSIS
> +--------
> +[verse]
> +--
> +*#include <event-parse.h>*
> +
> +struct tep_plugin_list pass:[*]*tep_load_plugins*(struct tep_handle pass:[*]_tep_);
> +void *tep_unload_plugins*(struct tep_plugin_list pass:[*]_plugin_list_, struct tep_handle pass:[*]_tep_);
> +--
> +
> +DESCRIPTION
> +-----------
> +The _tep_load_plugins()_ function loads all plugins, located in the plugin
> +directories. The _tep_ argument is trace event parser context.
> +The plugin directories are :
> +[verse]
> +--
> +	- System's plugin directory, defined at the library compile time. It
> +	  depends on the library installation prefix and usually is
> +	  _(install_preffix)/lib/traceevent/plugins_
> +	- Directory, defined by the environment variable _TRACEEVENT_PLUGIN_DIR_
> +	- User's plugin directory, located at _~/.traceevent/plugins_

We are going to need to modify this to be more compliant with today's
desktops.

Patrick, where's the place to put customized plugins that should
overwrite the system ones?

-- Steve

> +--
> +Loading of plugins can be controlled by the _tep_flags_, using the
> +_tep_set_flag()_ API:
> +[verse]
> +--
> +	_TEP_DISABLE_SYS_PLUGINS_	- do not load plugins, located in
> +					the system's plugin directory.
> +	_TEP_DISABLE_PLUGINS_		- do not load any plugins.
> +--
> +The _tep_set_flag()_ API must be called before _tep_load_plugins()_.
> +
> +The _tep_unload_plugins()_ function unloads the plugins, previously loaded by
> +_tep_load_plugins()_. The _tep_ argument is trace event parser context. The
> +_plugin_list_ is the list of loaded plugins, returned by the _tep_load_plugins()_
> +function.
> +
> +RETURN VALUE
> +------------
> +The _tep_load_plugins()_ function returns a list of successfully loaded plugins,
> +or NULL in case no plugins are loaded.
> +
> +EXAMPLE
> +-------
> +[source,c]
> +--
> +#include <event-parse.h>
> +...
> +struct tep_handle *tep = tep_alloc();
> +...
> +struct tep_plugin_list *plugins = tep_load_plugins(tep);
> +if (plugins == NULL) {
> +	/* no plugins are loaded */
> +}
> +...
> +tep_unload_plugins(plugins, tep);
> +--
> +
> +FILES
> +-----
> +[verse]
> +--
> +*event-parse.h*
> +	Header file to include in order to have access to the library APIs.
> +*-ltraceevent*
> +	Linker switch to add when building a program that uses the library.
> +--
> +
> +SEE ALSO
> +--------
> +_libtraceevent(3)_, _trace-cmd(1)_, _tep_set_flag(3)_
> +
> +AUTHOR
> +------
> +[verse]
> +--
> +*Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
> +*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
> +--
> +REPORTING BUGS
> +--------------
> +Report bugs to  <linux-trace-devel@vger.kernel.org>
> +
> +LICENSE
> +-------
> +libtraceevent is Free Software licensed under the GNU LGPL 2.1
> +
> +RESOURCES
> +---------
> +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Patrick McLean March 13, 2019, 9:42 p.m. UTC | #2
On Wed, 13 Mar 2019 16:27:56 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Fri,  8 Mar 2019 15:36:47 +0200
> Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:
> 
> > Create man pages for tep_load_plugins() and tep_unload_plugin()
> > as part of the libtraceevent APIs.
> > 
> > Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> > ---
> >  .../Documentation/libtraceevent-plugins.txt   | 98
> > +++++++++++++++++++ 1 file changed, 98 insertions(+)
> >  create mode 100644
> > tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
> > 
> > diff --git
> > a/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
> > b/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt new
> > file mode 100644 index 000000000000..0f40d14944c0 --- /dev/null
> > +++ b/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
> > @@ -0,0 +1,98 @@
> > +libtraceevent(3)
> > +================
> > +
> > +NAME
> > +----
> > +tep_load_plugins,tep_unload_plugins - Load  / unload traceevent
> > plugins +
> > +SYNOPSIS
> > +--------
> > +[verse]
> > +--
> > +*#include <event-parse.h>*
> > +
> > +struct tep_plugin_list pass:[*]*tep_load_plugins*(struct
> > tep_handle pass:[*]_tep_); +void *tep_unload_plugins*(struct
> > tep_plugin_list pass:[*]_plugin_list_, struct tep_handle
> > pass:[*]_tep_); +-- +
> > +DESCRIPTION
> > +-----------
> > +The _tep_load_plugins()_ function loads all plugins, located in
> > the plugin +directories. The _tep_ argument is trace event parser
> > context. +The plugin directories are :
> > +[verse]
> > +--
> > +	- System's plugin directory, defined at the library
> > compile time. It
> > +	  depends on the library installation prefix and usually is
> > +	  _(install_preffix)/lib/traceevent/plugins_
> > +	- Directory, defined by the environment variable
> > _TRACEEVENT_PLUGIN_DIR_
> > +	- User's plugin directory, located at
> > _~/.traceevent/plugins_  
> 
> We are going to need to modify this to be more compliant with today's
> desktops.
> 
> Patrick, where's the place to put customized plugins that should
> overwrite the system ones?
> 

That sort of depends, if they are textual and could be considered
configs, then .config is where they should go, otherwise
${HOME}/.local/share/traceevent or ${HOME}/.local/lib/traceevent,
binaries should go under the lib, arch agnostic stuff should go under
share.
Patrick McLean March 13, 2019, 9:45 p.m. UTC | #3
On Wed, 13 Mar 2019 14:42:06 -0700
Patrick McLean <chutzpah@gentoo.org> wrote:

> On Wed, 13 Mar 2019 16:27:56 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > On Fri,  8 Mar 2019 15:36:47 +0200
> > Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:
> >   
> > > Create man pages for tep_load_plugins() and tep_unload_plugin()
> > > as part of the libtraceevent APIs.
> > > 
> > > Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> > > ---
> > >  .../Documentation/libtraceevent-plugins.txt   | 98
> > > +++++++++++++++++++ 1 file changed, 98 insertions(+)
> > >  create mode 100644
> > > tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
> > > 
> > > diff --git
> > > a/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
> > > b/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt new
> > > file mode 100644 index 000000000000..0f40d14944c0 --- /dev/null
> > > +++ b/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
> > > @@ -0,0 +1,98 @@
> > > +libtraceevent(3)
> > > +================
> > > +
> > > +NAME
> > > +----
> > > +tep_load_plugins,tep_unload_plugins - Load  / unload traceevent
> > > plugins +
> > > +SYNOPSIS
> > > +--------
> > > +[verse]
> > > +--
> > > +*#include <event-parse.h>*
> > > +
> > > +struct tep_plugin_list pass:[*]*tep_load_plugins*(struct
> > > tep_handle pass:[*]_tep_); +void *tep_unload_plugins*(struct
> > > tep_plugin_list pass:[*]_plugin_list_, struct tep_handle
> > > pass:[*]_tep_); +-- +
> > > +DESCRIPTION
> > > +-----------
> > > +The _tep_load_plugins()_ function loads all plugins, located in
> > > the plugin +directories. The _tep_ argument is trace event parser
> > > context. +The plugin directories are :
> > > +[verse]
> > > +--
> > > +	- System's plugin directory, defined at the library
> > > compile time. It
> > > +	  depends on the library installation prefix and usually
> > > is
> > > +	  _(install_preffix)/lib/traceevent/plugins_
> > > +	- Directory, defined by the environment variable
> > > _TRACEEVENT_PLUGIN_DIR_
> > > +	- User's plugin directory, located at
> > > _~/.traceevent/plugins_    
> > 
> > We are going to need to modify this to be more compliant with
> > today's desktops.
> > 
> > Patrick, where's the place to put customized plugins that should
> > overwrite the system ones?
> >   
> 
> That sort of depends, if they are textual and could be considered
> configs, then .config is where they should go, otherwise
> ${HOME}/.local/share/traceevent or ${HOME}/.local/lib/traceevent,
> binaries should go under the lib, arch agnostic stuff should go under
> share.

More information on this spec here:
https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

The "${HOME}.local/lib" is not listed in the spec, but it is the
convention that is often used.
https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Steven Rostedt March 14, 2019, 12:53 a.m. UTC | #4
On Wed, 13 Mar 2019 14:45:17 -0700
Patrick McLean <chutzpah@gentoo.org> wrote:

> > > Patrick, where's the place to put customized plugins that should
> > > overwrite the system ones?
> > >     
> > 
> > That sort of depends, if they are textual and could be considered
> > configs, then .config is where they should go, otherwise
> > ${HOME}/.local/share/traceevent or ${HOME}/.local/lib/traceevent,
> > binaries should go under the lib, arch agnostic stuff should go under
> > share.  
> 
> More information on this spec here:
> https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
> 
> The "${HOME}.local/lib" is not listed in the spec, but it is the
> convention that is often used.
> https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Thanks. Note, these can be either .so binaries, or python scripts.

-- Steve
diff mbox series

Patch

diff --git a/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt b/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
new file mode 100644
index 000000000000..0f40d14944c0
--- /dev/null
+++ b/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
@@ -0,0 +1,98 @@ 
+libtraceevent(3)
+================
+
+NAME
+----
+tep_load_plugins,tep_unload_plugins - Load  / unload traceevent plugins
+
+SYNOPSIS
+--------
+[verse]
+--
+*#include <event-parse.h>*
+
+struct tep_plugin_list pass:[*]*tep_load_plugins*(struct tep_handle pass:[*]_tep_);
+void *tep_unload_plugins*(struct tep_plugin_list pass:[*]_plugin_list_, struct tep_handle pass:[*]_tep_);
+--
+
+DESCRIPTION
+-----------
+The _tep_load_plugins()_ function loads all plugins, located in the plugin
+directories. The _tep_ argument is trace event parser context.
+The plugin directories are :
+[verse]
+--
+	- System's plugin directory, defined at the library compile time. It
+	  depends on the library installation prefix and usually is
+	  _(install_preffix)/lib/traceevent/plugins_
+	- Directory, defined by the environment variable _TRACEEVENT_PLUGIN_DIR_
+	- User's plugin directory, located at _~/.traceevent/plugins_
+--
+Loading of plugins can be controlled by the _tep_flags_, using the
+_tep_set_flag()_ API:
+[verse]
+--
+	_TEP_DISABLE_SYS_PLUGINS_	- do not load plugins, located in
+					the system's plugin directory.
+	_TEP_DISABLE_PLUGINS_		- do not load any plugins.
+--
+The _tep_set_flag()_ API must be called before _tep_load_plugins()_.
+
+The _tep_unload_plugins()_ function unloads the plugins, previously loaded by
+_tep_load_plugins()_. The _tep_ argument is trace event parser context. The
+_plugin_list_ is the list of loaded plugins, returned by the _tep_load_plugins()_
+function.
+
+RETURN VALUE
+------------
+The _tep_load_plugins()_ function returns a list of successfully loaded plugins,
+or NULL in case no plugins are loaded.
+
+EXAMPLE
+-------
+[source,c]
+--
+#include <event-parse.h>
+...
+struct tep_handle *tep = tep_alloc();
+...
+struct tep_plugin_list *plugins = tep_load_plugins(tep);
+if (plugins == NULL) {
+	/* no plugins are loaded */
+}
+...
+tep_unload_plugins(plugins, tep);
+--
+
+FILES
+-----
+[verse]
+--
+*event-parse.h*
+	Header file to include in order to have access to the library APIs.
+*-ltraceevent*
+	Linker switch to add when building a program that uses the library.
+--
+
+SEE ALSO
+--------
+_libtraceevent(3)_, _trace-cmd(1)_, _tep_set_flag(3)_
+
+AUTHOR
+------
+[verse]
+--
+*Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
+*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
+--
+REPORTING BUGS
+--------------
+Report bugs to  <linux-trace-devel@vger.kernel.org>
+
+LICENSE
+-------
+libtraceevent is Free Software licensed under the GNU LGPL 2.1
+
+RESOURCES
+---------
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git