#include <lttng/event-rule/event-rule-internal.h>
#include <lttng/event-rule/tracepoint.h>
#include <lttng/condition/condition.h>
-#include <lttng/condition/event-rule.h>
+#include <lttng/condition/on-event.h>
#include <lttng/domain-internal.h>
+#include <lttng/log-level-rule-internal.h>
#include <common/common.h>
#include <common/sessiond-comm/agent.h>
const struct lttng_event_rule *rule;
const char *name;
const char *filter_expression;
+ const struct lttng_log_level_rule *log_level_rule;
/* Unused when loglevel_type is 'ALL'. */
int loglevel_value = 0;
enum lttng_loglevel_type loglevel_type;
condition = lttng_trigger_get_const_condition(trigger);
assert(lttng_condition_get_type(condition) ==
- LTTNG_CONDITION_TYPE_EVENT_RULE_HIT);
+ LTTNG_CONDITION_TYPE_ON_EVENT);
- c_status = lttng_condition_event_rule_get_rule(condition, &rule);
+ c_status = lttng_condition_on_event_get_rule(condition, &rule);
assert(c_status == LTTNG_CONDITION_STATUS_OK);
assert(lttng_event_rule_get_type(rule) ==
/* Get the internal filter expression. */
filter_expression = lttng_event_rule_get_filter(rule);
- er_status = lttng_event_rule_tracepoint_get_log_level_type(
- rule, &loglevel_type);
- assert(er_status == LTTNG_EVENT_RULE_STATUS_OK);
-
- if (loglevel_type != LTTNG_EVENT_LOGLEVEL_ALL) {
- er_status = lttng_event_rule_tracepoint_get_log_level(
- rule, &loglevel_value);
- assert(er_status == LTTNG_EVENT_RULE_STATUS_OK);
+ /* Map log_level_rule to loglevel value. */
+ er_status = lttng_event_rule_tracepoint_get_log_level_rule(
+ rule, &log_level_rule);
+ if (er_status == LTTNG_EVENT_RULE_STATUS_UNSET) {
+ loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
+ loglevel_value = 0;
+ } else if (er_status == LTTNG_EVENT_RULE_STATUS_OK) {
+ lttng_log_level_rule_to_loglevel(log_level_rule, &loglevel_type, &loglevel_value);
+ } else {
+ abort();
}
return agent_find_event(name, loglevel_type, loglevel_value,