]> Git Repo - linux.git/commitdiff
tools lib traceevent: Add flag to not load event plugins
authorSteven Rostedt (Red Hat) <[email protected]>
Tue, 3 Jun 2014 03:20:13 +0000 (23:20 -0400)
committerJiri Olsa <[email protected]>
Sat, 7 Jun 2014 21:33:36 +0000 (23:33 +0200)
Add a flag to pevent that will let the callers be able to set it and
keep the system, and perhaps even normal plugins from being loaded.

This is useful when plugins might hide certain information and seeing
the raw events shows what may be going on.

Signed-off-by: Steven Rostedt <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Jiri Olsa <[email protected]>
tools/lib/traceevent/event-parse.h
tools/lib/traceevent/event-plugin.c

index feab942816343aba5023d1b6ab588322e7d45506..a68ec3d8289f491cd95a66b0be02a528822b6e19 100644 (file)
@@ -354,6 +354,8 @@ enum pevent_func_arg_type {
 
 enum pevent_flag {
        PEVENT_NSEC_OUTPUT              = 1,    /* output in NSECS */
+       PEVENT_DISABLE_SYS_PLUGINS      = 1 << 1,
+       PEVENT_DISABLE_PLUGINS          = 1 << 2,
 };
 
 #define PEVENT_ERRORS                                                        \
index 0c8bf6780e4d1de74ef955dd893a037e510400af..317466bd1a3719b2541bd4aaed8cd7bbd183e46d 100644 (file)
@@ -148,12 +148,17 @@ load_plugins(struct pevent *pevent, const char *suffix,
        char *path;
        char *envdir;
 
+       if (pevent->flags & PEVENT_DISABLE_PLUGINS)
+               return;
+
        /*
         * If a system plugin directory was defined,
         * check that first.
         */
 #ifdef PLUGIN_DIR
-       load_plugins_dir(pevent, suffix, PLUGIN_DIR, load_plugin, data);
+       if (!(pevent->flags & PEVENT_DISABLE_SYS_PLUGINS))
+               load_plugins_dir(pevent, suffix, PLUGIN_DIR,
+                                load_plugin, data);
 #endif
 
        /*
This page took 0.056824 seconds and 4 git commands to generate.