X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Futils.c;h=d52d4622a9c3f3b1dfa34decf94d20bceaa8ecfa;hp=ef8d0235a019229cf0c4c1b92c33a58275f8a6de;hb=1dac0189ed7311146ff2cfc6605bac81213ee90b;hpb=5d5baaa365798454df0fa41879399dd88a8413c1 diff --git a/src/bin/lttng/utils.c b/src/bin/lttng/utils.c index ef8d0235a..d52d4622a 100644 --- a/src/bin/lttng/utils.c +++ b/src/bin/lttng/utils.c @@ -40,13 +40,8 @@ static const char *str_jul = "JUL"; static const char *str_log4j = "LOG4J"; static const char *str_python = "Python"; -/* - * get_session_name - * - * Return allocated string with the session name found in the config - * directory. - */ -char *get_session_name(void) +static +char *_get_session_name(int quiet) { char *path, *session_name = NULL; @@ -57,7 +52,8 @@ char *get_session_name(void) } /* Get session name from config */ - session_name = config_read_session_name(path); + session_name = quiet ? config_read_session_name_quiet(path) : + config_read_session_name(path); if (session_name == NULL) { goto error; } @@ -70,6 +66,28 @@ error: return NULL; } +/* + * get_session_name + * + * Return allocated string with the session name found in the config + * directory. + */ +char *get_session_name(void) +{ + return _get_session_name(0); +} + +/* + * get_session_name_quiet (no warnings/errors emitted) + * + * Return allocated string with the session name found in the config + * directory. + */ +char *get_session_name_quiet(void) +{ + return _get_session_name(1); +} + /* * list_commands *