X-Git-Url: http://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Faction-executor.c;h=418a6de75f6e23edf28dd668aa75b1240a89d54e;hp=4f027fdb91b3e3b30ab8859a05fbf319739cefa7;hb=2516f2d887c20c21cc17ff4cd3b07b3d9ed02244;hpb=34f87583034e1aa9d65ce5d35b09bd5e8cfba875 diff --git a/src/bin/lttng-sessiond/action-executor.c b/src/bin/lttng-sessiond/action-executor.c index 4f027fdb9..418a6de75 100644 --- a/src/bin/lttng-sessiond/action-executor.c +++ b/src/bin/lttng-sessiond/action-executor.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -198,7 +199,9 @@ static int action_executor_notify_handler(struct action_executor *executor, lttng_trigger_get_const_condition(work_item->trigger), work_item->evaluation, lttng_trigger_get_credentials(work_item->trigger), - LTTNG_OPTIONAL_GET_PTR(work_item->object_creds), + work_item->object_creds.is_set ? + &(work_item->object_creds.value) : + NULL, client_handle_transmission_status, executor); } @@ -498,7 +501,7 @@ static int action_executor_generic_handler(struct action_executor *executor, assert(action_type != LTTNG_ACTION_TYPE_UNKNOWN); - DBG("Executing action `%s` of trigger `%p` action work item %" PRIu64, + DBG("Executing action `%s` of trigger `%s` action work item %" PRIu64, get_action_name(action), get_trigger_name(work_item->trigger), work_item->id); @@ -598,8 +601,10 @@ static bool shutdown_action_executor_thread(void *_data) { struct action_executor *executor = _data; + pthread_mutex_lock(&executor->work.lock); executor->should_quit = true; pthread_cond_signal(&executor->work.cond); + pthread_mutex_unlock(&executor->work.lock); return true; } @@ -687,7 +692,7 @@ enum action_executor_status action_executor_enqueue( work_item = zmalloc(sizeof(*work_item)); if (!work_item) { - PERROR("Failed to allocate action executor work item on behalf of trigger `%p`", + PERROR("Failed to allocate action executor work item on behalf of trigger `%s`", get_trigger_name(trigger)); executor_status = ACTION_EXECUTOR_STATUS_ERROR; goto error_unlock; @@ -718,15 +723,15 @@ enum action_executor_status action_executor_enqueue( evaluation = NULL; cds_list_add_tail(&work_item->list_node, &executor->work.list); executor->work.pending_count++; - DBG("Enqueued action for trigger `%p` as work item %" PRIu64, + DBG("Enqueued action for trigger `%s` as work item #%" PRIu64, get_trigger_name(trigger), work_item_id); signal = true; error_unlock: - pthread_mutex_unlock(&executor->work.lock); if (signal) { pthread_cond_signal(&executor->work.cond); } + pthread_mutex_unlock(&executor->work.lock); lttng_evaluation_destroy(evaluation); return executor_status;