trigger_list =
caa_container_of(node, struct lttng_channel_trigger_list, channel_triggers_ht_node);
- return !!((channel_key->key == trigger_list->channel_key.key) &&
- (channel_key->domain == trigger_list->channel_key.domain));
+ return !((channel_key->key != trigger_list->channel_key.key) ||
+ (channel_key->domain != trigger_list->channel_key.domain));
}
static int match_session_trigger_list(struct cds_lfht_node *node, const void *key)
sample = caa_container_of(node, struct channel_state_sample, channel_state_ht_node);
- return !!((channel_key->key == sample->key.key) &&
- (channel_key->domain == sample->key.domain));
+ return !((channel_key->key != sample->key.key) ||
+ (channel_key->domain != sample->key.domain));
}
static int match_channel_info(struct cds_lfht_node *node, const void *key)
channel_info = caa_container_of(node, struct channel_info, channels_ht_node);
- return !!((channel_key->key == channel_info->key.key) &&
- (channel_key->domain == channel_info->key.domain));
+ return !((channel_key->key != channel_info->key.key) ||
+ (channel_key->domain != channel_info->key.domain));
}
static int match_trigger(struct cds_lfht_node *node, const void *key)
{
struct cds_lfht_iter iter;
struct cds_lfht_node *node;
- lttng::urcu::read_lock_guard read_lock_guard;
+ const lttng::urcu::read_lock_guard read_lock_guard;
cds_lfht_lookup(
state->sessions_ht, hash_session_info_id(id), match_session_info, &id, &iter);
static unsigned long hash_channel_key(struct channel_key *key)
{
- unsigned long key_hash = hash_key_u64(&key->key, lttng_ht_seed);
- unsigned long domain_hash =
+ const unsigned long key_hash = hash_key_u64(&key->key, lttng_ht_seed);
+ const unsigned long domain_hash =
hash_key_ulong((void *) (unsigned long) key->domain, lttng_ht_seed);
return key_hash ^ domain_hash;
}
lttng_session_trigger_list_destroy(session_info->trigger_list);
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_del(session_info->sessions_ht, &session_info->sessions_ht_node);
free(session_info->name);
lttng_trace_archive_location_put(session_info->last_state_sample.rotation.location);
static void session_info_add_channel(struct session_info *session_info,
struct channel_info *channel_info)
{
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_add(session_info->channel_infos_ht,
hash_channel_key(&channel_info->key),
&channel_info->session_info_channels_ht_node);
static void session_info_remove_channel(struct session_info *session_info,
struct channel_info *channel_info)
{
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_del(session_info->channel_infos_ht, &channel_info->session_info_channels_ht_node);
}
lttng_condition_put(list->condition);
if (list->notification_trigger_clients_ht) {
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_del(list->notification_trigger_clients_ht,
&list->notification_trigger_clients_ht_node);
{
/* Build a list of clients to which this new condition applies. */
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_for_each_entry (
state->client_socket_ht, &iter, client, client_socket_ht_node) {
* Add the client list to the global list of client list.
*/
{
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_add_unique(state->notification_trigger_clients_ht,
lttng_condition_hash(client_list->condition),
struct cds_lfht_iter iter;
struct notification_client_list *list = nullptr;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_lookup(state->notification_trigger_clients_ht,
lttng_condition_hash(condition),
match_client_list_condition,
struct channel_state_sample *last_sample = nullptr;
struct lttng_channel_trigger_list *channel_trigger_list = nullptr;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
/* Find the channel associated with the condition. */
cds_lfht_for_each_entry (
/* Publish the list through the session_triggers_ht. */
{
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_add(session_triggers_ht,
hash_key_str(session_name, lttng_ht_seed),
&list->session_triggers_ht_node);
cds_list_del(&trigger_list_element->node);
free(trigger_list_element);
}
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
/* Unpublish the list from the session_triggers_ht. */
cds_lfht_del(list->session_triggers_ht, &list->session_triggers_ht_node);
call_rcu(&list->rcu_node, free_session_trigger_list_rcu);
{
/* Add all triggers applying to the session named 'session_name'. */
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_for_each_entry (state->triggers_ht, &iter, trigger_ht_element, node) {
int ret;
struct session_info *session = nullptr;
struct lttng_session_trigger_list *trigger_list;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
trigger_list = lttng_session_trigger_list_build(state, name);
if (!trigger_list) {
goto error;
int trigger_count = 0;
struct cds_lfht_iter iter;
struct session_info *session_info = nullptr;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
DBG("Adding channel: channel name = `%s`, session id = %" PRIu64 ", channel key = %" PRIu64
", domain = %s",
channel_key,
lttng_domain_type_str(domain));
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_lookup(state->channel_triggers_ht,
hash_channel_key(&key),
struct lttng_credentials session_creds;
struct session_state_sample new_session_state;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
session_info = get_session_info_by_id(state, session_id);
if (!session_info) {
struct lttng_triggers *local_triggers = nullptr;
const struct lttng_credentials *creds;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
local_triggers = lttng_triggers_create();
if (!local_triggers) {
uid_t trigger_owner_uid;
{
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_for_each_entry (state->triggers_ht, &iter, trigger_ht_element, node) {
if (lttng_trigger_is_equal(trigger, trigger_ht_element->trigger)) {
enum action_executor_status executor_status;
const uint64_t trigger_tracer_token = state->trigger_id.next_tracer_token++;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
/* Set the trigger's tracer token. */
lttng_trigger_set_tracer_token(trigger, trigger_tracer_token);
struct notification_trigger_tokens_ht_element *trigger_tokens_ht_element;
{
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_for_each_entry (
state->trigger_tokens_ht, &iter, trigger_tokens_ht_element, node) {
const struct lttng_condition *condition = lttng_trigger_get_const_condition(trigger);
enum lttng_error_code cmd_reply;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_lookup(
state->triggers_ht, lttng_condition_hash(condition), match_trigger, trigger, &iter);
static notification_thread_command *pop_cmd_queue(notification_thread_handle *handle)
{
- lttng::pthread::lock_guard queue_lock(handle->cmd_queue.lock);
+ const lttng::pthread::lock_guard queue_lock(handle->cmd_queue.lock);
uint64_t counter;
const auto read_ret = lttng_read(handle->cmd_queue.event_fd, &counter, sizeof(counter));
cmd->parameters.client_communication_update.id;
struct notification_client *client;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
client = get_client_from_id(client_id, state);
if (!client) {
DBG("Added new notification channel client socket (%i) to poll set", client->socket);
{
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_add(state->client_socket_ht,
hash_client_socket(client->socket),
int ret = 0;
struct notification_client *client;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
DBG("Closing client connection (socket fd = %i)", client_socket);
client = get_client_from_socket(client_socket, state);
DBG("Closing all client connections");
{
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_for_each_entry (
state->client_socket_ht, &iter, client, client_socket_ht_node) {
struct cds_lfht_iter iter;
struct lttng_trigger_ht_element *trigger_ht_element;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_for_each_entry (state->triggers_ht, &iter, trigger_ht_element, node) {
- int ret = handle_notification_thread_command_unregister_trigger(
+ const int ret = handle_notification_thread_command_unregister_trigger(
state, trigger_ht_element->trigger, nullptr);
if (ret) {
error_occurred = true;
ssize_t recv_ret;
size_t offset;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
client = get_client_from_socket(socket, state);
if (!client) {
/* Internal error, abort. */
struct notification_client *client;
enum client_transmission_status transmission_status;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
client = get_client_from_socket(socket, state);
if (!client) {
/* Internal error, abort. */
unsigned int capture_count = 0;
/* Find triggers associated with this token. */
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
cds_lfht_lookup(state->trigger_tokens_ht,
hash_key_u64(¬ification->tracer_token, lttng_ht_seed),
match_trigger_token,
struct lttng_credentials channel_creds = {};
struct lttng_credentials session_creds = {};
struct session_info *session;
- lttng::urcu::read_lock_guard read_lock;
+ const lttng::urcu::read_lock_guard read_lock;
/*
* The monitoring pipe only holds messages smaller than PIPE_BUF,