}
lttng_dynamic_array_init(&path->indexes, sizeof(uint64_t), NULL);
- ret = lttng_dynamic_array_set_count(&path->indexes, index_count);
- if (ret) {
- goto error;
- }
for (i = 0; i < index_count; i++) {
ret = lttng_dynamic_array_add_element(
int ret;
size_t i, src_count;
- assert(src);
- assert(dst);
+ LTTNG_ASSERT(src);
+ LTTNG_ASSERT(dst);
lttng_dynamic_array_init(&dst->indexes, sizeof(uint64_t), NULL);
src_count = lttng_dynamic_array_get_count(&src->indexes);
- ret = lttng_dynamic_array_set_count(&dst->indexes, src_count);
- if (ret) {
- goto error;
- }
-
for (i = 0; i < src_count; i++) {
const void *index = lttng_dynamic_array_get_element(
&src->indexes, i);
header = (typeof(header)) header_view.buffer.data;
consumed_size += header_view.buffer.size;
+
+ /*
+ * An action path of size 0 can exist and represents a trigger with a
+ * single non-list action. Handle it differently since a payload view of
+ * size 0 is considered invalid.
+ */
+ if (header->index_count != 0)
{
const struct lttng_payload_view indexes_view =
lttng_payload_view_from_view(view,
if (!action_path) {
goto end;
}
+ } else {
+ action_path = lttng_action_path_create(NULL, 0);
+ if (!action_path) {
+ goto end;
+ }
}
ret = consumed_size;
+ *_action_path = action_path;
end:
return ret;
}