X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Faction-executor.c;h=f982b7065e5b357c88b344e3e8805842f1779310;hb=28b3dc1e1eca004cae6023b8e491835ecdfdd041;hp=ca969074382174efb466c6cc278d31676d5bceda;hpb=ff588497b3dfc3138c9ce005e9270ed5568c05df;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/action-executor.c b/src/bin/lttng-sessiond/action-executor.c index ca9690743..f982b7065 100644 --- a/src/bin/lttng-sessiond/action-executor.c +++ b/src/bin/lttng-sessiond/action-executor.c @@ -104,7 +104,11 @@ static const char *action_type_names[] = { static const char *get_action_name(const struct lttng_action *action) { - return action_type_names[lttng_action_get_type(action)]; + const enum lttng_action_type action_type = lttng_action_get_type(action); + + assert(action_type != LTTNG_ACTION_TYPE_UNKNOWN); + + return action_type_names[action_type]; } /* Check if this trigger allowed to interect with a given session. */ @@ -184,8 +188,7 @@ static int action_executor_notify_handler(struct action_executor *executor, work_item->evaluation, lttng_trigger_get_credentials(work_item->trigger), LTTNG_OPTIONAL_GET_PTR(work_item->object_creds), - client_handle_transmission_status, - executor); + client_handle_transmission_status, executor); } static int action_executor_start_session_handler(struct action_executor *executor, @@ -480,12 +483,16 @@ static int action_executor_generic_handler(struct action_executor *executor, const struct action_work_item *work_item, const struct lttng_action *action) { + const enum lttng_action_type action_type = lttng_action_get_type(action); + + assert(action_type != LTTNG_ACTION_TYPE_UNKNOWN); + DBG("Executing action `%s` of trigger `%p` action work item %" PRIu64, get_action_name(action), work_item->trigger, work_item->id); - return action_executors[lttng_action_get_type(action)]( + return action_executors[action_type]( executor, work_item, action); } @@ -540,7 +547,7 @@ static void *action_executor_thread(void *_data) continue; } - /* Pop item from front of the listwith work lock held. */ + /* Pop item from front of the list with work lock held. */ work_item = cds_list_first_entry(&executor->work.list, struct action_work_item, list_node); cds_list_del(&work_item->list_node); @@ -662,8 +669,7 @@ enum action_executor_status action_executor_enqueue( if (executor->work.pending_count >= MAX_QUEUED_WORK_COUNT) { /* Most likely spammy, remove if it is the case. */ DBG("Refusing to enqueue action for trigger `%p` as work item %" PRIu64 - " (overflow)", - trigger, work_item_id); + " (overflow)", trigger, work_item_id); executor_status = ACTION_EXECUTOR_STATUS_OVERFLOW; goto error_unlock; }