#include <urcu/compiler.h>
#include <signal.h>
-#include <common/bytecode/bytecode.h>
-#include <common/compat/errno.h>
-#include <common/common.h>
-#include <common/hashtable/utils.h>
+#include <common/bytecode/bytecode.hpp>
+#include <common/compat/errno.hpp>
+#include <common/common.hpp>
+#include <common/hashtable/utils.hpp>
#include <lttng/event-rule/event-rule.h>
-#include <lttng/event-rule/event-rule-internal.h>
+#include <lttng/event-rule/event-rule-internal.hpp>
#include <lttng/event-rule/user-tracepoint.h>
#include <lttng/condition/condition.h>
-#include <lttng/condition/event-rule-matches-internal.h>
+#include <lttng/condition/event-rule-matches-internal.hpp>
#include <lttng/condition/event-rule-matches.h>
-#include <lttng/trigger/trigger-internal.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-
-#include "buffer-registry.h"
-#include "condition-internal.h"
-#include "fd-limit.h"
-#include "health-sessiond.h"
-#include "ust-app.h"
-#include "ust-consumer.h"
-#include "lttng-ust-ctl.h"
-#include "lttng-ust-error.h"
-#include "utils.h"
-#include "session.h"
-#include "lttng-sessiond.h"
-#include "notification-thread-commands.h"
-#include "rotate.h"
-#include "event.h"
-#include "event-notifier-error-accounting.h"
-#include "ust-field-utils.h"
+#include <lttng/trigger/trigger-internal.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+
+#include "buffer-registry.hpp"
+#include "condition-internal.hpp"
+#include "fd-limit.hpp"
+#include "health-sessiond.hpp"
+#include "ust-app.hpp"
+#include "ust-consumer.hpp"
+#include "lttng-ust-ctl.hpp"
+#include "lttng-ust-error.hpp"
+#include "utils.hpp"
+#include "session.hpp"
+#include "lttng-sessiond.hpp"
+#include "notification-thread-commands.hpp"
+#include "rotate.hpp"
+#include "event.hpp"
+#include "event-notifier-error-accounting.hpp"
+#include "ust-field-utils.hpp"
struct lttng_ht *ust_app_ht;
struct lttng_ht *ust_app_ht_by_sock;
* A registry per UID object MUST exists before calling this function or else
* it LTTNG_ASSERT() if not found. RCU read side lock must be acquired.
*/
-static struct ust_registry_session *get_session_registry(
+static ust_registry_session *get_session_registry(
struct ust_app_session *ua_sess)
{
- struct ust_registry_session *registry = NULL;
+ ust_registry_session *registry = NULL;
LTTNG_ASSERT(ua_sess);
struct ust_app_event *ua_event;
struct ust_app_ctx *ua_ctx;
struct ust_app_stream *stream, *stmp;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
LTTNG_ASSERT(ua_chan);
ASSERT_RCU_READ_LOCKED();
* but it can be caused by recoverable errors (e.g. the application has
* terminated concurrently).
*/
-ssize_t ust_app_push_metadata(struct ust_registry_session *registry,
+ssize_t ust_app_push_metadata(ust_registry_session *registry,
struct consumer_socket *socket, int send_zero_data)
{
int ret;
LTTNG_ASSERT(socket);
ASSERT_RCU_READ_LOCKED();
- metadata_key = registry->metadata_key;
+ metadata_key = registry->_metadata_key;
/*
* Means that no metadata was assigned to the session. This can
return 0;
}
- offset = registry->metadata_len_sent;
- len = registry->metadata_len - registry->metadata_len_sent;
- new_metadata_len_sent = registry->metadata_len;
- metadata_version = registry->metadata_version;
+ offset = registry->_metadata_len_sent;
+ len = registry->_metadata_len - registry->_metadata_len_sent;
+ new_metadata_len_sent = registry->_metadata_len;
+ metadata_version = registry->_metadata_version;
if (len == 0) {
DBG3("No metadata to push for metadata key %" PRIu64,
- registry->metadata_key);
+ registry->_metadata_key);
ret_val = len;
if (send_zero_data) {
DBG("No metadata to push");
}
/* Allocate only what we have to send. */
- metadata_str = (char *) zmalloc(len);
+ metadata_str = calloc<char>(len);
if (!metadata_str) {
PERROR("zmalloc ust app metadata string");
ret_val = -ENOMEM;
goto error;
}
/* Copy what we haven't sent out. */
- memcpy(metadata_str, registry->metadata + offset, len);
+ memcpy(metadata_str, registry->_metadata + offset, len);
push_data:
- pthread_mutex_unlock(®istry->lock);
+ pthread_mutex_unlock(®istry->_lock);
/*
* We need to unlock the registry while we push metadata to
* break a circular dependency between the consumerd metadata
*/
ret = consumer_push_metadata(socket, metadata_key,
metadata_str, len, offset, metadata_version);
- pthread_mutex_lock(®istry->lock);
+ pthread_mutex_lock(®istry->_lock);
if (ret < 0) {
/*
* There is an acceptable race here between the registry
* largest metadata_len_sent value of the concurrent
* send.
*/
- registry->metadata_len_sent =
- std::max(registry->metadata_len_sent,
+ registry->_metadata_len_sent =
+ std::max(registry->_metadata_len_sent,
new_metadata_len_sent);
}
free(metadata_str);
* the metadata cache has been destroyed on the
* consumer.
*/
- registry->metadata_closed = 1;
+ registry->_metadata_closed = true;
}
error_push:
free(metadata_str);
* but it can be caused by recoverable errors (e.g. the application has
* terminated concurrently).
*/
-static int push_metadata(struct ust_registry_session *registry,
+static int push_metadata(ust_registry_session *registry,
struct consumer_output *consumer)
{
int ret_val;
LTTNG_ASSERT(consumer);
ASSERT_RCU_READ_LOCKED();
- pthread_mutex_lock(®istry->lock);
- if (registry->metadata_closed) {
+ pthread_mutex_lock(®istry->_lock);
+ if (registry->_metadata_closed) {
ret_val = -EPIPE;
goto error;
}
/* Get consumer socket to use to push the metadata.*/
- socket = consumer_find_socket_by_bitness(registry->bits_per_long,
+ socket = consumer_find_socket_by_bitness(registry->_bits_per_long,
consumer);
if (!socket) {
ret_val = -1;
ret_val = ret;
goto error;
}
- pthread_mutex_unlock(®istry->lock);
+ pthread_mutex_unlock(®istry->_lock);
return 0;
error:
- pthread_mutex_unlock(®istry->lock);
+ pthread_mutex_unlock(®istry->_lock);
return ret_val;
}
*
* Return 0 on success else a negative value.
*/
-static int close_metadata(struct ust_registry_session *registry,
+static int close_metadata(ust_registry_session *registry,
struct consumer_output *consumer)
{
int ret;
rcu_read_lock();
- pthread_mutex_lock(®istry->lock);
- metadata_key = registry->metadata_key;
- registry_was_already_closed = registry->metadata_closed;
+ pthread_mutex_lock(®istry->_lock);
+ metadata_key = registry->_metadata_key;
+ registry_was_already_closed = registry->_metadata_closed;
if (metadata_key != 0) {
/*
* Metadata closed. Even on error this means that the consumer
* is not responding or not found so either way a second close
* should NOT be emit for this registry.
*/
- registry->metadata_closed = 1;
+ registry->_metadata_closed = true;
}
- pthread_mutex_unlock(®istry->lock);
+ pthread_mutex_unlock(®istry->_lock);
if (metadata_key == 0 || registry_was_already_closed) {
ret = 0;
}
/* Get consumer socket to use to push the metadata.*/
- socket = consumer_find_socket_by_bitness(registry->bits_per_long,
+ socket = consumer_find_socket_by_bitness(registry->_bits_per_long,
consumer);
if (!socket) {
ret = -1;
int ret;
struct lttng_ht_iter iter;
struct ust_app_channel *ua_chan;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
LTTNG_ASSERT(ua_sess);
ASSERT_RCU_READ_LOCKED();
struct ust_app_session *ua_sess;
/* Init most of the default value by allocating and zeroing */
- ua_sess = (ust_app_session *) zmalloc(sizeof(struct ust_app_session));
+ ua_sess = zmalloc<ust_app_session>();
if (ua_sess == NULL) {
PERROR("malloc");
goto error_free;
struct ust_app_channel *ua_chan;
/* Init most of the default value by allocating and zeroing */
- ua_chan = (ust_app_channel *) zmalloc(sizeof(struct ust_app_channel));
+ ua_chan = zmalloc<ust_app_channel>();
if (ua_chan == NULL) {
PERROR("malloc");
goto error;
{
struct ust_app_stream *stream = NULL;
- stream = (ust_app_stream *) zmalloc(sizeof(*stream));
+ stream = zmalloc<ust_app_stream>();
if (stream == NULL) {
PERROR("zmalloc ust app stream");
goto error;
struct ust_app_event *ua_event;
/* Init most of the default value by allocating and zeroing */
- ua_event = (ust_app_event *) zmalloc(sizeof(struct ust_app_event));
+ ua_event = zmalloc<ust_app_event>();
if (ua_event == NULL) {
PERROR("Failed to allocate ust_app_event structure");
goto error;
struct lttng_condition *condition = NULL;
const struct lttng_event_rule *event_rule = NULL;
- ua_event_notifier_rule = (ust_app_event_notifier_rule *) zmalloc(sizeof(struct ust_app_event_notifier_rule));
+ ua_event_notifier_rule = zmalloc<ust_app_event_notifier_rule>();
if (ua_event_notifier_rule == NULL) {
PERROR("Failed to allocate ust_app_event_notifier_rule structure");
goto error;
{
struct ust_app_ctx *ua_ctx;
- ua_ctx = (ust_app_ctx *) zmalloc(sizeof(struct ust_app_ctx));
+ ua_ctx = zmalloc<ust_app_ctx>();
if (ua_ctx == NULL) {
goto error;
}
struct lttng_ust_abi_filter_bytecode *filter = NULL;
/* Copy filter bytecode. */
- filter = (lttng_ust_abi_filter_bytecode *) zmalloc(sizeof(*filter) + orig_f->len);
+ filter = zmalloc<lttng_ust_abi_filter_bytecode>(sizeof(*filter) + orig_f->len);
if (!filter) {
PERROR("Failed to allocate lttng_ust_filter_bytecode: bytecode len = %" PRIu32 " bytes", orig_f->len);
goto error;
struct lttng_ust_abi_capture_bytecode *capture = NULL;
/* Copy capture bytecode. */
- capture = (lttng_ust_abi_capture_bytecode *) zmalloc(sizeof(*capture) + orig_f->len);
+ capture = zmalloc<lttng_ust_abi_capture_bytecode>(sizeof(*capture) + orig_f->len);
if (!capture) {
PERROR("Failed to allocate lttng_ust_abi_capture_bytecode: bytecode len = %" PRIu32 " bytes", orig_f->len);
goto error;
size_t exclusion_alloc_size = sizeof(struct lttng_ust_abi_event_exclusion) +
LTTNG_UST_ABI_SYM_NAME_LEN * exclusion->count;
- ust_exclusion = (lttng_ust_abi_event_exclusion *) zmalloc(exclusion_alloc_size);
+ ust_exclusion = zmalloc<lttng_ust_abi_event_exclusion>(exclusion_alloc_size);
if (!ust_exclusion) {
PERROR("malloc");
goto end;
cds_list_del(&stream->list);
delete_ust_app_stream(-1, stream, app);
}
- /* Flag the channel that it is sent to the application. */
- ua_chan->is_sent = 1;
error:
health_code_update();
if (uevent->exclusion) {
exclusion_alloc_size = sizeof(struct lttng_event_exclusion) +
LTTNG_UST_ABI_SYM_NAME_LEN * uevent->exclusion->count;
- ua_event->exclusion = (lttng_event_exclusion *) zmalloc(exclusion_alloc_size);
+ ua_event->exclusion = zmalloc<lttng_event_exclusion>(exclusion_alloc_size);
if (ua_event->exclusion == NULL) {
PERROR("malloc");
} else {
}
/* Initialize registry. */
- ret = ust_registry_session_init(®_pid->registry->reg.ust, app,
+ reg_pid->registry->reg.ust = ust_registry_session_per_pid_create(app,
app->bits_per_long, app->uint8_t_alignment,
app->uint16_t_alignment, app->uint32_t_alignment,
app->uint64_t_alignment, app->long_alignment,
reg_pid->root_shm_path, reg_pid->shm_path,
lttng_credentials_get_uid(&ua_sess->effective_credentials),
lttng_credentials_get_gid(&ua_sess->effective_credentials),
- ua_sess->tracing_id,
- app->uid);
- if (ret < 0) {
+ ua_sess->tracing_id);
+ if (!reg_pid->registry->reg.ust) {
/*
* reg_pid->registry->reg.ust is NULL upon error, so we need to
* destroy the buffer registry, because it is always expected
}
/* Initialize registry. */
- ret = ust_registry_session_init(®_uid->registry->reg.ust, NULL,
+ reg_uid->registry->reg.ust = ust_registry_session_per_uid_create(
app->bits_per_long, app->uint8_t_alignment,
app->uint16_t_alignment, app->uint32_t_alignment,
app->uint64_t_alignment, app->long_alignment,
app->version.minor, reg_uid->root_shm_path,
reg_uid->shm_path, usess->uid, usess->gid,
ua_sess->tracing_id, app->uid);
- if (ret < 0) {
+ if (!reg_uid->registry->reg.ust) {
/*
* reg_uid->registry->reg.ust is NULL upon error, so we need to
* destroy the buffer registry, because it is always expected
buffer_reg_uid_destroy(reg_uid, NULL);
goto error;
}
+
/* Add node to teardown list of the session. */
cds_list_add(®_uid->lnode, &usess->buffer_reg_uid_list);
*/
static int do_consumer_create_channel(struct ltt_ust_session *usess,
struct ust_app_session *ua_sess, struct ust_app_channel *ua_chan,
- int bitness, struct ust_registry_session *registry)
+ int bitness, ust_registry_session *registry)
{
int ret;
unsigned int nb_fd = 0;
/* Send all streams to application. */
pthread_mutex_lock(&buf_reg_chan->stream_list_lock);
cds_list_for_each_entry(reg_stream, &buf_reg_chan->streams, lnode) {
- struct ust_app_stream stream;
+ struct ust_app_stream stream = {};
ret = duplicate_stream_object(reg_stream, &stream);
if (ret < 0) {
* Treat this the same way as an application
* that is exiting.
*/
- WARN("Communication with application %d timed out on send_stream for stream \"%s\" of channel \"%s\" of session \"%" PRIu64 "\".",
- app->pid, stream.name,
+ WARN("Communication with application %d timed out on send_stream for stream of channel \"%s\" of session \"%" PRIu64 "\".",
+ app->pid,
ua_chan->name,
ua_sess->tracing_id);
ret = -ENOTCONN;
*/
(void) release_ust_app_stream(-1, &stream, app);
}
- ua_chan->is_sent = 1;
error_stream_unlock:
pthread_mutex_unlock(&buf_reg_chan->stream_list_lock);
session = session_find_by_id(ua_sess->tracing_id);
LTTNG_ASSERT(session);
- LTTNG_ASSERT(pthread_mutex_trylock(&session->lock));
- LTTNG_ASSERT(session_trylock_list());
+ ASSERT_LOCKED(session->lock);
+ ASSERT_SESSION_LIST_LOCKED();
/*
* Create the buffers on the consumer side. This call populates the
}
/* Notify the notification subsystem of the channel's creation. */
- pthread_mutex_lock(®_uid->registry->reg.ust->lock);
+ pthread_mutex_lock(®_uid->registry->reg.ust->_lock);
ust_reg_chan = ust_registry_channel_find(reg_uid->registry->reg.ust,
ua_chan->tracing_channel_id);
LTTNG_ASSERT(ust_reg_chan);
ust_reg_chan->consumer_key = ua_chan->key;
ust_reg_chan = NULL;
- pthread_mutex_unlock(®_uid->registry->reg.ust->lock);
+ pthread_mutex_unlock(®_uid->registry->reg.ust->_lock);
notification_ret = notification_thread_command_add_channel(
the_notification_thread_handle, session->name,
struct ust_app_channel *ua_chan)
{
int ret;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
enum lttng_error_code cmd_ret;
struct ltt_session *session = NULL;
uint64_t chan_reg_key;
session = session_find_by_id(ua_sess->tracing_id);
LTTNG_ASSERT(session);
-
- LTTNG_ASSERT(pthread_mutex_trylock(&session->lock));
- LTTNG_ASSERT(session_trylock_list());
+ ASSERT_LOCKED(session->lock);
+ ASSERT_SESSION_LIST_LOCKED();
/* Create and get channel on the consumer side. */
ret = do_consumer_create_channel(usess, ua_sess, ua_chan,
}
chan_reg_key = ua_chan->key;
- pthread_mutex_lock(®istry->lock);
+ pthread_mutex_lock(®istry->_lock);
ust_reg_chan = ust_registry_channel_find(registry, chan_reg_key);
LTTNG_ASSERT(ust_reg_chan);
ust_reg_chan->consumer_key = ua_chan->key;
- pthread_mutex_unlock(®istry->lock);
+ pthread_mutex_unlock(®istry->_lock);
cmd_ret = notification_thread_command_add_channel(
the_notification_thread_handle, session->name,
int ret = 0;
struct ust_app_channel *metadata;
struct consumer_socket *socket;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
struct ltt_session *session = NULL;
LTTNG_ASSERT(ua_sess);
/* The UST app session is held registry shall not be null. */
LTTNG_ASSERT(registry);
- pthread_mutex_lock(®istry->lock);
+ pthread_mutex_lock(®istry->_lock);
/* Metadata already exists for this registry or it was closed previously */
- if (registry->metadata_key || registry->metadata_closed) {
+ if (registry->_metadata_key || registry->_metadata_closed) {
ret = 0;
goto error;
}
* consumer requesting the metadata and the ask_channel call on our side
* did not returned yet.
*/
- registry->metadata_key = metadata->key;
+ registry->_metadata_key = metadata->key;
session = session_find_by_id(ua_sess->tracing_id);
LTTNG_ASSERT(session);
-
- LTTNG_ASSERT(pthread_mutex_trylock(&session->lock));
- LTTNG_ASSERT(session_trylock_list());
+ ASSERT_LOCKED(session->lock);
+ ASSERT_SESSION_LIST_LOCKED();
/*
* Ask the metadata channel creation to the consumer. The metadata object
registry, session->current_trace_chunk);
if (ret < 0) {
/* Nullify the metadata key so we don't try to close it later on. */
- registry->metadata_key = 0;
+ registry->_metadata_key = 0;
goto error_consumer;
}
ret = consumer_setup_metadata(socket, metadata->key);
if (ret < 0) {
/* Nullify the metadata key so we don't try to close it later on. */
- registry->metadata_key = 0;
+ registry->_metadata_key = 0;
goto error_consumer;
}
lttng_fd_put(LTTNG_FD_APPS, 1);
delete_ust_app_channel(-1, metadata, app);
error:
- pthread_mutex_unlock(®istry->lock);
+ pthread_mutex_unlock(®istry->_lock);
if (session) {
session_put(session);
}
goto error;
}
- lta = (ust_app *) zmalloc(sizeof(struct ust_app));
+ lta = zmalloc<ust_app>();
if (lta == NULL) {
PERROR("malloc");
goto error_free_pipe;
*/
cds_lfht_for_each_entry(lta->sessions->ht, &iter.iter, ua_sess,
node.node) {
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
ret = lttng_ht_del(lta->sessions, &iter);
if (ret) {
struct lttng_event *tmp_event;
nbmem = UST_APP_EVENT_LIST_SIZE;
- tmp_event = (lttng_event *) zmalloc(nbmem * sizeof(struct lttng_event));
+ tmp_event = calloc<lttng_event>(nbmem);
if (tmp_event == NULL) {
PERROR("zmalloc ust app events");
ret = -ENOMEM;
struct lttng_event_field *tmp_event;
nbmem = UST_APP_EVENT_LIST_SIZE;
- tmp_event = (lttng_event_field *) zmalloc(nbmem * sizeof(struct lttng_event_field));
+ tmp_event = calloc<lttng_event_field>(nbmem);
if (tmp_event == NULL) {
PERROR("zmalloc ust app event fields");
ret = -ENOMEM;
{
int ret = 0;
struct ust_app_session *ua_sess;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
DBG("Stopping tracing for ust app pid %d", app->pid);
/* Flush all per UID buffers associated to that session. */
cds_list_for_each_entry(reg, &usess->buffer_reg_uid_list, lnode) {
- struct ust_registry_session *ust_session_reg;
+ ust_registry_session *ust_session_reg;
struct buffer_reg_channel *buf_reg_chan;
struct consumer_socket *socket;
if (!found) {
goto end;
}
- new_fields = (struct lttng_ust_ctl_field *) zmalloc(sizeof(*new_fields) * new_nr_fields);
+
+ new_fields = calloc<lttng_ust_ctl_field>(new_nr_fields);
if (!new_fields) {
ret = -ENOMEM;
goto end;
}
+
for (i = 0, j = 0; i < nr_fields; i++, j++) {
const struct lttng_ust_ctl_field *field = &fields[i];
struct lttng_ust_ctl_field *new_field = &new_fields[j];
struct ust_app *app;
struct ust_app_channel *ua_chan;
struct ust_app_session *ua_sess;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
struct ust_registry_channel *ust_reg_chan;
rcu_read_lock();
chan_reg_key = ua_chan->key;
}
- pthread_mutex_lock(®istry->lock);
+ pthread_mutex_lock(®istry->_lock);
ust_reg_chan = ust_registry_channel_find(registry, chan_reg_key);
LTTNG_ASSERT(ust_reg_chan);
ust_reg_chan->register_done = 1;
error:
- pthread_mutex_unlock(®istry->lock);
+ pthread_mutex_unlock(®istry->_lock);
error_rcu_unlock:
rcu_read_unlock();
free(fields);
struct ust_app *app;
struct ust_app_channel *ua_chan;
struct ust_app_session *ua_sess;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
rcu_read_lock();
chan_reg_key = ua_chan->key;
}
- pthread_mutex_lock(®istry->lock);
+ pthread_mutex_lock(®istry->_lock);
/*
* From this point on, this call acquires the ownership of the sig, fields
name, event_id);
error:
- pthread_mutex_unlock(®istry->lock);
+ pthread_mutex_unlock(®istry->_lock);
error_rcu_unlock:
rcu_read_unlock();
free(sig);
int ret = 0, ret_code;
struct ust_app *app;
struct ust_app_session *ua_sess;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
uint64_t enum_id = -1ULL;
rcu_read_lock();
goto error_rcu_unlock;
}
- pthread_mutex_lock(®istry->lock);
+ pthread_mutex_lock(®istry->_lock);
/*
* From this point on, the callee acquires the ownership of
DBG3("UST registry enum %s added successfully or already found", name);
error:
- pthread_mutex_unlock(®istry->lock);
+ pthread_mutex_unlock(®istry->_lock);
error_rcu_unlock:
rcu_read_unlock();
return ret;
rcu_read_lock();
- obj = (ust_app_notify_sock_obj *) zmalloc(sizeof(*obj));
+ obj = zmalloc<ust_app_notify_sock_obj>();
if (!obj) {
/*
* An ENOMEM is kind of uncool. If this strikes we continue the
char pathname[PATH_MAX];
size_t consumer_path_offset = 0;
- if (!reg->registry->reg.ust->metadata_key) {
+ if (!reg->registry->reg.ust->_metadata_key) {
/* Skip since no metadata is present */
continue;
}
}
}
status = consumer_snapshot_channel(socket,
- reg->registry->reg.ust->metadata_key, output, 1,
+ reg->registry->reg.ust->_metadata_key, output, 1,
&trace_path[consumer_path_offset], 0);
if (status != LTTNG_OK) {
goto error;
struct lttng_ht_iter chan_iter;
struct ust_app_channel *ua_chan;
struct ust_app_session *ua_sess;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
char pathname[PATH_MAX];
size_t consumer_path_offset = 0;
continue;
}
status = consumer_snapshot_channel(socket,
- registry->metadata_key, output, 1,
+ registry->_metadata_key, output, 1,
&trace_path[consumer_path_offset], 0);
switch (status) {
case LTTNG_OK:
* operations (i.e add context) and lead to data
* channels created with no metadata channel.
*/
- if (!reg->registry->reg.ust->metadata_key) {
+ if (!reg->registry->reg.ust->_metadata_key) {
/* Skip since no metadata is present. */
continue;
}
(void) push_metadata(reg->registry->reg.ust, usess->consumer);
ret = consumer_rotate_channel(socket,
- reg->registry->reg.ust->metadata_key,
+ reg->registry->reg.ust->_metadata_key,
usess->consumer,
/* is_metadata_channel */ true);
if (ret < 0) {
struct lttng_ht_iter chan_iter;
struct ust_app_channel *ua_chan;
struct ust_app_session *ua_sess;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
ua_sess = lookup_session_by_app(usess, app);
if (!ua_sess) {
/* Rotate the metadata channel. */
(void) push_metadata(registry, usess->consumer);
ret = consumer_rotate_channel(socket,
- registry->metadata_key,
+ registry->_metadata_key,
ua_sess->consumer,
/* is_metadata_channel */ true);
if (ret < 0) {
cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app,
pid_n.node) {
struct ust_app_session *ua_sess;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
ua_sess = lookup_session_by_app(usess, app);
if (!ua_sess) {
* perform a rotation operation on it behind the scene.
*/
ret = consumer_clear_channel(socket,
- reg->registry->reg.ust->metadata_key);
+ reg->registry->reg.ust->_metadata_key);
if (ret < 0) {
goto error;
}
struct lttng_ht_iter chan_iter;
struct ust_app_channel *ua_chan;
struct ust_app_session *ua_sess;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
ua_sess = lookup_session_by_app(usess, app);
if (!ua_sess) {
* Metadata channel is not cleared per se but we still need to
* perform rotation operation on it behind the scene.
*/
- ret = consumer_clear_channel(socket, registry->metadata_key);
+ ret = consumer_clear_channel(socket, registry->_metadata_key);
if (ret < 0) {
/* Per-PID buffer and application going away. */
if (ret == -LTTNG_ERR_CHAN_NOT_FOUND) {
struct lttng_ht_iter chan_iter;
struct ust_app_channel *ua_chan;
struct ust_app_session *ua_sess;
- struct ust_registry_session *registry;
+ ust_registry_session *registry;
ua_sess = lookup_session_by_app(usess, app);
if (!ua_sess) {