From 7c2fae7c05b6eb686317f9c443366f046f0a2757 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 22 Apr 2021 14:56:59 -0400 Subject: [PATCH] action list: missing renames from previous name "group" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau Change-Id: I9b7379d5f2ed66677666365cf5cf0b98c774f219 --- include/lttng/action/action.h | 2 +- src/bin/lttng-sessiond/action-executor.c | 14 ++--- .../notification-thread-events.c | 4 +- src/bin/lttng/commands/list_triggers.c | 4 +- src/common/actions/action.c | 6 +-- src/common/actions/list.c | 54 +++++++++---------- src/common/error-query.c | 14 ++--- .../tools/trigger/utils/notification-client.c | 2 +- 8 files changed, 50 insertions(+), 50 deletions(-) diff --git a/include/lttng/action/action.h b/include/lttng/action/action.h index be7e397d0..cd3857d72 100644 --- a/include/lttng/action/action.h +++ b/include/lttng/action/action.h @@ -21,7 +21,7 @@ enum lttng_action_type { LTTNG_ACTION_TYPE_STOP_SESSION = 2, LTTNG_ACTION_TYPE_ROTATE_SESSION = 3, LTTNG_ACTION_TYPE_SNAPSHOT_SESSION = 4, - LTTNG_ACTION_TYPE_GROUP = 5, + LTTNG_ACTION_TYPE_LIST = 5, }; enum lttng_action_status { diff --git a/src/bin/lttng-sessiond/action-executor.c b/src/bin/lttng-sessiond/action-executor.c index 9a89865a9..79c867714 100644 --- a/src/bin/lttng-sessiond/action-executor.c +++ b/src/bin/lttng-sessiond/action-executor.c @@ -135,7 +135,7 @@ static int action_executor_snapshot_session_handler( struct action_executor *executor, const struct action_work_item *, struct action_work_subitem *); -static int action_executor_group_handler(struct action_executor *executor, +static int action_executor_list_handler(struct action_executor *executor, const struct action_work_item *, struct action_work_subitem *); static int action_executor_generic_handler(struct action_executor *executor, @@ -148,7 +148,7 @@ static const action_executor_handler action_executors[] = { [LTTNG_ACTION_TYPE_STOP_SESSION] = action_executor_stop_session_handler, [LTTNG_ACTION_TYPE_ROTATE_SESSION] = action_executor_rotate_session_handler, [LTTNG_ACTION_TYPE_SNAPSHOT_SESSION] = action_executor_snapshot_session_handler, - [LTTNG_ACTION_TYPE_GROUP] = action_executor_group_handler, + [LTTNG_ACTION_TYPE_LIST] = action_executor_list_handler, }; /* Forward declaration */ @@ -660,11 +660,11 @@ end: return ret; } -static int action_executor_group_handler(struct action_executor *executor, +static int action_executor_list_handler(struct action_executor *executor, const struct action_work_item *work_item, struct action_work_subitem *item) { - ERR("Execution of a group action by the action executor should never occur"); + ERR("Execution of a list action by the action executor should never occur"); abort(); } @@ -1010,7 +1010,7 @@ static int add_action_to_subitem_array(struct lttng_action *action, assert(action); assert(subitems); - if (type == LTTNG_ACTION_TYPE_GROUP) { + if (type == LTTNG_ACTION_TYPE_LIST) { unsigned int count, i; status = lttng_action_list_get_count(action, &count); @@ -1031,7 +1031,7 @@ static int add_action_to_subitem_array(struct lttng_action *action, /* * Go directly to the end since there is no need to add the - * group action by itself to the subitems array. + * list action by itself to the subitems array. */ goto end; } @@ -1060,7 +1060,7 @@ static int add_action_to_subitem_array(struct lttng_action *action, action, &session_name); assert(status == LTTNG_ACTION_STATUS_OK); break; - case LTTNG_ACTION_TYPE_GROUP: + case LTTNG_ACTION_TYPE_LIST: case LTTNG_ACTION_TYPE_UNKNOWN: /* Fallthrough */ default: diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index c9c21bc72..c9847d032 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -2487,7 +2487,7 @@ bool is_trigger_action_notify(const struct lttng_trigger *trigger) if (action_type == LTTNG_ACTION_TYPE_NOTIFY) { is_notify = true; goto end; - } else if (action_type != LTTNG_ACTION_TYPE_GROUP) { + } else if (action_type != LTTNG_ACTION_TYPE_LIST) { goto end; } @@ -2603,7 +2603,7 @@ enum lttng_error_code setup_tracer_notifier( trigger, &error_counter_index); if (error_accounting_status != EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK) { if (error_accounting_status == EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_NO_INDEX_AVAILABLE) { - DBG("Trigger group error accounting counter full."); + DBG("Trigger list error accounting counter full."); ret = LTTNG_ERR_EVENT_NOTIFIER_ERROR_ACCOUNTING_FULL; } else { ERR("Error registering trigger for error accounting"); diff --git a/src/bin/lttng/commands/list_triggers.c b/src/bin/lttng/commands/list_triggers.c index bb90e7b6e..7c8bd7f88 100644 --- a/src/bin/lttng/commands/list_triggers.c +++ b/src/bin/lttng/commands/list_triggers.c @@ -637,7 +637,7 @@ void print_one_action(const struct lttng_trigger *trigger, const char *value; action_type = lttng_action_get_type(action); - assert(action_type != LTTNG_ACTION_TYPE_GROUP); + assert(action_type != LTTNG_ACTION_TYPE_LIST); switch (action_type) { case LTTNG_ACTION_TYPE_NOTIFY: @@ -939,7 +939,7 @@ void print_one_trigger(const struct lttng_trigger *trigger) action = lttng_trigger_get_const_action(trigger); action_type = lttng_action_get_type(action); - if (action_type == LTTNG_ACTION_TYPE_GROUP) { + if (action_type == LTTNG_ACTION_TYPE_LIST) { unsigned int count, i; enum lttng_action_status action_status; diff --git a/src/common/actions/action.c b/src/common/actions/action.c index f9236c878..498e41f79 100644 --- a/src/common/actions/action.c +++ b/src/common/actions/action.c @@ -23,8 +23,8 @@ const char *lttng_action_type_string(enum lttng_action_type action_type) switch (action_type) { case LTTNG_ACTION_TYPE_UNKNOWN: return "UNKNOWN"; - case LTTNG_ACTION_TYPE_GROUP: - return "GROUP"; + case LTTNG_ACTION_TYPE_LIST: + return "LIST"; case LTTNG_ACTION_TYPE_NOTIFY: return "NOTIFY"; case LTTNG_ACTION_TYPE_ROTATE_SESSION: @@ -191,7 +191,7 @@ ssize_t lttng_action_create_from_payload(struct lttng_payload_view *view, create_from_payload_cb = lttng_action_stop_session_create_from_payload; break; - case LTTNG_ACTION_TYPE_GROUP: + case LTTNG_ACTION_TYPE_LIST: create_from_payload_cb = lttng_action_list_create_from_payload; break; default: diff --git a/src/common/actions/list.c b/src/common/actions/list.c index 4c325df84..9b2d129b6 100644 --- a/src/common/actions/list.c +++ b/src/common/actions/list.c @@ -15,8 +15,8 @@ #include #include -#define IS_GROUP_ACTION(action) \ - (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_GROUP) +#define IS_LIST_ACTION(action) \ + (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_LIST) struct lttng_action_list { struct lttng_action parent; @@ -63,7 +63,7 @@ static bool lttng_action_list_validate(struct lttng_action *action) struct lttng_action_list *action_list; bool valid; - assert(IS_GROUP_ACTION(action)); + assert(IS_LIST_ACTION(action)); action_list = action_list_from_action(action); @@ -138,7 +138,7 @@ static int lttng_action_list_serialize( assert(action); assert(payload); - assert(IS_GROUP_ACTION(action)); + assert(IS_LIST_ACTION(action)); action_list = action_list_from_action(action); @@ -196,13 +196,13 @@ ssize_t lttng_action_list_create_from_payload( { ssize_t consumed_len; const struct lttng_action_list_comm *comm; - struct lttng_action *group; + struct lttng_action *list; struct lttng_action *child_action = NULL; enum lttng_action_status status; size_t i; - group = lttng_action_list_create(); - if (!group) { + list = lttng_action_list_create(); + if (!list) { consumed_len = -1; goto end; } @@ -229,7 +229,7 @@ ssize_t lttng_action_list_create_from_payload( goto end; } - status = lttng_action_list_add_action(group, child_action); + status = lttng_action_list_add_action(list, child_action); if (status != LTTNG_ACTION_STATUS_OK) { consumed_len = -1; goto end; @@ -242,11 +242,11 @@ ssize_t lttng_action_list_create_from_payload( consumed_len += consumed_len_child; } - *p_action = group; - group = NULL; + *p_action = list; + list = NULL; end: - lttng_action_list_destroy(group); + lttng_action_list_destroy(list); return consumed_len; } @@ -256,8 +256,8 @@ static enum lttng_action_status lttng_action_list_add_error_query_results( { unsigned int i, count; enum lttng_action_status action_status; - const struct lttng_action_list *group = - container_of(action, typeof(*group), parent); + const struct lttng_action_list *list = + container_of(action, typeof(*list), parent); action_status = lttng_action_list_get_count(action, &count); if (action_status != LTTNG_ACTION_STATUS_OK) { @@ -291,7 +291,7 @@ struct lttng_action *lttng_action_list_create(void) action = &action_list->parent; - lttng_action_init(action, LTTNG_ACTION_TYPE_GROUP, + lttng_action_init(action, LTTNG_ACTION_TYPE_LIST, lttng_action_list_validate, lttng_action_list_serialize, lttng_action_list_is_equal, lttng_action_list_destroy, @@ -306,27 +306,27 @@ end: } enum lttng_action_status lttng_action_list_add_action( - struct lttng_action *group, struct lttng_action *action) + struct lttng_action *list, struct lttng_action *action) { struct lttng_action_list *action_list; enum lttng_action_status status; int ret; - if (!group || !IS_GROUP_ACTION(group) || !action) { + if (!list || !IS_LIST_ACTION(list) || !action) { status = LTTNG_ACTION_STATUS_INVALID; goto end; } /* - * Don't allow adding groups in groups for now, since we're afraid of + * Don't allow adding lists in lists for now, since we're afraid of * cycles. */ - if (IS_GROUP_ACTION(action)) { + if (IS_LIST_ACTION(action)) { status = LTTNG_ACTION_STATUS_INVALID; goto end; } - action_list = action_list_from_action(group); + action_list = action_list_from_action(list); ret = lttng_dynamic_pointer_array_add_pointer(&action_list->actions, action); @@ -343,38 +343,38 @@ end: } enum lttng_action_status lttng_action_list_get_count( - const struct lttng_action *group, unsigned int *count) + const struct lttng_action *list, unsigned int *count) { const struct lttng_action_list *action_list; enum lttng_action_status status = LTTNG_ACTION_STATUS_OK; - if (!group || !IS_GROUP_ACTION(group)) { + if (!list || !IS_LIST_ACTION(list)) { status = LTTNG_ACTION_STATUS_INVALID; *count = 0; goto end; } - action_list = action_list_from_action_const(group); + action_list = action_list_from_action_const(list); *count = lttng_dynamic_pointer_array_get_count(&action_list->actions); end: return status; } const struct lttng_action *lttng_action_list_get_at_index( - const struct lttng_action *group, unsigned int index) + const struct lttng_action *list, unsigned int index) { - return lttng_action_list_borrow_mutable_at_index(group, index); + return lttng_action_list_borrow_mutable_at_index(list, index); } LTTNG_HIDDEN struct lttng_action *lttng_action_list_borrow_mutable_at_index( - const struct lttng_action *group, unsigned int index) + const struct lttng_action *list, unsigned int index) { unsigned int count; const struct lttng_action_list *action_list; struct lttng_action *action = NULL; - if (lttng_action_list_get_count(group, &count) != + if (lttng_action_list_get_count(list, &count) != LTTNG_ACTION_STATUS_OK) { goto end; } @@ -383,7 +383,7 @@ struct lttng_action *lttng_action_list_borrow_mutable_at_index( goto end; } - action_list = action_list_from_action_const(group); + action_list = action_list_from_action_const(list); action = lttng_dynamic_pointer_array_get_pointer(&action_list->actions, index); end: diff --git a/src/common/error-query.c b/src/common/error-query.c index 8bee20397..01ed1ef21 100644 --- a/src/common/error-query.c +++ b/src/common/error-query.c @@ -47,9 +47,9 @@ struct lttng_error_query_action { struct lttng_trigger *trigger; /* * Index of the target action. Since action lists can't be nested, - * the targetted action is the top-level group if the action_index is + * the targetted action is the top-level list if the action_index is * unset. Otherwise, the index refers to the index within the top-level - * group. + * list. */ LTTNG_OPTIONAL(unsigned int) action_index; }; @@ -150,7 +150,7 @@ extern struct lttng_error_query *lttng_error_query_action_create( */ if (action != trigger->action && lttng_action_get_type(trigger->action) == - LTTNG_ACTION_TYPE_GROUP) { + LTTNG_ACTION_TYPE_LIST) { unsigned int i, action_list_count; enum lttng_action_status action_status; @@ -178,7 +178,7 @@ extern struct lttng_error_query *lttng_error_query_action_create( } } else { /* - * Trigger action is not a group and not equal to the target + * Trigger action is not a list and not equal to the target * action; invalid action provided. */ goto error; @@ -681,8 +681,8 @@ struct lttng_action *lttng_error_query_action_borrow_action_target( target_action = trigger_action; } else { if (lttng_action_get_type(trigger_action) != - LTTNG_ACTION_TYPE_GROUP) { - ERR("Invalid action error query target index: trigger action is not a group"); + LTTNG_ACTION_TYPE_LIST) { + ERR("Invalid action error query target index: trigger action is not a list"); goto end; } @@ -827,7 +827,7 @@ ssize_t lttng_error_query_create_from_payload(struct lttng_payload_view *view, target_action = trigger->action; } else { if (lttng_action_get_type(trigger->action) != - LTTNG_ACTION_TYPE_GROUP) { + LTTNG_ACTION_TYPE_LIST) { used_size = -1; goto end; } diff --git a/tests/regression/tools/trigger/utils/notification-client.c b/tests/regression/tools/trigger/utils/notification-client.c index 98c00d6f7..3d8aec46d 100644 --- a/tests/regression/tools/trigger/utils/notification-client.c +++ b/tests/regression/tools/trigger/utils/notification-client.c @@ -181,7 +181,7 @@ int main(int argc, char **argv) continue; } } - if (!((action_type == LTTNG_ACTION_TYPE_GROUP && + if (!((action_type == LTTNG_ACTION_TYPE_LIST && action_list_contains_notify(action)) || action_type == LTTNG_ACTION_TYPE_NOTIFY)) { /* "The action of trigger is not notify, skipping. */ -- 2.34.1