X-Git-Url: http://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fevent-rule%2Fsyscall.c;h=51f22fcc0ff85602d680f5216d790dc48f1c38a8;hp=b2feb2c6ecf4c772049d9c41d304544f185959d1;hb=959e3c66727698e58a8788aceeda5820b3c938ba;hpb=76992d4d80834399b1b08bc21eca634f22d18017 diff --git a/src/common/event-rule/syscall.c b/src/common/event-rule/syscall.c index b2feb2c6e..51f22fcc0 100644 --- a/src/common/event-rule/syscall.c +++ b/src/common/event-rule/syscall.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include @@ -223,6 +225,25 @@ lttng_event_rule_syscall_generate_exclusions( return NULL; } +static unsigned long +lttng_event_rule_syscall_hash( + const struct lttng_event_rule *rule) +{ + unsigned long hash; + struct lttng_event_rule_syscall *syscall_rule = + container_of(rule, typeof(*syscall_rule), parent); + + hash = hash_key_ulong((void *) LTTNG_EVENT_RULE_TYPE_SYSCALL, + lttng_ht_seed); + hash ^= hash_key_str(syscall_rule->pattern, lttng_ht_seed); + if (syscall_rule->filter_expression) { + hash ^= hash_key_str(syscall_rule->filter_expression, + lttng_ht_seed); + } + + return hash; +} + struct lttng_event_rule *lttng_event_rule_syscall_create() { struct lttng_event_rule *rule = NULL; @@ -248,6 +269,7 @@ struct lttng_event_rule *lttng_event_rule_syscall_create() lttng_event_rule_syscall_get_internal_filter_bytecode; syscall_rule->parent.generate_exclusions = lttng_event_rule_syscall_generate_exclusions; + syscall_rule->parent.hash = lttng_event_rule_syscall_hash; end: return rule; }