X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fevent-rule%2Fkprobe.c;h=01699caf1ade9407948e8024889095954d3948c9;hb=cfb1c9bcab7801380b6ffbab9e505b861072254c;hp=9cc5d7c5433b0016dea8efb51675d2a70956e8fa;hpb=3e6e0df2f8f9f23d252c2508b6d741916dfcc4b3;p=lttng-tools.git diff --git a/src/common/event-rule/kprobe.c b/src/common/event-rule/kprobe.c index 9cc5d7c54..01699caf1 100644 --- a/src/common/event-rule/kprobe.c +++ b/src/common/event-rule/kprobe.c @@ -6,11 +6,14 @@ */ #include +#include #include #include #include #include #include +#include +#include #include #include #include @@ -146,7 +149,8 @@ end: } static enum lttng_error_code lttng_event_rule_kprobe_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; @@ -166,14 +170,32 @@ lttng_event_rule_kprobe_get_filter_bytecode(const struct lttng_event_rule *rule) return NULL; } -static struct lttng_event_exclusion * -lttng_event_rule_kprobe_generate_exclusions(const struct lttng_event_rule *rule) +static enum lttng_event_rule_generate_exclusions_status +lttng_event_rule_kprobe_generate_exclusions(const struct lttng_event_rule *rule, + struct lttng_event_exclusion **exclusions) { /* Not supported. */ - return NULL; + *exclusions = NULL; + return LTTNG_EVENT_RULE_GENERATE_EXCLUSIONS_STATUS_NONE; +} + +static unsigned long +lttng_event_rule_kprobe_hash( + const struct lttng_event_rule *rule) +{ + unsigned long hash; + struct lttng_event_rule_kprobe *krule = + container_of(rule, typeof(*krule), parent); + + hash = hash_key_ulong((void *) LTTNG_EVENT_RULE_TYPE_KPROBE, + lttng_ht_seed); + hash ^= hash_key_str(krule->name, lttng_ht_seed); + hash ^= lttng_kernel_probe_location_hash(krule->location); + + return hash; } -struct lttng_event_rule *lttng_event_rule_kprobe_create() +struct lttng_event_rule *lttng_event_rule_kprobe_create(void) { struct lttng_event_rule *rule = NULL; struct lttng_event_rule_kprobe *krule; @@ -196,6 +218,7 @@ struct lttng_event_rule *lttng_event_rule_kprobe_create() lttng_event_rule_kprobe_get_filter_bytecode; krule->parent.generate_exclusions = lttng_event_rule_kprobe_generate_exclusions; + krule->parent.hash = lttng_event_rule_kprobe_hash; end: return rule; }