X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Futils.c;h=be020befce3717ba9c65a4245f1fadfc991b9586;hb=bdae7d71473289a9e50c8d03188bd90cec8a5d57;hp=257dfc89aeaa63d368486f47ff5ec7468656a6a8;hpb=4f65bee19fd9e7cf43c95ef01f963107577573cf;p=lttng-tools.git diff --git a/src/bin/lttng/utils.c b/src/bin/lttng/utils.c index 257dfc89a..be020befc 100644 --- a/src/bin/lttng/utils.c +++ b/src/bin/lttng/utils.c @@ -37,13 +37,8 @@ static const char *str_kernel = "Kernel"; static const char *str_ust = "UST"; static const char *str_jul = "JUL"; -/* - * 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; @@ -54,7 +49,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; } @@ -67,6 +63,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 *