SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / src / common / evaluation.c
index e936bdd91db3b12f1aeab97603df36649529b4f1..479b8b3e51edab7ddf18f9f3d31847f77710c99a 100644 (file)
@@ -5,10 +5,12 @@
  *
  */
 
+#include <lttng/condition/condition-internal.h>
 #include <lttng/condition/evaluation-internal.h>
 #include <lttng/condition/buffer-usage-internal.h>
 #include <lttng/condition/session-consumed-size-internal.h>
 #include <lttng/condition/session-rotation-internal.h>
+#include <lttng/condition/event-rule-internal.h>
 #include <common/macros.h>
 #include <common/error.h>
 #include <stdbool.h>
@@ -48,6 +50,7 @@ end:
 
 LTTNG_HIDDEN
 ssize_t lttng_evaluation_create_from_payload(
+               const struct lttng_condition *condition,
                struct lttng_payload_view *src_view,
                struct lttng_evaluation **evaluation)
 {
@@ -107,6 +110,19 @@ ssize_t lttng_evaluation_create_from_payload(
                }
                evaluation_size += ret;
                break;
+       case LTTNG_CONDITION_TYPE_EVENT_RULE_HIT:
+               assert(condition);
+               assert(condition->type == LTTNG_CONDITION_TYPE_EVENT_RULE_HIT);
+               ret = lttng_evaluation_event_rule_create_from_payload(
+                               container_of(condition,
+                                               struct lttng_condition_event_rule,
+                                               parent),
+                               &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);
This page took 0.033296 seconds and 5 git commands to generate.