projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: sessiond: cmd_enable_channel: negative error code used
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
notification-thread-events.cpp
diff --git
a/src/bin/lttng-sessiond/notification-thread-events.cpp
b/src/bin/lttng-sessiond/notification-thread-events.cpp
index 6f449fc638cef0df78f88c8abcc5d575f6376ad6..9e1aa5300b8416e68fdc4672da8beedce66fc985 100644
(file)
--- a/
src/bin/lttng-sessiond/notification-thread-events.cpp
+++ b/
src/bin/lttng-sessiond/notification-thread-events.cpp
@@
-1031,8
+1031,15
@@
int evaluate_condition_for_client(const struct lttng_trigger *trigger,
struct lttng_evaluation *evaluation = NULL;
struct notification_client_list client_list = {
.lock = PTHREAD_MUTEX_INITIALIZER,
struct lttng_evaluation *evaluation = NULL;
struct notification_client_list client_list = {
.lock = PTHREAD_MUTEX_INITIALIZER,
+ .ref = {},
+ .condition = NULL,
+ .triggers_list = {},
+ .clients_list = {},
+ .notification_trigger_clients_ht = NULL,
+ .notification_trigger_clients_ht_node = {},
+ .rcu_node = {},
};
};
- struct notification_client_list_element client_list_element = {
0
};
+ struct notification_client_list_element client_list_element = {};
uid_t object_uid = 0;
gid_t object_gid = 0;
uid_t object_uid = 0;
gid_t object_gid = 0;
@@
-1279,8
+1286,7
@@
void free_notification_client_rcu(struct rcu_head *node)
}
static
}
static
-void notification_client_destroy(struct notification_client *client,
- struct notification_thread_state *state)
+void notification_client_destroy(struct notification_client *client)
{
if (!client) {
return;
{
if (!client) {
return;
@@
-1313,6
+1319,8
@@
struct notification_client *get_client_from_socket(int socket,
struct cds_lfht_node *node;
struct notification_client *client = NULL;
struct cds_lfht_node *node;
struct notification_client *client = NULL;
+ ASSERT_RCU_READ_LOCKED();
+
cds_lfht_lookup(state->client_socket_ht,
hash_client_socket(socket),
match_client_socket,
cds_lfht_lookup(state->client_socket_ht,
hash_client_socket(socket),
match_client_socket,
@@
-1341,6
+1349,8
@@
struct notification_client *get_client_from_id(notification_client_id id,
struct cds_lfht_node *node;
struct notification_client *client = NULL;
struct cds_lfht_node *node;
struct notification_client *client = NULL;
+ ASSERT_RCU_READ_LOCKED();
+
cds_lfht_lookup(state->client_id_ht,
hash_client_id(id),
match_client_id,
cds_lfht_lookup(state->client_id_ht,
hash_client_id(id),
match_client_id,
@@
-1456,6
+1466,8
@@
struct lttng_session_trigger_list *get_session_trigger_list(
struct cds_lfht_node *node;
struct cds_lfht_iter iter;
struct cds_lfht_node *node;
struct cds_lfht_iter iter;
+ ASSERT_RCU_READ_LOCKED();
+
cds_lfht_lookup(state->session_triggers_ht,
hash_key_str(session_name, lttng_ht_seed),
match_session_trigger_list,
cds_lfht_lookup(state->session_triggers_ht,
hash_key_str(session_name, lttng_ht_seed),
match_session_trigger_list,
@@
-2059,7
+2071,7
@@
int drain_event_notifier_notification_pipe(
struct notification_thread_state *state,
int pipe, enum lttng_domain_type domain)
{
struct notification_thread_state *state,
int pipe, enum lttng_domain_type domain)
{
- struct lttng_poll_event events = {
0
};
+ struct lttng_poll_event events = {};
int ret;
ret = lttng_poll_create(&events, 1, LTTNG_CLOEXEC);
int ret;
ret = lttng_poll_create(&events, 1, LTTNG_CLOEXEC);
@@
-2227,7
+2239,7
@@
end:
}
static int handle_notification_thread_command_list_triggers(
}
static int handle_notification_thread_command_list_triggers(
- struct notification_thread_handle *handle,
+ struct notification_thread_handle *handle
__attribute__((unused))
,
struct notification_thread_state *state,
uid_t client_uid,
struct lttng_triggers **triggers,
struct notification_thread_state *state,
uid_t client_uid,
struct lttng_triggers **triggers,
@@
-2418,6
+2430,8
@@
int bind_trigger_to_matching_session(struct lttng_trigger *trigger,
const char *session_name;
struct lttng_session_trigger_list *trigger_list;
const char *session_name;
struct lttng_session_trigger_list *trigger_list;
+ ASSERT_RCU_READ_LOCKED();
+
condition = lttng_trigger_get_const_condition(trigger);
switch (lttng_condition_get_type(condition)) {
case LTTNG_CONDITION_TYPE_SESSION_ROTATION_ONGOING:
condition = lttng_trigger_get_const_condition(trigger);
switch (lttng_condition_get_type(condition)) {
case LTTNG_CONDITION_TYPE_SESSION_ROTATION_ONGOING:
@@
-2464,6
+2478,8
@@
int bind_trigger_to_matching_channels(struct lttng_trigger *trigger,
struct cds_lfht_iter iter;
struct channel_info *channel;
struct cds_lfht_iter iter;
struct channel_info *channel;
+ ASSERT_RCU_READ_LOCKED();
+
cds_lfht_for_each_entry(state->channels_ht, &iter, channel,
channels_ht_node) {
struct lttng_trigger_list_element *trigger_list_element;
cds_lfht_for_each_entry(state->channels_ht, &iter, channel,
channels_ht_node) {
struct lttng_trigger_list_element *trigger_list_element;
@@
-3386,7
+3402,7
@@
int handle_notification_thread_client_connect(
return ret;
error:
return ret;
error:
- notification_client_destroy(client
, state
);
+ notification_client_destroy(client);
return ret;
}
return ret;
}
@@
-3402,6
+3418,8
@@
int notification_thread_client_disconnect(
int ret;
struct lttng_condition_list_element *condition_list_element, *tmp;
int ret;
struct lttng_condition_list_element *condition_list_element, *tmp;
+ ASSERT_RCU_READ_LOCKED();
+
/* Acquire the client lock to disable its communication atomically. */
pthread_mutex_lock(&client->lock);
client->communication.active = false;
/* Acquire the client lock to disable its communication atomically. */
pthread_mutex_lock(&client->lock);
client->communication.active = false;
@@
-3426,7
+3444,7
@@
int notification_thread_client_disconnect(
* Client no longer accessible to other threads (through the
* client lists).
*/
* Client no longer accessible to other threads (through the
* client lists).
*/
- notification_client_destroy(client
, state
);
+ notification_client_destroy(client);
return ret;
}
return ret;
}
@@
-3689,6
+3707,7
@@
int client_send_command_reply(struct notification_client *client,
struct lttng_notification_channel_message msg = {
.type = (int8_t) LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_COMMAND_REPLY,
.size = sizeof(reply),
struct lttng_notification_channel_message msg = {
.type = (int8_t) LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_COMMAND_REPLY,
.size = sizeof(reply),
+ .fds = 0,
};
char buffer[sizeof(msg) + sizeof(reply)];
enum client_transmission_status transmission_status;
};
char buffer[sizeof(msg) + sizeof(reply)];
enum client_transmission_status transmission_status;
@@
-3734,7
+3753,7
@@
error:
static
int client_handle_message_unknown(struct notification_client *client,
static
int client_handle_message_unknown(struct notification_client *client,
- struct notification_thread_state *state)
+ struct notification_thread_state *state
__attribute__((unused))
)
{
int ret;
/*
{
int ret;
/*
@@
-3793,6
+3812,7
@@
int client_handle_message_handshake(struct notification_client *client,
const struct lttng_notification_channel_message msg_header = {
.type = LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_HANDSHAKE,
.size = sizeof(handshake_reply),
const struct lttng_notification_channel_message msg_header = {
.type = LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_HANDSHAKE,
.size = sizeof(handshake_reply),
+ .fds = 0,
};
enum lttng_notification_channel_status status =
LTTNG_NOTIFICATION_CHANNEL_STATUS_OK;
};
enum lttng_notification_channel_status status =
LTTNG_NOTIFICATION_CHANNEL_STATUS_OK;
@@
-4174,7
+4194,7
@@
bool evaluate_session_consumed_size_condition(
static
int evaluate_buffer_condition(const struct lttng_condition *condition,
struct lttng_evaluation **evaluation,
static
int evaluate_buffer_condition(const struct lttng_condition *condition,
struct lttng_evaluation **evaluation,
- const struct notification_thread_state *state,
+ const struct notification_thread_state *state
__attribute__((unused))
,
const struct channel_state_sample *previous_sample,
const struct channel_state_sample *latest_sample,
uint64_t previous_session_consumed_total,
const struct channel_state_sample *previous_sample,
const struct channel_state_sample *latest_sample,
uint64_t previous_session_consumed_total,
@@
-4263,6
+4283,8
@@
int client_notification_overflow(struct notification_client *client)
int ret = 0;
const struct lttng_notification_channel_message msg = {
.type = (int8_t) LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_NOTIFICATION_DROPPED,
int ret = 0;
const struct lttng_notification_channel_message msg = {
.type = (int8_t) LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_NOTIFICATION_DROPPED,
+ .size = 0,
+ .fds = 0,
};
ASSERT_LOCKED(client->lock);
};
ASSERT_LOCKED(client->lock);
@@
-4367,6
+4389,8
@@
int notification_client_list_send_evaluation(
};
struct lttng_notification_channel_message msg_header = {
.type = (int8_t) LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_NOTIFICATION,
};
struct lttng_notification_channel_message msg_header = {
.type = (int8_t) LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_NOTIFICATION,
+ .size = 0,
+ .fds = 0,
};
const struct lttng_credentials *trigger_creds =
lttng_trigger_get_credentials(trigger);
};
const struct lttng_credentials *trigger_creds =
lttng_trigger_get_credentials(trigger);
This page took
0.026018 seconds
and
4
git commands to generate.