X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fevent-rule%2Fuprobe.c;fp=src%2Fcommon%2Fevent-rule%2Fuprobe.c;h=2e64eaf898bd69880eaaff0208339b1c154e1665;hp=b02332b61c11202780f64511cb690446791d37d4;hb=959e3c66727698e58a8788aceeda5820b3c938ba;hpb=76992d4d80834399b1b08bc21eca634f22d18017 diff --git a/src/common/event-rule/uprobe.c b/src/common/event-rule/uprobe.c index b02332b61..2e64eaf89 100644 --- a/src/common/event-rule/uprobe.c +++ b/src/common/event-rule/uprobe.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include #include @@ -167,6 +169,22 @@ lttng_event_rule_uprobe_generate_exclusions(const struct lttng_event_rule *rule) return NULL; } +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 *rule = NULL; @@ -190,6 +208,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; }