X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fevent-rule%2Fkprobe.c;h=15dabdde3d0ceca5e8f334c20255ba1132999d83;hp=6846f0cb16a2b664c4635227b09d4b2ee58535b9;hb=959e3c66727698e58a8788aceeda5820b3c938ba;hpb=76992d4d80834399b1b08bc21eca634f22d18017 diff --git a/src/common/event-rule/kprobe.c b/src/common/event-rule/kprobe.c index 6846f0cb1..15dabdde3 100644 --- a/src/common/event-rule/kprobe.c +++ b/src/common/event-rule/kprobe.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include #include @@ -175,6 +177,22 @@ lttng_event_rule_kprobe_generate_exclusions(const struct lttng_event_rule *rule) return NULL; } +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 *rule = NULL; @@ -198,6 +216,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; }