While it is possible to query whether the name of a chunk is
overridden through lttng_trace_chunk_get_name(), using it requires
a lot of code to deal with an unused name string when all that is needed
is to check whether the name is overridden.
In preparation for the new "path" handling needed for the clear
feature introduce this lttng_trace_chunk_get_name_overridden()
API to allow checking whether name is overridden in a succint way.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ied8bcbb5202826e68a5d6b54130f29f203948794
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
return status;
}
+LTTNG_HIDDEN
+bool lttng_trace_chunk_get_name_overridden(struct lttng_trace_chunk *chunk)
+{
+ bool name_overridden;
+
+ pthread_mutex_lock(&chunk->lock);
+ name_overridden = chunk->name_overridden;
+ pthread_mutex_unlock(&chunk->lock);
+ return name_overridden;
+}
+
static
bool is_valid_chunk_name(const char *name)
{
struct lttng_trace_chunk *chunk, const char **name,
bool *name_overridden);
+LTTNG_HIDDEN
+bool lttng_trace_chunk_get_name_overridden(struct lttng_trace_chunk *chunk);
+
LTTNG_HIDDEN
enum lttng_trace_chunk_status lttng_trace_chunk_override_name(
struct lttng_trace_chunk *chunk, const char *name);