X-Git-Url: http://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fevent-rule%2Fevent-rule.c;h=98ff37411b90f45b6be1810da4af802c00cf8986;hp=fbcb7a018a0c0889b32725877e850f1d85a81549;hb=44760c20f4fc255b63894ca758cf2ee5f253220b;hpb=683d081a7f3734fcb5c8dd4424b0aa102117d1a0 diff --git a/src/common/event-rule/event-rule.c b/src/common/event-rule/event-rule.c index fbcb7a018..98ff37411 100644 --- a/src/common/event-rule/event-rule.c +++ b/src/common/event-rule/event-rule.c @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include #include @@ -242,10 +244,11 @@ void lttng_event_rule_put(struct lttng_event_rule *event_rule) LTTNG_HIDDEN enum lttng_error_code lttng_event_rule_generate_filter_bytecode( - struct lttng_event_rule *rule, uid_t uid, gid_t gid) + struct lttng_event_rule *rule, + const struct lttng_credentials *creds) { assert(rule->generate_filter_bytecode); - return rule->generate_filter_bytecode(rule, uid, gid); + return rule->generate_filter_bytecode(rule, creds); } LTTNG_HIDDEN @@ -264,14 +267,45 @@ const struct lttng_filter_bytecode *lttng_event_rule_get_filter_bytecode( } LTTNG_HIDDEN -struct lttng_event_exclusion *lttng_event_rule_generate_exclusions( - const struct lttng_event_rule *rule) +enum lttng_event_rule_generate_exclusions_status +lttng_event_rule_generate_exclusions(const struct lttng_event_rule *rule, + struct lttng_event_exclusion **exclusions) { assert(rule->generate_exclusions); - return rule->generate_exclusions(rule); + return rule->generate_exclusions(rule, exclusions); +} + +LTTNG_HIDDEN +struct lttng_event *lttng_event_rule_generate_lttng_event( + const struct lttng_event_rule *rule) +{ + assert(rule->generate_lttng_event); + return rule->generate_lttng_event(rule); } LTTNG_HIDDEN +bool lttng_event_rule_targets_agent_domain(const struct lttng_event_rule *rule) +{ + bool targets_agent_domain = false; + enum lttng_domain_type type = lttng_event_rule_get_domain_type(rule); + + switch (type) { + case LTTNG_DOMAIN_JUL: + case LTTNG_DOMAIN_LOG4J: + case LTTNG_DOMAIN_PYTHON: + targets_agent_domain = true; + break; + case LTTNG_DOMAIN_UST: + case LTTNG_DOMAIN_KERNEL: + targets_agent_domain = false; + break; + default: + abort(); + }; + + return targets_agent_domain; +} + const char *lttng_event_rule_type_str(enum lttng_event_rule_type type) { switch (type) { @@ -291,3 +325,10 @@ const char *lttng_event_rule_type_str(enum lttng_event_rule_type type) abort(); } } + +LTTNG_HIDDEN +unsigned long lttng_event_rule_hash(const struct lttng_event_rule *rule) +{ + assert(rule->hash); + return rule->hash(rule); +}