'\" t .\" Title: libtraceevent .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 11/26/2020 .\" Manual: libtraceevent Manual .\" Source: libtraceevent 1.1.0 .\" Language: English .\" .TH "LIBTRACEEVENT" "3" "11/26/2020" "libtraceevent 1\&.1\&.0" "libtraceevent Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" tep_load_plugins, tep_unload_plugins, tep_load_plugins_hook \- Load / unload traceevent plugins\&. .SH "SYNOPSIS" .sp .nf \fB#include \fR struct tep_plugin_list *\fBtep_load_plugins\fR(struct tep_handle *\fItep\fR); void \fBtep_unload_plugins\fR(struct tep_plugin_list *\fIplugin_list\fR, struct tep_handle *\fItep\fR); void \fBtep_load_plugins_hook\fR(struct tep_handle *\fItep\fR, const char *\fIsuffix\fR, void (*\fIload_plugin\fR)(struct tep_handle *tep, const char *path, const char *name, void *data), void *\fIdata\fR); .fi .SH "DESCRIPTION" .sp The \fItep_load_plugins()\fR function loads all plugins, located in the plugin directories\&. The \fItep\fR argument is trace event parser context\&. The plugin directories are : .sp .if n \{\ .RS 4 .\} .nf \- Directories, specified in \fItep\fR\(->plugins_dir with priority TEP_PLUGIN_FIRST \- System\(cqs plugin directory, defined at the library compile time\&. It depends on the library installation prefix and usually is \fI(install_preffix)/lib/traceevent/plugins\fR \- Directory, defined by the environment variable \fITRACEEVENT_PLUGIN_DIR\fR \- User\(cqs plugin directory, located at \fI~/\&.local/lib/traceevent/plugins\fR \- Directories, specified in \fItep\fR\(->plugins_dir with priority TEP_PLUGIN_LAST .fi .if n \{\ .RE .\} .sp Loading of plugins can be controlled by the \fItep_flags\fR, using the \fItep_set_flag()\fR API: .sp .if n \{\ .RS 4 .\} .nf \fITEP_DISABLE_SYS_PLUGINS\fR \- do not load plugins, located in the system\(cqs plugin directory\&. \fITEP_DISABLE_PLUGINS\fR \- do not load any plugins\&. .fi .if n \{\ .RE .\} .sp The \fItep_set_flag()\fR API needs to be called before \fItep_load_plugins()\fR, if loading of all plugins is not the desired case\&. .sp The \fItep_unload_plugins()\fR function unloads the plugins, previously loaded by \fItep_load_plugins()\fR\&. The \fItep\fR argument is trace event parser context\&. The \fIplugin_list\fR is the list of loaded plugins, returned by the \fItep_load_plugins()\fR function\&. .sp The \fItep_load_plugins_hook\fR function walks through all directories with plugins and calls user specified \fIload_plugin()\fR hook for each plugin file\&. Only files with given \fIsuffix\fR are considered to be plugins\&. The \fIdata\fR is a user specified context, passed to \fIload_plugin()\fR\&. Directories and the walk order are the same as in \fItep_load_plugins()\fR API\&. .SH "RETURN VALUE" .sp The \fItep_load_plugins()\fR function returns a list of successfully loaded plugins, or NULL in case no plugins are loaded\&. .SH "EXAMPLE" .sp .if n \{\ .RS 4 .\} .nf #include \&.\&.\&. 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); \&.\&.\&. void print_plugin(struct tep_handle *tep, const char *path, const char *name, void *data) { pritnf("Found libtraceevent plugin %s/%s\en", path, name); } \&.\&.\&. tep_load_plugins_hook(tep, "\&.so", print_plugin, NULL); \&.\&.\&. .fi .if n \{\ .RE .\} .SH "FILES" .sp .if n \{\ .RS 4 .\} .nf \fBevent\-parse\&.h\fR Header file to include in order to have access to the library APIs\&. \fB\-ltraceevent\fR Linker switch to add when building a program that uses the library\&. .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fIlibtraceevent(3)\fR, \fItrace\-cmd(1)\fR, \fItep_set_flag(3)\fR .SH "AUTHOR" .sp .if n \{\ .RS 4 .\} .nf \fBSteven Rostedt\fR <\m[blue]\fBrostedt@goodmis\&.org\fR\m[]\&\s-2\u[1]\d\s+2>, author of \fBlibtraceevent\fR\&. \fBTzvetomir Stoyanov\fR <\m[blue]\fBtz\&.stoyanov@gmail\&.com\fR\m[]\&\s-2\u[2]\d\s+2>, author of this man page\&. .fi .if n \{\ .RE .\} .SH "REPORTING BUGS" .sp Report bugs to <\m[blue]\fBlinux\-trace\-devel@vger\&.kernel\&.org\fR\m[]\&\s-2\u[3]\d\s+2> .SH "LICENSE" .sp libtraceevent is Free Software licensed under the GNU LGPL 2\&.1 .SH "RESOURCES" .sp \m[blue]\fBhttps://git\&.kernel\&.org/pub/scm/linux/kernel/git/torvalds/linux\&.git\fR\m[] .SH "NOTES" .IP " 1." 4 rostedt@goodmis.org .RS 4 \%mailto:rostedt@goodmis.org .RE .IP " 2." 4 tz.stoyanov@gmail.com .RS 4 \%mailto:tz.stoyanov@gmail.com .RE .IP " 3." 4 linux-trace-devel@vger.kernel.org .RS 4 \%mailto:linux-trace-devel@vger.kernel.org .RE