X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fevent-rule%2Fuprobe.c;h=de4ee1cb0add4efa908cbc57fcd46d86f8b02cde;hb=cfb1c9bcab7801380b6ffbab9e505b861072254c;hp=d9c1fc20c5a268070c00bc6c28806d8f93946aae;hpb=3e6e0df2f8f9f23d252c2508b6d741916dfcc4b3;p=lttng-tools.git diff --git a/src/common/event-rule/uprobe.c b/src/common/event-rule/uprobe.c index d9c1fc20c..de4ee1cb0 100644 --- a/src/common/event-rule/uprobe.c +++ b/src/common/event-rule/uprobe.c @@ -6,11 +6,14 @@ */ #include +#include #include #include #include #include #include +#include +#include #include #include #include @@ -138,7 +141,8 @@ end: } static enum lttng_error_code lttng_event_rule_uprobe_generate_filter_bytecode( - struct lttng_event_rule *rule, uid_t uid, gid_t gid) + struct lttng_event_rule *rule, + const struct lttng_credentials *creds) { /* Nothing to do. */ return LTTNG_OK; @@ -158,14 +162,32 @@ lttng_event_rule_uprobe_get_filter_bytecode(const struct lttng_event_rule *rule) return NULL; } -static struct lttng_event_exclusion * -lttng_event_rule_uprobe_generate_exclusions(const struct lttng_event_rule *rule) +static enum lttng_event_rule_generate_exclusions_status +lttng_event_rule_uprobe_generate_exclusions(const struct lttng_event_rule *rule, + struct lttng_event_exclusion **exclusions) { /* Unsupported. */ - return NULL; + *exclusions = NULL; + return LTTNG_EVENT_RULE_GENERATE_EXCLUSIONS_STATUS_NONE; +} + +static unsigned long +lttng_event_rule_uprobe_hash( + const struct lttng_event_rule *rule) +{ + unsigned long hash; + struct lttng_event_rule_uprobe *urule = + container_of(rule, typeof(*urule), parent); + + hash = hash_key_ulong((void *) LTTNG_EVENT_RULE_TYPE_UPROBE, + lttng_ht_seed); + hash ^= hash_key_str(urule->name, lttng_ht_seed); + hash ^= lttng_userspace_probe_location_hash(urule->location); + + return hash; } -struct lttng_event_rule *lttng_event_rule_uprobe_create() +struct lttng_event_rule *lttng_event_rule_uprobe_create(void) { struct lttng_event_rule *rule = NULL; struct lttng_event_rule_uprobe *urule; @@ -188,6 +210,7 @@ struct lttng_event_rule *lttng_event_rule_uprobe_create() lttng_event_rule_uprobe_get_filter_bytecode; urule->parent.generate_exclusions = lttng_event_rule_uprobe_generate_exclusions; + urule->parent.hash = lttng_event_rule_uprobe_hash; end: return rule; }