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,
[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 */
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();
}
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);
/*
* 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;
}
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:
#include <lttng/action/list-internal.h>
#include <lttng/action/list.h>
-#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;
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);
assert(action);
assert(payload);
- assert(IS_GROUP_ACTION(action));
+ assert(IS_LIST_ACTION(action));
action_list = action_list_from_action(action);
{
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;
}
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;
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;
}
{
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) {
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,
}
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);
}
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;
}
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:
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;
};
*/
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;
}
} 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;
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;
}
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;
}