NAME |SYNOPSIS |DESCRIPTION |RETURN VALUE |EXAMPLE |FILES |SEE ALSO |AUTHOR |REPORTING BUGS |LICENSE |RESOURCES |NOTES |COLOPHON | |
LIBTRACEEVENT(3) libtraceevent ManualLIBTRACEEVENT(3)tep_load_plugins, tep_unload_plugins, tep_load_plugins_hook, tep_add_plugin_path, tep_plugin_add_option - Load / unload traceevent plugins.
#include <event-parse.h> struct tep_plugin_list *tep_load_plugins(struct tep_handle *tep); voidtep_unload_plugins(struct tep_plugin_list *plugin_list, struct tep_handle *tep); voidtep_load_plugins_hook(struct tep_handle *tep, const char *suffix, void (*load_plugin)(struct tep_handle *tep, const char *path, const char *name, void *data), void *data); inttep_add_plugin_path(struct tep_handle *tep, char *path, enum tep_plugin_load_priority prio); inttep_plugin_add_option(const char *name, const char *val);
Thetep_load_plugins()function loads all plugins, located in the plugin directories. Thetep argument is trace event parser context. The plugin directories are : - Directories, specified intep→plugins_dir with priority TEP_PLUGIN_FIRST - 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 variableTRACEEVENT_PLUGIN_DIR - User’s plugin directory, located at~/.local/lib/traceevent/plugins - Directories, specified intep→plugins_dir with priority TEP_PLUGIN_LAST Loading of plugins can be controlled by thetep_flags, using thetep_set_flag()API:TEP_DISABLE_SYS_PLUGINS - do not load plugins, located in the system’s plugin directory.TEP_DISABLE_PLUGINS - do not load any plugins. Thetep_set_flag()API needs to be called beforetep_load_plugins(), if loading of all plugins is not the desired case. Thetep_unload_plugins()function unloads the plugins, previously loaded bytep_load_plugins(). Thetep argument is trace event parser context. Theplugin_list is the list of loaded plugins, returned by thetep_load_plugins()function. Thetep_load_plugins_hook()function walks through all directories with plugins and calls user specifiedload_plugin()hook for each plugin file. Only files with givensuffix are considered to be plugins. Thedata is a user specified context, passed toload_plugin(). Directories and the walk order are the same as intep_load_plugins()API. Thetep_add_plugin_path()functions adds additional directories with plugins in thetep→plugins_dir list. It must be called beforetep_load_plugins()in order for the plugins from the new directories to be loaded. Thetep argument is the trace event parser context. Thepath is the full path to the new plugin directory. Theprio argument specifies the loading priority order for the new directory of plugins. The loading priority is important in case of different versions of the same plugin located in multiple plugin directories.The last loaded plugin wins. The priority can be:TEP_PLUGIN_FIRST - Load plugins from this directory firstTEP_PLUGIN_LAST - Load plugins from this directory last Where the plugins in TEP_PLUGIN_LAST" will take precedence over the plugins in the other directories. Thetep_plugin_add_option()sets options defined by a plugin. Thename is the name of the option to set toval. Plugins can add options to change its behavior andtep_plugin_add_option()is used by the application to make those modifications.
Thetep_load_plugins()function returns a list of successfully loaded plugins, or NULL in case no plugins are loaded. Thetep_add_plugin_path()function returns -1 in case of an error, 0 otherwise.
#include <event-parse.h> ... struct tep_handle *tep = tep_alloc(); ... tep_add_plugin_path(tep, "~/dev_plugins", TEP_PLUGIN_LAST); ... 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\n", path, name); } ... tep_load_plugins_hook(tep, ".so", print_plugin, NULL); ...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.
libtraceevent(3),trace-cmd(1),tep_set_flag(3)
Steven Rostedt<rostedt@goodmis.org[1]>, author oflibtraceevent.Tzvetomir Stoyanov<tz.stoyanov@gmail.com[2]>, author of this man page.
Report bugs to <linux-trace-devel@vger.kernel.org[3]>
libtraceevent is Free Software licensed under the GNU LGPL 2.1
https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
1. rostedt@goodmis.org mailto:rostedt@goodmis.org 2. tz.stoyanov@gmail.com mailto:tz.stoyanov@gmail.com 3. linux-trace-devel@vger.kernel.org mailto:linux-trace-devel@vger.kernel.org
This page is part of thelibtraceevent (Linux kernel trace event library) project. Information about the project can be found at ⟨https://www.trace-cmd.org/⟩. If you have a bug report for this manual page, see ⟨https://www.trace-cmd.org/⟩. This page was obtained from the project's upstream Git repository ⟨https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git⟩ on 2025-08-11. (At that time, the date of the most recent commit that was found in the repository was 2025-05-30.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which isnot part of the original manual page), send a mail to man-pages@man7.orglibtraceevent 1.7.3 09/24/2023LIBTRACEEVENT(3)HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface. For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere. Hosting byjambit GmbH. | ![]() |