diff options
author | David Sharp <dhsharp@google.com> | 2010-09-28 20:00:16 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-10-20 09:30:53 -0400 |
commit | 5b49e656f49b43d85e9e66ad76f5e8566ed27ae2 (patch) | |
tree | 5973736ec7266b252f780d236dcea2739dc0461b | |
parent | 84cc30df9c35a3ccb79e34bc931c3edb979b2412 (diff) |
trace-cmd: Search $TRACE_CMD_PLUGIN_DIR for plugins.
Allows dynamic specification of the plugin directory so that plugins can be
used when the install prefix cannot be predicted, such as when using a
pre-compiled version of trace-cmd with Autotest.
Signed-off-by: David Sharp <dhsharp@google.com>
LKML-Reference: <1285718416-1470-1-git-send-email-dhsharp@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-util.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/trace-util.c b/trace-util.c index 33dbdf0..9e0ceca 100644 --- a/trace-util.c +++ b/trace-util.c | |||
@@ -771,6 +771,7 @@ void trace_util_load_plugins(struct pevent *pevent, const char *suffix, | |||
771 | { | 771 | { |
772 | char *home; | 772 | char *home; |
773 | char *path; | 773 | char *path; |
774 | char *envdir; | ||
774 | 775 | ||
775 | if (tracecmd_disable_plugins) | 776 | if (tracecmd_disable_plugins) |
776 | return; | 777 | return; |
@@ -782,7 +783,12 @@ void trace_util_load_plugins(struct pevent *pevent, const char *suffix, | |||
782 | load_plugin, data); | 783 | load_plugin, data); |
783 | #endif | 784 | #endif |
784 | 785 | ||
785 | /* Now let the home directory override the system defaults */ | 786 | /* Next let the environment-set plugin directory override the system defaults */ |
787 | envdir = getenv("TRACE_CMD_PLUGIN_DIR"); | ||
788 | if (envdir) | ||
789 | trace_util_load_plugins_dir(pevent, suffix, envdir, load_plugin, data); | ||
790 | |||
791 | /* Now let the home directory override the environment or system defaults */ | ||
786 | home = getenv("HOME"); | 792 | home = getenv("HOME"); |
787 | 793 | ||
788 | if (!home) | 794 | if (!home) |