*/
static lsu::registry_session *get_session_registry(const struct ust_app_session *ua_sess)
{
- lsu::registry_session *registry = NULL;
+ lsu::registry_session *registry = nullptr;
LTTNG_ASSERT(ua_sess);
/*
* Return the incremented value of next_channel_key.
*/
-static uint64_t get_next_channel_key(void)
+static uint64_t get_next_channel_key()
{
uint64_t ret;
/*
* Return the atomically incremented value of next_session_id.
*/
-static uint64_t get_next_session_id(void)
+static uint64_t get_next_session_id()
{
uint64_t ret;
ASSERT_RCU_READ_LOCKED();
free(ua_event->filter);
- if (ua_event->exclusion != NULL)
+ if (ua_event->exclusion != nullptr)
free(ua_event->exclusion);
- if (ua_event->obj != NULL) {
+ if (ua_event->obj != nullptr) {
pthread_mutex_lock(&app->sock_lock);
ret = lttng_ust_ctl_release_object(sock, ua_event->obj);
pthread_mutex_unlock(&app->sock_lock);
LTTNG_ASSERT(ua_event_notifier_rule);
- if (ua_event_notifier_rule->exclusion != NULL) {
+ if (ua_event_notifier_rule->exclusion != nullptr) {
free(ua_event_notifier_rule->exclusion);
}
- if (ua_event_notifier_rule->obj != NULL) {
+ if (ua_event_notifier_rule->obj != nullptr) {
pthread_mutex_lock(&app->sock_lock);
ret = lttng_ust_ctl_release_object(sock, ua_event_notifier_rule->obj);
pthread_mutex_unlock(&app->sock_lock);
}
}
- if (ua_chan->obj != NULL) {
+ if (ua_chan->obj != nullptr) {
/* Remove channel from application UST object descriptor. */
iter.iter.node = &ua_chan->ust_objd_node.node;
ret = lttng_ht_del(app->ust_objd, &iter);
int send_zero_data)
{
int ret;
- char *metadata_str = NULL;
+ char *metadata_str = nullptr;
size_t len, offset, new_metadata_len_sent;
ssize_t ret_val;
uint64_t metadata_key, metadata_version;
/*
* Alloc new UST app session.
*/
-static struct ust_app_session *alloc_ust_app_session(void)
+static struct ust_app_session *alloc_ust_app_session()
{
struct ust_app_session *ua_sess;
/* Init most of the default value by allocating and zeroing */
ua_sess = zmalloc<ust_app_session>();
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
PERROR("malloc");
goto error_free;
}
ua_sess->handle = -1;
ua_sess->channels = lttng_ht_new(0, LTTNG_HT_TYPE_STRING);
ua_sess->metadata_attr.type = LTTNG_UST_ABI_CHAN_METADATA;
- pthread_mutex_init(&ua_sess->lock, NULL);
+ pthread_mutex_init(&ua_sess->lock, nullptr);
return ua_sess;
error_free:
- return NULL;
+ return nullptr;
}
/*
/* Init most of the default value by allocating and zeroing */
ua_chan = zmalloc<ust_app_channel>();
- if (ua_chan == NULL) {
+ if (ua_chan == nullptr) {
PERROR("malloc");
goto error;
}
return ua_chan;
error:
- return NULL;
+ return nullptr;
}
/*
*
* Return newly allocated stream pointer or NULL on error.
*/
-struct ust_app_stream *ust_app_alloc_stream(void)
+struct ust_app_stream *ust_app_alloc_stream()
{
- struct ust_app_stream *stream = NULL;
+ struct ust_app_stream *stream = nullptr;
stream = zmalloc<ust_app_stream>();
- if (stream == NULL) {
+ if (stream == nullptr) {
PERROR("zmalloc ust app stream");
goto error;
}
/* Init most of the default value by allocating and zeroing */
ua_event = zmalloc<ust_app_event>();
- if (ua_event == NULL) {
+ if (ua_event == nullptr) {
PERROR("Failed to allocate ust_app_event structure");
goto error;
}
return ua_event;
error:
- return NULL;
+ return nullptr;
}
/*
enum lttng_event_rule_generate_exclusions_status generate_exclusion_status;
enum lttng_condition_status cond_status;
struct ust_app_event_notifier_rule *ua_event_notifier_rule;
- struct lttng_condition *condition = NULL;
- const struct lttng_event_rule *event_rule = NULL;
+ struct lttng_condition *condition = nullptr;
+ const struct lttng_event_rule *event_rule = nullptr;
ua_event_notifier_rule = zmalloc<ust_app_event_notifier_rule>();
- if (ua_event_notifier_rule == NULL) {
+ if (ua_event_notifier_rule == nullptr) {
PERROR("Failed to allocate ust_app_event_notifier_rule structure");
goto error;
}
lttng_trigger_put(trigger);
error:
free(ua_event_notifier_rule);
- return NULL;
+ return nullptr;
}
/*
struct ust_app_ctx *ua_ctx;
ua_ctx = zmalloc<ust_app_ctx>();
- if (ua_ctx == NULL) {
+ if (ua_ctx == nullptr) {
goto error;
}
if (uctx) {
memcpy(&ua_ctx->ctx, uctx, sizeof(ua_ctx->ctx));
if (uctx->ctx == LTTNG_UST_ABI_CONTEXT_APP_CONTEXT) {
- char *provider_name = NULL, *ctx_name = NULL;
+ char *provider_name = nullptr, *ctx_name = nullptr;
provider_name = strdup(uctx->u.app_ctx.provider_name);
ctx_name = strdup(uctx->u.app_ctx.ctx_name);
return ua_ctx;
error:
free(ua_ctx);
- return NULL;
+ return nullptr;
}
/*
static struct lttng_ust_abi_filter_bytecode *
create_ust_filter_bytecode_from_bytecode(const struct lttng_bytecode *orig_f)
{
- struct lttng_ust_abi_filter_bytecode *filter = NULL;
+ struct lttng_ust_abi_filter_bytecode *filter = nullptr;
/* Copy filter bytecode. */
filter = zmalloc<lttng_ust_abi_filter_bytecode>(sizeof(*filter) + orig_f->len);
static struct lttng_ust_abi_capture_bytecode *
create_ust_capture_bytecode_from_bytecode(const struct lttng_bytecode *orig_f)
{
- struct lttng_ust_abi_capture_bytecode *capture = NULL;
+ struct lttng_ust_abi_capture_bytecode *capture = nullptr;
/* Copy capture bytecode. */
capture = zmalloc<lttng_ust_abi_capture_bytecode>(sizeof(*capture) + orig_f->len);
lttng_ht_lookup(ust_app_ht_by_sock, (void *) ((unsigned long) sock), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
- if (node == NULL) {
+ if (node == nullptr) {
DBG2("UST app find by sock %d not found", sock);
goto error;
}
return lttng::utils::container_of(node, &ust_app::sock_n);
error:
- return NULL;
+ return nullptr;
}
/*
lttng_ht_lookup(ust_app_ht_by_notify_sock, (void *) ((unsigned long) sock), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
- if (node == NULL) {
+ if (node == nullptr) {
DBG2("UST app find by notify sock %d not found", sock);
goto error;
}
return lttng::utils::container_of(node, &ust_app::notify_sock_n);
error:
- return NULL;
+ return nullptr;
}
/*
{
struct lttng_ht_iter iter;
struct lttng_ht_node_str *node;
- struct ust_app_event *event = NULL;
+ struct ust_app_event *event = nullptr;
struct ust_app_ht_key key;
LTTNG_ASSERT(name);
&key,
&iter.iter);
node = lttng_ht_iter_get_node_str(&iter);
- if (node == NULL) {
+ if (node == nullptr) {
goto end;
}
{
struct lttng_ht_iter iter;
struct lttng_ht_node_u64 *node;
- struct ust_app_event_notifier_rule *event_notifier_rule = NULL;
+ struct ust_app_event_notifier_rule *event_notifier_rule = nullptr;
LTTNG_ASSERT(ht);
ASSERT_RCU_READ_LOCKED();
lttng_ht_lookup(ht, &token, &iter);
node = lttng_ht_iter_get_node_u64(&iter);
- if (node == NULL) {
+ if (node == nullptr) {
DBG2("UST app event notifier rule token not found: token = %" PRIu64, token);
goto end;
}
struct lttng_ust_abi_object_data *ust_object)
{
int ret;
- struct lttng_ust_abi_filter_bytecode *ust_bytecode = NULL;
+ struct lttng_ust_abi_filter_bytecode *ust_bytecode = nullptr;
health_code_update();
struct lttng_ust_abi_object_data *ust_object)
{
int ret;
- struct lttng_ust_abi_capture_bytecode *ust_bytecode = NULL;
+ struct lttng_ust_abi_capture_bytecode *ust_bytecode = nullptr;
health_code_update();
static struct lttng_ust_abi_event_exclusion *
create_ust_exclusion_from_exclusion(const struct lttng_event_exclusion *exclusion)
{
- struct lttng_ust_abi_event_exclusion *ust_exclusion = NULL;
+ struct lttng_ust_abi_event_exclusion *ust_exclusion = nullptr;
size_t exclusion_alloc_size = sizeof(struct lttng_ust_abi_event_exclusion) +
LTTNG_UST_ABI_SYM_NAME_LEN * exclusion->count;
struct lttng_ust_abi_object_data *ust_object)
{
int ret;
- struct lttng_ust_abi_event_exclusion *ust_exclusions = NULL;
+ struct lttng_ust_abi_event_exclusion *ust_exclusions = nullptr;
LTTNG_ASSERT(exclusions && exclusions->count > 0);
{
int ret = 0;
enum lttng_condition_status condition_status;
- const struct lttng_condition *condition = NULL;
+ const struct lttng_condition *condition = nullptr;
struct lttng_ust_abi_event_notifier event_notifier;
- const struct lttng_event_rule *event_rule = NULL;
+ const struct lttng_event_rule *event_rule = nullptr;
unsigned int capture_bytecode_count = 0, i;
enum lttng_condition_status cond_status;
enum lttng_event_rule_type event_rule_type;
exclusion_alloc_size = sizeof(struct lttng_event_exclusion) +
LTTNG_UST_ABI_SYM_NAME_LEN * uevent->exclusion->count;
ua_event->exclusion = zmalloc<lttng_event_exclusion>(exclusion_alloc_size);
- if (ua_event->exclusion == NULL) {
+ if (ua_event->exclusion == nullptr) {
PERROR("malloc");
} else {
memcpy(ua_event->exclusion, uevent->exclusion, exclusion_alloc_size);
__lookup_session_by_app(usess, app, &iter);
node = lttng_ht_iter_get_node_u64(&iter);
- if (node == NULL) {
+ if (node == nullptr) {
goto error;
}
return lttng::utils::container_of(node, &ust_app_session::node);
error:
- return NULL;
+ return nullptr;
}
/*
* that if the buffer registry can be found, its ust registry is
* non-NULL.
*/
- buffer_reg_uid_destroy(reg_uid, NULL);
+ buffer_reg_uid_destroy(reg_uid, nullptr);
goto error;
}
health_code_update();
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
DBG2("UST app pid: %d session id %" PRIu64 " not found, creating it",
app->pid,
usess->id);
ua_sess = alloc_ust_app_session();
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
/* Only malloc can failed so something is really wrong */
ret = -ENOMEM;
goto error;
switch (usess->buffer_type) {
case LTTNG_BUFFER_PER_PID:
/* Init local registry. */
- ret = setup_buffer_reg_pid(ua_sess, app, NULL);
+ ret = setup_buffer_reg_pid(ua_sess, app, nullptr);
if (ret < 0) {
delete_ust_app_session(-1, ua_sess, app);
goto error;
break;
case LTTNG_BUFFER_PER_UID:
/* Look for a global registry. If none exists, create one. */
- ret = setup_buffer_reg_uid(usess, ua_sess, app, NULL);
+ ret = setup_buffer_reg_uid(usess, ua_sess, app, nullptr);
if (ret < 0) {
delete_ust_app_session(-1, ua_sess, app);
goto error;
case LTTNG_UST_ABI_CONTEXT_PERF_THREAD_COUNTER:
if (strncmp(key->u.perf_counter.name,
ctx->ctx.u.perf_counter.name,
- sizeof(key->u.perf_counter.name))) {
+ sizeof(key->u.perf_counter.name)) != 0) {
goto no_match;
}
break;
case LTTNG_UST_ABI_CONTEXT_APP_CONTEXT:
- if (strcmp(key->u.app_ctx.provider_name, ctx->ctx.u.app_ctx.provider_name) ||
- strcmp(key->u.app_ctx.ctx_name, ctx->ctx.u.app_ctx.ctx_name)) {
+ if (strcmp(key->u.app_ctx.provider_name, ctx->ctx.u.app_ctx.provider_name) != 0 ||
+ strcmp(key->u.app_ctx.ctx_name, ctx->ctx.u.app_ctx.ctx_name) != 0) {
goto no_match;
}
break;
{
struct lttng_ht_iter iter;
struct lttng_ht_node_ulong *node;
- struct ust_app_ctx *app_ctx = NULL;
+ struct ust_app_ctx *app_ctx = nullptr;
LTTNG_ASSERT(uctx);
LTTNG_ASSERT(ht);
}
ua_ctx = alloc_ust_app_ctx(uctx);
- if (ua_ctx == NULL) {
+ if (ua_ctx == nullptr) {
/* malloc failed */
ret = -ENOMEM;
goto error;
lttng_ht_lookup(ua_sess->channels, (void *) uchan->name, &iter);
ua_chan_node = lttng_ht_iter_get_node_str(&iter);
- if (ua_chan_node == NULL) {
+ if (ua_chan_node == nullptr) {
DBG2("Unable to find channel %s in ust session id %" PRIu64,
uchan->name,
ua_sess->tracing_id);
* stream call does not release the object.
*/
reg_stream->obj.ust = stream->obj;
- stream->obj = NULL;
+ stream->obj = nullptr;
buffer_reg_stream_add(reg_stream, buf_reg_chan);
/* We don't need the streams anymore. */
struct buffer_reg_channel **regp)
{
int ret;
- struct buffer_reg_channel *buf_reg_chan = NULL;
+ struct buffer_reg_channel *buf_reg_chan = nullptr;
LTTNG_ASSERT(reg_sess);
LTTNG_ASSERT(ua_chan);
}
buf_reg_chan->obj.ust = ua_chan->obj;
- ua_chan->obj = NULL;
+ ua_chan->obj = nullptr;
return 0;
int ret;
struct buffer_reg_uid *reg_uid;
struct buffer_reg_channel *buf_reg_chan;
- struct ltt_session *session = NULL;
+ struct ltt_session *session = nullptr;
enum lttng_error_code notification_ret;
LTTNG_ASSERT(app);
int ret;
lsu::registry_session *registry;
enum lttng_error_code cmd_ret;
- struct ltt_session *session = NULL;
+ struct ltt_session *session = nullptr;
uint64_t chan_reg_key;
LTTNG_ASSERT(app);
/* Lookup channel in the ust app session */
lttng_ht_lookup(ua_sess->channels, (void *) uchan->name, &iter);
ua_chan_node = lttng_ht_iter_get_node_str(&iter);
- if (ua_chan_node != NULL) {
+ if (ua_chan_node != nullptr) {
ua_chan = lttng::utils::container_of(ua_chan_node, &ust_app_channel::node);
goto end;
}
ua_chan = alloc_ust_app_channel(uchan->name, ua_sess, &uchan->attr);
- if (ua_chan == NULL) {
+ if (ua_chan == nullptr) {
/* Only malloc can fail here */
ret = -ENOMEM;
goto error;
ASSERT_RCU_READ_LOCKED();
ua_event = alloc_ust_app_event(uevent->attr.name, &uevent->attr);
- if (ua_event == NULL) {
+ if (ua_event == nullptr) {
/* Only failure mode of alloc_ust_app_event(). */
ret = -ENOMEM;
goto end;
ASSERT_RCU_READ_LOCKED();
ua_event_notifier_rule = alloc_ust_app_event_notifier_rule(trigger);
- if (ua_event_notifier_rule == NULL) {
+ if (ua_event_notifier_rule == nullptr) {
ret = -ENOMEM;
goto end;
}
int ret = 0;
struct ust_app_channel *metadata;
struct consumer_socket *socket;
- struct ltt_session *session = NULL;
+ struct ltt_session *session = nullptr;
LTTNG_ASSERT(ua_sess);
LTTNG_ASSERT(app);
}
/* Allocate UST metadata */
- metadata = alloc_ust_app_channel(DEFAULT_METADATA_NAME, ua_sess, NULL);
+ metadata = alloc_ust_app_channel(DEFAULT_METADATA_NAME, ua_sess, nullptr);
if (!metadata) {
/* malloc() failed */
ret = -ENOMEM;
*/
struct ust_app *ust_app_find_by_pid(pid_t pid)
{
- struct ust_app *app = NULL;
+ struct ust_app *app = nullptr;
struct lttng_ht_node_ulong *node;
struct lttng_ht_iter iter;
lttng_ht_lookup(ust_app_ht, (void *) ((unsigned long) pid), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
- if (node == NULL) {
+ if (node == nullptr) {
DBG2("UST app no found with pid %d", pid);
goto error;
}
struct ust_app *ust_app_create(struct ust_register_msg *msg, int sock)
{
int ret;
- struct ust_app *lta = NULL;
- struct lttng_pipe *event_notifier_event_source_pipe = NULL;
+ struct ust_app *lta = nullptr;
+ struct lttng_pipe *event_notifier_event_source_pipe = nullptr;
LTTNG_ASSERT(msg);
LTTNG_ASSERT(sock >= 0);
}
lta = zmalloc<ust_app>();
- if (lta == NULL) {
+ if (lta == nullptr) {
PERROR("malloc");
goto error_free_pipe;
}
lta->pid = msg->pid;
lttng_ht_node_init_ulong(<a->pid_n, (unsigned long) lta->pid);
lta->sock = sock;
- pthread_mutex_init(<a->sock_lock, NULL);
+ pthread_mutex_init(<a->sock_lock, nullptr);
lttng_ht_node_init_ulong(<a->sock_n, (unsigned long) lta->sock);
CDS_INIT_LIST_HEAD(<a->teardown_head);
lttng_pipe_destroy(event_notifier_event_source_pipe);
lttng_fd_put(LTTNG_FD_APPS, 2);
error:
- return NULL;
+ return nullptr;
}
/*
LTTNG_ASSERT(app);
LTTNG_ASSERT(app->notify_sock >= 0);
- app->registration_time = time(NULL);
+ app->registration_time = time(nullptr);
rcu_read_lock();
{
int ret;
int event_pipe_write_fd;
- struct lttng_ust_abi_object_data *event_notifier_group = NULL;
+ struct lttng_ust_abi_object_data *event_notifier_group = nullptr;
enum lttng_error_code lttng_ret;
enum event_notifier_error_accounting_status event_notifier_error_accounting_status;
error:
lttng_ust_ctl_release_object(app->sock, app->event_notifier_group.object);
free(app->event_notifier_group.object);
- app->event_notifier_group.object = NULL;
+ app->event_notifier_group.object = nullptr;
return ret;
}
nbmem = UST_APP_EVENT_LIST_SIZE;
tmp_event = calloc<lttng_event>(nbmem);
- if (tmp_event == NULL) {
+ if (tmp_event == nullptr) {
PERROR("zmalloc ust app events");
ret = -ENOMEM;
goto error;
new_nbmem);
new_tmp_event = (lttng_event *) realloc(
tmp_event, new_nbmem * sizeof(struct lttng_event));
- if (new_tmp_event == NULL) {
+ if (new_tmp_event == nullptr) {
int release_ret;
PERROR("realloc ust app events");
nbmem = UST_APP_EVENT_LIST_SIZE;
tmp_event = calloc<lttng_event_field>(nbmem);
- if (tmp_event == NULL) {
+ if (tmp_event == nullptr) {
PERROR("zmalloc ust app event fields");
ret = -ENOMEM;
goto error;
new_nbmem);
new_tmp_event = (lttng_event_field *) realloc(
tmp_event, new_nbmem * sizeof(struct lttng_event_field));
- if (new_tmp_event == NULL) {
+ if (new_tmp_event == nullptr) {
int release_ret;
PERROR("realloc ust app event fields");
/*
* Free and clean all traceable apps of the global list.
*/
-void ust_app_clean_list(void)
+void ust_app_clean_list()
{
int ret;
struct ust_app *app;
/*
* Init UST app hash table.
*/
-int ust_app_ht_alloc(void)
+int ust_app_ht_alloc()
{
ust_app_ht = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
if (!ust_app_ht) {
continue;
}
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
continue;
}
continue;
}
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
continue;
}
continue;
}
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
/* Next app */
continue;
}
/* Lookup channel in the ust app session */
lttng_ht_lookup(ua_sess->channels, (void *) uchan->name, &uiter);
ua_chan_node = lttng_ht_iter_get_node_str(&uiter);
- if (ua_chan_node == NULL) {
+ if (ua_chan_node == nullptr) {
DBG2("Channel %s not found in session id %" PRIu64 " for app pid %d."
"Skipping",
uchan->name,
uevent->filter,
uevent->attr.loglevel,
uevent->exclusion);
- if (ua_event == NULL) {
+ if (ua_event == nullptr) {
DBG2("Event %s not found in channel %s for app pid %d."
"Skipping",
uevent->attr.name,
struct ust_app_channel **_ua_chan)
{
int ret = 0;
- struct ust_app_channel *ua_chan = NULL;
+ struct ust_app_channel *ua_chan = nullptr;
LTTNG_ASSERT(ua_sess);
ASSERT_LOCKED(ua_sess->lock);
copy_channel_attr_to_ustctl(&ua_sess->metadata_attr, &uchan->attr);
ret = 0;
} else {
- struct ltt_ust_context *uctx = NULL;
+ struct ltt_ust_context *uctx = nullptr;
/*
* Create channel onto application and synchronize its
uevent->filter,
uevent->attr.loglevel,
uevent->exclusion);
- if (ua_event == NULL) {
+ if (ua_event == nullptr) {
DBG3("UST app enable event %s not found for app PID %d."
"Skipping app",
uevent->attr.name,
}
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
/* The session is in teardown process. Ignore and continue. */
goto end;
}
}
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
goto end_no_session;
}
cds_lfht_for_each_entry (ust_app_ht->ht, &iter.iter, app, pid_n.node) {
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
continue;
}
(void) ust_app_flush_app_session(app, ua_sess);
cds_lfht_for_each_entry (ust_app_ht->ht, &iter.iter, app, pid_n.node) {
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
continue;
}
(void) ust_app_clear_quiescent_app_session(app, ua_sess);
__lookup_session_by_app(usess, app, &iter);
node = lttng_ht_iter_get_node_u64(&iter);
- if (node == NULL) {
+ if (node == nullptr) {
/* Session is being or is deleted. */
goto end;
}
struct ust_app *app)
{
int ret = 0;
- struct ust_app_event *ua_event = NULL;
+ struct ust_app_event *ua_event = nullptr;
ua_event = find_ust_app_event(ua_chan->events,
uevent->attr.name,
enum lttng_error_code ret_code;
enum lttng_trigger_status t_status;
struct lttng_ht_iter app_trigger_iter;
- struct lttng_triggers *triggers = NULL;
+ struct lttng_triggers *triggers = nullptr;
struct ust_app_event_notifier_rule *event_notifier_rule;
unsigned int count, i;
static void ust_app_synchronize(struct ltt_ust_session *usess, struct ust_app *app)
{
int ret = 0;
- struct ust_app_session *ua_sess = NULL;
+ struct ust_app_session *ua_sess = nullptr;
/*
* The application's configuration should only be synchronized for
*/
LTTNG_ASSERT(usess->active);
- ret = find_or_create_ust_app_session(usess, app, &ua_sess, NULL);
+ ret = find_or_create_ust_app_session(usess, app, &ua_sess, nullptr);
if (ret < 0) {
/* Tracer is probably gone or ENOMEM. */
if (ua_sess) {
struct ust_app_session *ua_sess;
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
return;
}
destroy_app_session(app, ua_sess);
return;
}
- if (app->event_notifier_group.object == NULL) {
+ if (app->event_notifier_group.object == nullptr) {
WARN("UST app global update of event notifiers for app skipped since communication handle is null: app = '%s', pid = %d",
app->name,
app->pid);
rcu_read_unlock();
}
-void ust_app_global_update_all_event_notifier_rules(void)
+void ust_app_global_update_all_event_notifier_rules()
{
struct lttng_ht_iter iter;
struct ust_app *app;
int ret = 0;
struct lttng_ht_node_str *ua_chan_node;
struct lttng_ht_iter iter, uiter;
- struct ust_app_channel *ua_chan = NULL;
+ struct ust_app_channel *ua_chan = nullptr;
struct ust_app_session *ua_sess;
struct ust_app *app;
continue;
}
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
continue;
}
/* Lookup channel in the ust app session */
lttng_ht_lookup(ua_sess->channels, (void *) uchan->name, &uiter);
ua_chan_node = lttng_ht_iter_get_node_str(&uiter);
- if (ua_chan_node == NULL) {
+ if (ua_chan_node == nullptr) {
goto next_app;
}
ua_chan = caa_container_of(ua_chan_node, struct ust_app_channel, node);
{
struct lttng_ht_node_ulong *node;
struct lttng_ht_iter iter;
- struct ust_app_session *ua_sess = NULL;
+ struct ust_app_session *ua_sess = nullptr;
LTTNG_ASSERT(app);
ASSERT_RCU_READ_LOCKED();
lttng_ht_lookup(app->ust_sessions_objd, (void *) ((unsigned long) objd), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
- if (node == NULL) {
+ if (node == nullptr) {
DBG2("UST app session find by objd %d not found", objd);
goto error;
}
{
struct lttng_ht_node_ulong *node;
struct lttng_ht_iter iter;
- struct ust_app_channel *ua_chan = NULL;
+ struct ust_app_channel *ua_chan = nullptr;
LTTNG_ASSERT(app);
ASSERT_RCU_READ_LOCKED();
lttng_ht_lookup(app->ust_objd, (void *) ((unsigned long) objd), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
- if (node == NULL) {
+ if (node == nullptr) {
DBG2("UST app channel find by objd %d not found", objd);
goto error;
}
enum lttng_error_code status = LTTNG_OK;
struct lttng_ht_iter iter;
struct ust_app *app;
- char *trace_path = NULL;
+ char *trace_path = nullptr;
LTTNG_ASSERT(usess);
LTTNG_ASSERT(output);
struct lttng_ht_iter uiter;
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
continue;
}
rcu_read_lock();
ua_sess = lookup_session_by_app(usess, app);
- if (ua_sess == NULL) {
+ if (ua_sess == nullptr) {
/* The session is in teardown process. Ignore and continue. */
goto end;
}