projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: use the correct condition type in logging statements
[lttng-tools.git]
/
src
/
common
/
evaluation.c
diff --git
a/src/common/evaluation.c
b/src/common/evaluation.c
index 43b4e743f22e807dfd799201387ef40b4df755fc..f07c81b18cf9747250bc3284ff04cf713d4ebbb7 100644
(file)
--- a/
src/common/evaluation.c
+++ b/
src/common/evaluation.c
@@
-17,35
+17,33
@@
#include <lttng/condition/evaluation-internal.h>
#include <lttng/condition/buffer-usage-internal.h>
#include <lttng/condition/evaluation-internal.h>
#include <lttng/condition/buffer-usage-internal.h>
+#include <lttng/condition/session-consumed-size-internal.h>
#include <common/macros.h>
#include <common/error.h>
#include <stdbool.h>
#include <assert.h>
LTTNG_HIDDEN
#include <common/macros.h>
#include <common/error.h>
#include <stdbool.h>
#include <assert.h>
LTTNG_HIDDEN
-
ssize_
t lttng_evaluation_serialize(struct lttng_evaluation *evaluation,
-
cha
r *buf)
+
in
t lttng_evaluation_serialize(struct lttng_evaluation *evaluation,
+
struct lttng_dynamic_buffe
r *buf)
{
{
-
ssize_t ret, offset = 0
;
+
int ret
;
struct lttng_evaluation_comm evaluation_comm = {
.type = (int8_t) evaluation->type
};
struct lttng_evaluation_comm evaluation_comm = {
.type = (int8_t) evaluation->type
};
- if (buf) {
- memcpy(buf, &evaluation_comm, sizeof(evaluation_comm));
+ ret = lttng_dynamic_buffer_append(buf, &evaluation_comm,
+ sizeof(evaluation_comm));
+ if (ret) {
+ goto end;
}
}
- offset += sizeof(evaluation_comm);
if (evaluation->serialize) {
if (evaluation->serialize) {
- ret = evaluation->serialize(evaluation,
- buf ? (buf + offset) : NULL);
- if (ret < 0) {
+ ret = evaluation->serialize(evaluation, buf);
+ if (ret) {
goto end;
}
goto end;
}
- offset += ret;
}
}
-
- ret = offset;
end:
return ret;
}
end:
return ret;
}
@@
-86,6
+84,14
@@
ssize_t lttng_evaluation_create_from_buffer(
}
evaluation_size += ret;
break;
}
evaluation_size += ret;
break;
+ case LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE:
+ ret = lttng_evaluation_session_consumed_size_create_from_buffer(
+ &evaluation_view, evaluation);
+ if (ret < 0) {
+ goto end;
+ }
+ evaluation_size += ret;
+ break;
default:
ERR("Attempted to create evaluation of unknown type (%i)",
(int) evaluation_comm->type);
default:
ERR("Attempted to create evaluation of unknown type (%i)",
(int) evaluation_comm->type);
This page took
0.024325 seconds
and
4
git commands to generate.