From 702f26c8641ee4554c629d13b9367b1e93f96e31 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Mon, 19 Apr 2021 21:57:13 -0400 Subject: [PATCH] Rename action group to action list MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is necessary to convey that the `group` an ordered sequence of actions. We use the term `list` to put an emphasis on the ordered nature of the group. Files rename follows. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: Idb85d8ca5b60947d8dc3d43d98c8d915bf34c3f2 --- include/lttng/action/group-internal.h | 12 +- include/lttng/action/group.h | 34 ++--- src/bin/lttng-sessiond/action-executor.c | 4 +- .../notification-thread-events.c | 4 +- src/bin/lttng/commands/add_trigger.c | 14 +- src/bin/lttng/commands/list_triggers.c | 4 +- src/common/actions/action.c | 2 +- src/common/actions/group.c | 132 +++++++++--------- src/common/error-query.c | 16 +-- .../tools/notification/base_client.c | 20 +-- .../notification/test_notification_multi_app | 4 +- .../tools/trigger/utils/notification-client.c | 14 +- .../trigger/utils/register-some-triggers.c | 28 ++-- 13 files changed, 144 insertions(+), 144 deletions(-) diff --git a/include/lttng/action/group-internal.h b/include/lttng/action/group-internal.h index 0cb89d54b..9e88422ca 100644 --- a/include/lttng/action/group-internal.h +++ b/include/lttng/action/group-internal.h @@ -5,8 +5,8 @@ * */ -#ifndef LTTNG_ACTION_GROUP_INTERNAL_H -#define LTTNG_ACTION_GROUP_INTERNAL_H +#ifndef LTTNG_ACTION_LIST_INTERNAL_H +#define LTTNG_ACTION_LIST_INTERNAL_H #include @@ -16,18 +16,18 @@ struct lttng_action; struct lttng_payload_view; /* - * Create an action group from a payload view. + * Create an action list from a payload view. * * On success, return the number of bytes consumed from `view`, and the created * group in `*group`. On failure, return -1. */ LTTNG_HIDDEN -extern ssize_t lttng_action_group_create_from_payload( +extern ssize_t lttng_action_list_create_from_payload( struct lttng_payload_view *view, struct lttng_action **group); LTTNG_HIDDEN -extern struct lttng_action *lttng_action_group_borrow_mutable_at_index( +extern struct lttng_action *lttng_action_list_borrow_mutable_at_index( const struct lttng_action *group, unsigned int index); -#endif /* LTTNG_ACTION_GROUP_INTERNAL_H */ +#endif /* LTTNG_ACTION_LIST_INTERNAL_H */ diff --git a/include/lttng/action/group.h b/include/lttng/action/group.h index af1e73216..888c1237e 100644 --- a/include/lttng/action/group.h +++ b/include/lttng/action/group.h @@ -5,52 +5,52 @@ * */ -#ifndef LTTNG_ACTION_GROUP_H -#define LTTNG_ACTION_GROUP_H +#ifndef LTTNG_ACTION_LIST_H +#define LTTNG_ACTION_LIST_H struct lttng_action; -struct lttng_action_group; +struct lttng_action_list; #ifdef __cplusplus extern "C" { #endif /* - * Create a newly allocated action group object. + * Create a newly allocated action list object. * - * Returns a new action group on success, NULL on failure. This action group - * must be destroyed using lttng_action_group_destroy(). + * Returns a new action list on success, NULL on failure. This action list + * must be destroyed using lttng_action_list_destroy(). */ -extern struct lttng_action *lttng_action_group_create(void); +extern struct lttng_action *lttng_action_list_create(void); /* - * Add an action to an lttng_action object of type LTTNG_ACTION_GROUP. + * Add an action to an lttng_action object of type LTTNG_ACTION_LIST. * - * The action group acquires a reference to the action. The action can be + * The action list acquires a reference to the action. The action can be * safely destroyed after calling this function. An action must not be * modified after adding it to a group. * - * Adding an action group to an action group is not supported. + * Adding an action list to an action list is not supported. */ -extern enum lttng_action_status lttng_action_group_add_action( +extern enum lttng_action_status lttng_action_list_add_action( struct lttng_action *group, struct lttng_action *action); /* - * Get the number of actions in an action group. + * Get the number of actions in an action list. */ -extern enum lttng_action_status lttng_action_group_get_count( +extern enum lttng_action_status lttng_action_list_get_count( const struct lttng_action *group, unsigned int *count); /* - * Get an action from the action group at a given index. + * Get an action from the action list at a given index. * * Note that the group maintains the ownership of the returned action. * It must not be destroyed by the user, nor should it be held beyond - * the lifetime of the action group. + * the lifetime of the action list. * * Returns an action, or NULL on error. */ -extern const struct lttng_action *lttng_action_group_get_at_index( +extern const struct lttng_action *lttng_action_list_get_at_index( const struct lttng_action *group, unsigned int index); @@ -58,4 +58,4 @@ extern const struct lttng_action *lttng_action_group_get_at_index( } #endif -#endif /* LTTNG_ACTION_GROUP_H */ +#endif /* LTTNG_ACTION_LIST_H */ diff --git a/src/bin/lttng-sessiond/action-executor.c b/src/bin/lttng-sessiond/action-executor.c index 588948146..cbcd08b5f 100644 --- a/src/bin/lttng-sessiond/action-executor.c +++ b/src/bin/lttng-sessiond/action-executor.c @@ -1014,13 +1014,13 @@ static int add_action_to_subitem_array(struct lttng_action *action, if (type == LTTNG_ACTION_TYPE_GROUP) { unsigned int count, i; - status = lttng_action_group_get_count(action, &count); + status = lttng_action_list_get_count(action, &count); assert(status == LTTNG_ACTION_STATUS_OK); for (i = 0; i < count; i++) { struct lttng_action *inner_action = NULL; - inner_action = lttng_action_group_borrow_mutable_at_index( + inner_action = lttng_action_list_borrow_mutable_at_index( action, i); assert(inner_action); ret = add_action_to_subitem_array( diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index 45e356796..d1b1ca017 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -2480,12 +2480,12 @@ bool is_trigger_action_notify(const struct lttng_trigger *trigger) goto end; } - action_status = lttng_action_group_get_count(action, &count); + action_status = lttng_action_list_get_count(action, &count); assert(action_status == LTTNG_ACTION_STATUS_OK); for (i = 0; i < count; i++) { const struct lttng_action *inner_action = - lttng_action_group_get_at_index( + lttng_action_list_get_at_index( action, i); action_type = lttng_action_get_type(inner_action); diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index 91f849c13..32aff65d3 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -2012,7 +2012,7 @@ int cmd_add_trigger(int argc, const char **argv) struct lttng_dynamic_pointer_array actions; struct argpar_state *argpar_state = NULL; struct argpar_item *argpar_item = NULL; - struct lttng_action *action_group = NULL; + struct lttng_action *action_list = NULL; struct lttng_action *action = NULL; struct lttng_trigger *trigger = NULL; char *error = NULL; @@ -2148,8 +2148,8 @@ int cmd_add_trigger(int argc, const char **argv) goto error; } - action_group = lttng_action_group_create(); - if (!action_group) { + action_list = lttng_action_list_create(); + if (!action_list) { goto error; } @@ -2158,20 +2158,20 @@ int cmd_add_trigger(int argc, const char **argv) action = lttng_dynamic_pointer_array_steal_pointer(&actions, i); - status = lttng_action_group_add_action(action_group, action); + status = lttng_action_list_add_action(action_list, action); if (status != LTTNG_ACTION_STATUS_OK) { goto error; } /* - * The `lttng_action_group_add_action()` takes a reference to + * The `lttng_action_list_add_action()` takes a reference to * the action. We can destroy ours. */ lttng_action_destroy(action); action = NULL; } - trigger = lttng_trigger_create(condition, action_group); + trigger = lttng_trigger_create(condition, action_list); if (!trigger) { goto error; } @@ -2222,7 +2222,7 @@ end: argpar_item_destroy(argpar_item); lttng_dynamic_pointer_array_reset(&actions); lttng_condition_destroy(condition); - lttng_action_destroy(action_group); + lttng_action_destroy(action_list); lttng_action_destroy(action); lttng_trigger_destroy(trigger); free(error); diff --git a/src/bin/lttng/commands/list_triggers.c b/src/bin/lttng/commands/list_triggers.c index 73a740dc3..b497d4f4d 100644 --- a/src/bin/lttng/commands/list_triggers.c +++ b/src/bin/lttng/commands/list_triggers.c @@ -932,12 +932,12 @@ void print_one_trigger(const struct lttng_trigger *trigger) MSG(" actions:"); - action_status = lttng_action_group_get_count(action, &count); + action_status = lttng_action_list_get_count(action, &count); assert(action_status == LTTNG_ACTION_STATUS_OK); for (i = 0; i < count; i++) { const struct lttng_action *subaction = - lttng_action_group_get_at_index( + lttng_action_list_get_at_index( action, i); _MSG(" "); diff --git a/src/common/actions/action.c b/src/common/actions/action.c index d4b9c09eb..1c1049ebe 100644 --- a/src/common/actions/action.c +++ b/src/common/actions/action.c @@ -192,7 +192,7 @@ ssize_t lttng_action_create_from_payload(struct lttng_payload_view *view, lttng_action_stop_session_create_from_payload; break; case LTTNG_ACTION_TYPE_GROUP: - create_from_payload_cb = lttng_action_group_create_from_payload; + create_from_payload_cb = lttng_action_list_create_from_payload; break; default: ERR("Failed to create action from payload, unhandled action type: action-type=%u (%s)", diff --git a/src/common/actions/group.c b/src/common/actions/group.c index 3effa8715..fd3e65fcc 100644 --- a/src/common/actions/group.c +++ b/src/common/actions/group.c @@ -18,14 +18,14 @@ #define IS_GROUP_ACTION(action) \ (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_GROUP) -struct lttng_action_group { +struct lttng_action_list { struct lttng_action parent; /* The array owns the action elements. */ struct lttng_dynamic_pointer_array actions; }; -struct lttng_action_group_comm { +struct lttng_action_list_comm { uint32_t action_count; /* @@ -34,45 +34,45 @@ struct lttng_action_group_comm { char data[]; } LTTNG_PACKED; -static void destroy_lttng_action_group_element(void *ptr) +static void destroy_lttng_action_list_element(void *ptr) { struct lttng_action *element = (struct lttng_action *) ptr; lttng_action_destroy(element); } -static struct lttng_action_group *action_group_from_action( +static struct lttng_action_list *action_list_from_action( const struct lttng_action *action) { assert(action); - return container_of(action, struct lttng_action_group, parent); + return container_of(action, struct lttng_action_list, parent); } -static const struct lttng_action_group *action_group_from_action_const( +static const struct lttng_action_list *action_list_from_action_const( const struct lttng_action *action) { assert(action); - return container_of(action, struct lttng_action_group, parent); + return container_of(action, struct lttng_action_list, parent); } -static bool lttng_action_group_validate(struct lttng_action *action) +static bool lttng_action_list_validate(struct lttng_action *action) { unsigned int i, count; - struct lttng_action_group *action_group; + struct lttng_action_list *action_list; bool valid; assert(IS_GROUP_ACTION(action)); - action_group = action_group_from_action(action); + action_list = action_list_from_action(action); - count = lttng_dynamic_pointer_array_get_count(&action_group->actions); + count = lttng_dynamic_pointer_array_get_count(&action_list->actions); for (i = 0; i < count; i++) { struct lttng_action *child = lttng_dynamic_pointer_array_get_pointer( - &action_group->actions, i); + &action_list->actions, i); assert(child); @@ -88,19 +88,19 @@ end: return valid; } -static bool lttng_action_group_is_equal( +static bool lttng_action_list_is_equal( const struct lttng_action *_a, const struct lttng_action *_b) { bool is_equal = false; unsigned int i; unsigned int a_count, b_count; - if (lttng_action_group_get_count(_a, &a_count) != + if (lttng_action_list_get_count(_a, &a_count) != LTTNG_ACTION_STATUS_OK) { goto end; } - if (lttng_action_group_get_count(_b, &b_count) != + if (lttng_action_list_get_count(_b, &b_count) != LTTNG_ACTION_STATUS_OK) { goto end; } @@ -111,9 +111,9 @@ static bool lttng_action_group_is_equal( for (i = 0; i < a_count; i++) { const struct lttng_action *child_a = - lttng_action_group_get_at_index(_a, i); + lttng_action_list_get_at_index(_a, i); const struct lttng_action *child_b = - lttng_action_group_get_at_index(_b, i); + lttng_action_list_get_at_index(_b, i); assert(child_a); assert(child_b); @@ -128,11 +128,11 @@ end: return is_equal; } -static int lttng_action_group_serialize( +static int lttng_action_list_serialize( struct lttng_action *action, struct lttng_payload *payload) { - struct lttng_action_group *action_group; - struct lttng_action_group_comm comm; + struct lttng_action_list *action_list; + struct lttng_action_list_comm comm; int ret; unsigned int i, count; @@ -140,11 +140,11 @@ static int lttng_action_group_serialize( assert(payload); assert(IS_GROUP_ACTION(action)); - action_group = action_group_from_action(action); + action_list = action_list_from_action(action); - DBG("Serializing action group"); + DBG("Serializing action list"); - count = lttng_dynamic_pointer_array_get_count(&action_group->actions); + count = lttng_dynamic_pointer_array_get_count(&action_list->actions); comm.action_count = count; @@ -158,7 +158,7 @@ static int lttng_action_group_serialize( for (i = 0; i < count; i++) { struct lttng_action *child = lttng_dynamic_pointer_array_get_pointer( - &action_group->actions, i); + &action_list->actions, i); assert(child); @@ -174,34 +174,34 @@ end: return ret; } -static void lttng_action_group_destroy(struct lttng_action *action) +static void lttng_action_list_destroy(struct lttng_action *action) { - struct lttng_action_group *action_group; + struct lttng_action_list *action_list; if (!action) { goto end; } - action_group = action_group_from_action(action); - lttng_dynamic_pointer_array_reset(&action_group->actions); - free(action_group); + action_list = action_list_from_action(action); + lttng_dynamic_pointer_array_reset(&action_list->actions); + free(action_list); end: return; } -ssize_t lttng_action_group_create_from_payload( +ssize_t lttng_action_list_create_from_payload( struct lttng_payload_view *view, struct lttng_action **p_action) { ssize_t consumed_len; - const struct lttng_action_group_comm *comm; + const struct lttng_action_list_comm *comm; struct lttng_action *group; struct lttng_action *child_action = NULL; enum lttng_action_status status; size_t i; - group = lttng_action_group_create(); + group = lttng_action_list_create(); if (!group) { consumed_len = -1; goto end; @@ -209,7 +209,7 @@ ssize_t lttng_action_group_create_from_payload( comm = (typeof(comm)) view->buffer.data; - consumed_len = sizeof(struct lttng_action_group_comm); + consumed_len = sizeof(struct lttng_action_list_comm); for (i = 0; i < comm->action_count; i++) { ssize_t consumed_len_child; @@ -229,13 +229,13 @@ ssize_t lttng_action_group_create_from_payload( goto end; } - status = lttng_action_group_add_action(group, child_action); + status = lttng_action_list_add_action(group, child_action); if (status != LTTNG_ACTION_STATUS_OK) { consumed_len = -1; goto end; } - /* Transfer ownership to the action group. */ + /* Transfer ownership to the action list. */ lttng_action_put(child_action); child_action = NULL; @@ -246,27 +246,27 @@ ssize_t lttng_action_group_create_from_payload( group = NULL; end: - lttng_action_group_destroy(group); + lttng_action_list_destroy(group); return consumed_len; } -static enum lttng_action_status lttng_action_group_add_error_query_results( +static enum lttng_action_status lttng_action_list_add_error_query_results( const struct lttng_action *action, struct lttng_error_query_results *results) { unsigned int i, count; enum lttng_action_status action_status; - const struct lttng_action_group *group = + const struct lttng_action_list *group = container_of(action, typeof(*group), parent); - action_status = lttng_action_group_get_count(action, &count); + action_status = lttng_action_list_get_count(action, &count); if (action_status != LTTNG_ACTION_STATUS_OK) { goto end; } for (i = 0; i < count; i++) { struct lttng_action *inner_action = - lttng_action_group_borrow_mutable_at_index(action, i); + lttng_action_list_borrow_mutable_at_index(action, i); action_status = lttng_action_add_error_query_results( inner_action, results); @@ -278,37 +278,37 @@ end: return action_status; } -struct lttng_action *lttng_action_group_create(void) +struct lttng_action *lttng_action_list_create(void) { - struct lttng_action_group *action_group; + struct lttng_action_list *action_list; struct lttng_action *action; - action_group = zmalloc(sizeof(struct lttng_action_group)); - if (!action_group) { + action_list = zmalloc(sizeof(struct lttng_action_list)); + if (!action_list) { action = NULL; goto end; } - action = &action_group->parent; + action = &action_list->parent; lttng_action_init(action, LTTNG_ACTION_TYPE_GROUP, - lttng_action_group_validate, - lttng_action_group_serialize, - lttng_action_group_is_equal, lttng_action_group_destroy, + lttng_action_list_validate, + lttng_action_list_serialize, + lttng_action_list_is_equal, lttng_action_list_destroy, NULL, - lttng_action_group_add_error_query_results); + lttng_action_list_add_error_query_results); - lttng_dynamic_pointer_array_init(&action_group->actions, - destroy_lttng_action_group_element); + lttng_dynamic_pointer_array_init(&action_list->actions, + destroy_lttng_action_list_element); end: return action; } -enum lttng_action_status lttng_action_group_add_action( +enum lttng_action_status lttng_action_list_add_action( struct lttng_action *group, struct lttng_action *action) { - struct lttng_action_group *action_group; + struct lttng_action_list *action_list; enum lttng_action_status status; int ret; @@ -326,9 +326,9 @@ enum lttng_action_status lttng_action_group_add_action( goto end; } - action_group = action_group_from_action(group); + action_list = action_list_from_action(group); - ret = lttng_dynamic_pointer_array_add_pointer(&action_group->actions, + ret = lttng_dynamic_pointer_array_add_pointer(&action_list->actions, action); if (ret < 0) { status = LTTNG_ACTION_STATUS_ERROR; @@ -342,10 +342,10 @@ end: return status; } -enum lttng_action_status lttng_action_group_get_count( +enum lttng_action_status lttng_action_list_get_count( const struct lttng_action *group, unsigned int *count) { - const struct lttng_action_group *action_group; + const struct lttng_action_list *action_list; enum lttng_action_status status = LTTNG_ACTION_STATUS_OK; if (!group || !IS_GROUP_ACTION(group)) { @@ -354,27 +354,27 @@ enum lttng_action_status lttng_action_group_get_count( goto end; } - action_group = action_group_from_action_const(group); - *count = lttng_dynamic_pointer_array_get_count(&action_group->actions); + action_list = action_list_from_action_const(group); + *count = lttng_dynamic_pointer_array_get_count(&action_list->actions); end: return status; } -const struct lttng_action *lttng_action_group_get_at_index( +const struct lttng_action *lttng_action_list_get_at_index( const struct lttng_action *group, unsigned int index) { - return lttng_action_group_borrow_mutable_at_index(group, index); + return lttng_action_list_borrow_mutable_at_index(group, index); } LTTNG_HIDDEN -struct lttng_action *lttng_action_group_borrow_mutable_at_index( +struct lttng_action *lttng_action_list_borrow_mutable_at_index( const struct lttng_action *group, unsigned int index) { unsigned int count; - const struct lttng_action_group *action_group; + const struct lttng_action_list *action_list; struct lttng_action *action = NULL; - if (lttng_action_group_get_count(group, &count) != + if (lttng_action_list_get_count(group, &count) != LTTNG_ACTION_STATUS_OK) { goto end; } @@ -383,8 +383,8 @@ struct lttng_action *lttng_action_group_borrow_mutable_at_index( goto end; } - action_group = action_group_from_action_const(group); - action = lttng_dynamic_pointer_array_get_pointer(&action_group->actions, + action_list = action_list_from_action_const(group); + action = lttng_dynamic_pointer_array_get_pointer(&action_list->actions, index); end: return action; diff --git a/src/common/error-query.c b/src/common/error-query.c index 031257b27..266597b3d 100644 --- a/src/common/error-query.c +++ b/src/common/error-query.c @@ -145,24 +145,24 @@ extern struct lttng_error_query *lttng_error_query_action_create( * action list. * * Note that action comparisons are performed by pointer since multiple - * otherwise identical actions can be found in an action group (two + * otherwise identical actions can be found in an action list (two * notify actions, for example). */ if (action != trigger->action && lttng_action_get_type(trigger->action) == LTTNG_ACTION_TYPE_GROUP) { - unsigned int i, action_group_count; + unsigned int i, action_list_count; enum lttng_action_status action_status; - action_status = lttng_action_group_get_count( - trigger->action, &action_group_count); + action_status = lttng_action_list_get_count( + trigger->action, &action_list_count); if (action_status != LTTNG_ACTION_STATUS_OK) { goto error; } - for (i = 0; i < action_group_count; i++) { + for (i = 0; i < action_list_count; i++) { const struct lttng_action *candidate_action = - lttng_action_group_get_at_index( + lttng_action_list_get_at_index( trigger->action, i); assert(candidate_action); @@ -686,7 +686,7 @@ struct lttng_action *lttng_error_query_action_borrow_action_target( goto end; } - target_action = lttng_action_group_borrow_mutable_at_index( + target_action = lttng_action_list_borrow_mutable_at_index( trigger_action, LTTNG_OPTIONAL_GET(query_action->action_index)); } @@ -832,7 +832,7 @@ ssize_t lttng_error_query_create_from_payload(struct lttng_payload_view *view, goto end; } - target_action = lttng_action_group_get_at_index( + target_action = lttng_action_list_get_at_index( trigger->action, action_header->action_index.value); } diff --git a/tests/regression/tools/notification/base_client.c b/tests/regression/tools/notification/base_client.c index f74657a2a..ae150500e 100644 --- a/tests/regression/tools/notification/base_client.c +++ b/tests/regression/tools/notification/base_client.c @@ -36,7 +36,7 @@ static const char *channel_name = NULL; static double threshold_ratio = 0.0; static uint64_t threshold_bytes = 0; static bool is_threshold_ratio = false; -static bool use_action_group = false; +static bool use_action_list = false; static enum lttng_condition_type buffer_usage_type = LTTNG_CONDITION_TYPE_UNKNOWN; static enum lttng_domain_type domain_type = LTTNG_DOMAIN_NONE; @@ -53,7 +53,7 @@ int parse_arguments(char **argv) const char *buffer_usage_threshold_type = NULL; const char *buffer_usage_threshold_value = NULL; const char *nr_expected_notifications_string = NULL; - const char *use_action_group_value = NULL; + const char *use_action_list_value = NULL; session_name = argv[1]; channel_name = argv[2]; @@ -62,7 +62,7 @@ int parse_arguments(char **argv) buffer_usage_threshold_type = argv[5]; buffer_usage_threshold_value = argv[6]; nr_expected_notifications_string = argv[7]; - use_action_group_value = argv[8]; + use_action_list_value = argv[8]; /* Parse arguments */ /* Domain type */ @@ -110,8 +110,8 @@ int parse_arguments(char **argv) } /* Put notify action in a group. */ - if (!strcasecmp("1", use_action_group_value)) { - use_action_group = true; + if (!strcasecmp("1", use_action_list_value)) { + use_action_list = true; } return 0; @@ -213,12 +213,12 @@ int main(int argc, char **argv) goto end; } - if (use_action_group) { + if (use_action_list) { struct lttng_action *notify, *group; - group = lttng_action_group_create(); + group = lttng_action_list_create(); if (!group) { - printf("error: Could not create action group\n"); + printf("error: Could not create action list\n"); ret = 1; goto end; } @@ -231,9 +231,9 @@ int main(int argc, char **argv) goto end; } - action_status = lttng_action_group_add_action(group, notify); + action_status = lttng_action_list_add_action(group, notify); if (action_status != LTTNG_ACTION_STATUS_OK) { - printf("error: Could not add action notify to action group\n"); + printf("error: Could not add action notify to action list\n"); lttng_action_destroy(group); lttng_action_destroy(notify); ret = 1; diff --git a/tests/regression/tools/notification/test_notification_multi_app b/tests/regression/tools/notification/test_notification_multi_app index 5d5427c9d..7f24ef893 100755 --- a/tests/regression/tools/notification/test_notification_multi_app +++ b/tests/regression/tools/notification/test_notification_multi_app @@ -54,9 +54,9 @@ function start_client { local buffer_usage_threshold_type=$6 local buffer_usage_threshold_value=$7 local nr_expected_notification=$8 - local use_action_group=$9 + local use_action_list=$9 - ${CURDIR}/base_client ${session_name} ${channel_name} ${domain_type} ${buffer_usage_type} ${buffer_usage_threshold_type} ${buffer_usage_threshold_value} ${nr_expected_notification} ${use_action_group} > ${output_file} & + ${CURDIR}/base_client ${session_name} ${channel_name} ${domain_type} ${buffer_usage_type} ${buffer_usage_threshold_type} ${buffer_usage_threshold_value} ${nr_expected_notification} ${use_action_list} > ${output_file} & pid=$! app_pids+=("$pid") diff --git a/tests/regression/tools/trigger/utils/notification-client.c b/tests/regression/tools/trigger/utils/notification-client.c index 7e92cba61..ac572bfc6 100644 --- a/tests/regression/tools/trigger/utils/notification-client.c +++ b/tests/regression/tools/trigger/utils/notification-client.c @@ -36,22 +36,22 @@ static struct option long_options[] = {0, 0, 0, 0} }; -static bool action_group_contains_notify( - const struct lttng_action *action_group) +static bool action_list_contains_notify( + const struct lttng_action *action_list) { unsigned int i, count; enum lttng_action_status status = - lttng_action_group_get_count(action_group, &count); + lttng_action_list_get_count(action_list, &count); if (status != LTTNG_ACTION_STATUS_OK) { - printf("Failed to get action count from action group\n"); + printf("Failed to get action count from action list\n"); exit(1); } for (i = 0; i < count; i++) { const struct lttng_action *action = - lttng_action_group_get_at_index( - action_group, i); + lttng_action_list_get_at_index( + action_list, i); const enum lttng_action_type action_type = lttng_action_get_type(action); @@ -181,7 +181,7 @@ int main(int argc, char **argv) } } if (!((action_type == LTTNG_ACTION_TYPE_GROUP && - action_group_contains_notify(action)) || + action_list_contains_notify(action)) || action_type == LTTNG_ACTION_TYPE_NOTIFY)) { /* "The action of trigger is not notify, skipping. */ continue; diff --git a/tests/regression/tools/trigger/utils/register-some-triggers.c b/tests/regression/tools/trigger/utils/register-some-triggers.c index e462b9afc..c92ee0f5a 100644 --- a/tests/regression/tools/trigger/utils/register-some-triggers.c +++ b/tests/regression/tools/trigger/utils/register-some-triggers.c @@ -31,23 +31,23 @@ static void register_trigger(const char *trigger_name, } /* - * Register a trigger with the given condition and an action group containing a + * Register a trigger with the given condition and an action list containing a * single notify action. */ -static void register_trigger_action_group_notify( +static void register_trigger_action_list_notify( const char *trigger_name, struct lttng_condition *condition) { struct lttng_action *action_notify; - struct lttng_action *action_group; + struct lttng_action *action_list; enum lttng_action_status action_status; - action_group = lttng_action_group_create(); + action_list = lttng_action_list_create(); action_notify = lttng_action_notify_create(); - action_status = lttng_action_group_add_action( - action_group, action_notify); + action_status = lttng_action_list_add_action( + action_list, action_notify); assert(action_status == LTTNG_ACTION_STATUS_OK); - register_trigger(trigger_name, condition, action_group); + register_trigger(trigger_name, condition, action_list); } static struct lttng_condition *create_session_consumed_size_condition( @@ -70,7 +70,7 @@ static struct lttng_condition *create_session_consumed_size_condition( static void test_session_consumed_size_condition(void) { - register_trigger_action_group_notify( + register_trigger_action_list_notify( "trigger-with-session-consumed-size-condition", create_session_consumed_size_condition( "the-session-name", 1234)); @@ -186,25 +186,25 @@ static struct lttng_condition *create_buffer_usage_low_ratio_condition( static void test_buffer_usage_conditions(void) { - register_trigger_action_group_notify( + register_trigger_action_list_notify( "trigger-with-buffer-usage-high-bytes-condition", create_buffer_usage_high_bytes_condition( "the-session-name", "the-channel-name", LTTNG_DOMAIN_UST, 1234)); - register_trigger_action_group_notify( + register_trigger_action_list_notify( "trigger-with-buffer-usage-low-bytes-condition", create_buffer_usage_low_bytes_condition( "the-session-name", "the-channel-name", LTTNG_DOMAIN_UST, 2345)); - register_trigger_action_group_notify( + register_trigger_action_list_notify( "trigger-with-buffer-usage-high-ratio-condition", create_buffer_usage_high_ratio_condition( "the-session-name", "the-channel-name", LTTNG_DOMAIN_UST, 0.25)); - register_trigger_action_group_notify( + register_trigger_action_list_notify( "trigger-with-buffer-usage-low-ratio-condition", create_buffer_usage_low_ratio_condition( "the-session-name", "the-channel-name", @@ -247,12 +247,12 @@ static struct lttng_condition *create_session_rotation_completed_condition( static void test_session_rotation_conditions(void) { - register_trigger_action_group_notify( + register_trigger_action_list_notify( "trigger-with-session-rotation-ongoing-condition", create_session_rotation_ongoing_condition( "the-session-name")); - register_trigger_action_group_notify( + register_trigger_action_list_notify( "trigger-with-session-rotation-completed-condition", create_session_rotation_completed_condition( "the-session-name")); -- 2.34.1