X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fevaluation.c;h=6b3e634947253812329f099770d2345f999622b1;hb=3afa94aeca5a0daae40fd7b6cc96b7e4c150c7d8;hp=d8a68a7840429b44bf73679bd3b0abc1b30f6273;hpb=f14461318ba4a0c44bb7ed7a9c320c7d7b903052;p=lttng-tools.git diff --git a/src/common/evaluation.c b/src/common/evaluation.c index d8a68a784..6b3e63494 100644 --- a/src/common/evaluation.c +++ b/src/common/evaluation.c @@ -5,24 +5,22 @@ * */ +#include #include #include #include #include -#include +#include #include #include #include -#include -LTTNG_HIDDEN void lttng_evaluation_init(struct lttng_evaluation *evaluation, enum lttng_condition_type type) { evaluation->type = type; } -LTTNG_HIDDEN int lttng_evaluation_serialize(const struct lttng_evaluation *evaluation, struct lttng_payload *payload) { @@ -47,8 +45,8 @@ end: return ret; } -LTTNG_HIDDEN ssize_t lttng_evaluation_create_from_payload( + const struct lttng_condition *condition, struct lttng_payload_view *src_view, struct lttng_evaluation **evaluation) { @@ -115,8 +113,15 @@ ssize_t lttng_evaluation_create_from_payload( } evaluation_size += ret; break; - case LTTNG_CONDITION_TYPE_EVENT_RULE_HIT: - ret = lttng_evaluation_event_rule_create_from_payload(&evaluation_view, evaluation); + case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES: + LTTNG_ASSERT(condition); + LTTNG_ASSERT(condition->type == + LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES); + ret = lttng_evaluation_event_rule_matches_create_from_payload( + container_of(condition, + const struct lttng_condition_event_rule_matches, + parent), + &evaluation_view, evaluation); if (ret < 0) { goto end; } @@ -146,6 +151,6 @@ void lttng_evaluation_destroy(struct lttng_evaluation *evaluation) return; } - assert(evaluation->destroy); + LTTNG_ASSERT(evaluation->destroy); evaluation->destroy(evaluation); }