X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fsession-descriptor.c;h=b5fdb0677f8153d00e1c8517f16816e9e02dbb69;hp=6f0a357e3e04a25eee7173e08a31c5114e4eefa4;hb=6fa5fe7cc78bea0b0bba154a0f911d3df530e18f;hpb=84f3bd075b45f762b0dea5c1d48bc17a3f3c5365 diff --git a/src/common/session-descriptor.c b/src/common/session-descriptor.c index 6f0a357e3..b5fdb0677 100644 --- a/src/common/session-descriptor.c +++ b/src/common/session-descriptor.c @@ -1178,3 +1178,22 @@ int lttng_session_descriptor_assign( end: return ret; } + +LTTNG_HIDDEN +int lttng_session_descriptor_get_base_path(struct lttng_session_descriptor *dst, + const char **_base_path) +{ + switch (dst->output_type) { + case LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NETWORK: + { + *_base_path = dst->output.network.control->subdir[0] ? + dst->output.network.control->subdir : NULL; + break; + } + case LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_LOCAL: + case LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NONE: + *_base_path = NULL; + break; + } + return 0; +}