projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
common: compile libconsumer, libust-consumer, libkernel-consumer as C++
[lttng-tools.git]
/
src
/
common
/
actions
/
path.c
diff --git
a/src/common/actions/path.c
b/src/common/actions/path.c
index dbae34b9eb44f2e8609c6adc6b7e4d8cb3e9999a..09cf08a4809d579224f697ccee1748e55256b5c0 100644
(file)
--- a/
src/common/actions/path.c
+++ b/
src/common/actions/path.c
@@
-29,10
+29,6
@@
struct lttng_action_path *lttng_action_path_create(
}
lttng_dynamic_array_init(&path->indexes, sizeof(uint64_t), NULL);
}
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(
for (i = 0; i < index_count; i++) {
ret = lttng_dynamic_array_add_element(
@@
-99,24
+95,18
@@
end:
return;
}
return;
}
-LTTNG_HIDDEN
int lttng_action_path_copy(const struct lttng_action_path *src,
struct lttng_action_path *dst)
{
int ret;
size_t i, src_count;
int lttng_action_path_copy(const struct lttng_action_path *src,
struct lttng_action_path *dst)
{
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);
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);
for (i = 0; i < src_count; i++) {
const void *index = lttng_dynamic_array_get_element(
&src->indexes, i);
@@
-135,7
+125,6
@@
end:
return ret;
}
return ret;
}
-LTTNG_HIDDEN
ssize_t lttng_action_path_create_from_payload(
struct lttng_payload_view *view,
struct lttng_action_path **_action_path)
ssize_t lttng_action_path_create_from_payload(
struct lttng_payload_view *view,
struct lttng_action_path **_action_path)
@@
-152,6
+141,13
@@
ssize_t lttng_action_path_create_from_payload(
header = (typeof(header)) header_view.buffer.data;
consumed_size += header_view.buffer.size;
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,
{
const struct lttng_payload_view indexes_view =
lttng_payload_view_from_view(view,
@@
-170,14
+166,19
@@
ssize_t lttng_action_path_create_from_payload(
if (!action_path) {
goto end;
}
if (!action_path) {
goto end;
}
+ } else {
+ action_path = lttng_action_path_create(NULL, 0);
+ if (!action_path) {
+ goto end;
+ }
}
ret = consumed_size;
}
ret = consumed_size;
+ *_action_path = action_path;
end:
return ret;
}
end:
return ret;
}
-LTTNG_HIDDEN
int lttng_action_path_serialize(const struct lttng_action_path *action_path,
struct lttng_payload *payload)
{
int lttng_action_path_serialize(const struct lttng_action_path *action_path,
struct lttng_payload *payload)
{
This page took
0.02557 seconds
and
4
git commands to generate.