Skip to contentSkip to conversation

trace-cmd: Search $TRACE_CMD_PLUGIN_DIR for plugins.

PATCH In review David Sharp 2 participants 2 messages Sep 29, 2010 – Oct 20, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 trace-util.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
trace-util.c +7 -1
index 33dbdf0..9e0ceca 100644
@@ -771,6 +771,7 @@ void trace_util_load_plugins(struct pevent *pevent, const char *suffix,
 {
 	char *home;
 	char *path;
+        char *envdir;
 
 	if (tracecmd_disable_plugins)
 		return;
@@ -782,7 +783,12 @@ void trace_util_load_plugins(struct pevent *pevent, const char *suffix,
 					    load_plugin, data);
 #endif
 
-	/* Now let the home directory override the system defaults */
+	/* Next let the environment-set plugin directory override the system defaults */
+	envdir = getenv("TRACE_CMD_PLUGIN_DIR");
+	if (envdir)
+		trace_util_load_plugins_dir(pevent, suffix, envdir, load_plugin, data);
+
+	/* Now let the home directory override the environment or system defaults */
 	home = getenv("HOME");
 
 	if (!home)
Signature · 1 line
1.7.1
#1 lore raw
Quoted 5 lines · David Sharp

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.

Sorry for the late response, but... Applied.

Thanks!

-- Steve