+Useless change
LTTng-UST
=========
ENVIRONMENT VARIABLES
---------------------
-`LTTNG_HOME`::
+`LTTNG_UST_HOME`::
Alternative user's home directory. This variable is useful when the
user running the instrumented application has a non-writable home
directory.
+
Unix sockets used for the communication between `liblttng-ust` and the
LTTng session and consumer daemons (part of the LTTng-tools project)
-are located in a specific directory under `$LTTNG_HOME` (or `$HOME` if
-`$LTTNG_HOME` is not set).
+are located in a specific directory under `$LTTNG_UST_HOME` (or `$HOME` if
+`$LTTNG_UST_HOME` is not set).
+
+NOTE: `$LTTNG_HOME` is also supported as a fallback of `$LTTNG_UST_HOME` for
+backward compatibility reason.
`LTTNG_UST_ALLOW_BLOCKING`::
If set, allow the application to retry event tracing when there's
{ "LTTNG_UST_ALLOW_BLOCKING", LTTNG_ENV_SECURE, NULL, },
{ "HOME", LTTNG_ENV_SECURE, NULL, },
{ "LTTNG_HOME", LTTNG_ENV_SECURE, NULL, },
+ { "LTTNG_UST_HOME", LTTNG_ENV_SECURE, NULL, },
};
static
private static String getHomePath() {
/*
+ * The environment variable LTTNG_UST_HOME overrides LTTNG_HOME
+ * if present.
* The environment variable LTTNG_HOME overrides HOME if
* defined.
*/
- String homePath = System.getenv("LTTNG_HOME");
+ String lttngUstHomePath = System.getenv("LTTNG_UST_HOME");
+ String lttngHomePath = System.getenv("LTTNG_HOME");
+
+ if (lttngUstHomePath != null) {
+ /*
+ * LTTNG_UST_HOME has priority over LTTNG_HOME and user
+ * home directory.
+ */
+ return lttngUstHomePath;
+ }
- if (homePath == null) {
- homePath = System.getProperty("user.home");
+ if (lttngHomePath != null) {
+ /* LTTNG_HOME has priority over user home directory. */
+ return lttngHomePath;
}
- return homePath;
+
+ /* Default to the user home directory. */
+ return System.getProperty("user.home");
}
/**
/*
* Returns the HOME directory path. Caller MUST NOT free(3) the returned
* pointer.
+ * The following env are checked in order of priority:
+ * 1 - LTTNG_UST_HOME
+ * 2 - LTTNG_HOME
+ * 3 - HOME
*/
static
const char *get_lttng_home_dir(void)
{
const char *val;
+ val = (const char *) lttng_ust_getenv("LTTNG_UST_HOME");
+ if (val != NULL) {
+ return val;
+ }
+
val = (const char *) lttng_ust_getenv("LTTNG_HOME");
if (val != NULL) {
return val;
}
+
return (const char *) lttng_ust_getenv("HOME");
}
def _get_user_home_path():
- # $LTTNG_HOME overrides $HOME if it exists
- return os.getenv('LTTNG_HOME', os.path.expanduser('~'))
+ # $LTTNG_UST_HOME overrides $LTTNG_HOME if it exist.
+ # In turn, $LTTNG_HOME overrides $HOME if it exists
+ return os.getenv('LTTNG_UST_HOME', os.getenv('LTTNG_HOME',
+ os.path.expanduser('~')))
_initialized = False