X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fevent-rule%2Fsyscall.c;h=98c272d40c8ece449793c6a9e7d60beeea90bbcf;hb=cfb1c9bcab7801380b6ffbab9e505b861072254c;hp=b2feb2c6ecf4c772049d9c41d304544f185959d1;hpb=58daac01d91347336f24e1fc1cacd4e7a3101e93;p=lttng-tools.git diff --git a/src/common/event-rule/syscall.c b/src/common/event-rule/syscall.c index b2feb2c6e..98c272d40 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 @@ -215,15 +217,35 @@ lttng_event_rule_syscall_get_internal_filter_bytecode( return syscall->internal_filter.bytecode; } -static struct lttng_event_exclusion * -lttng_event_rule_syscall_generate_exclusions( +static enum lttng_event_rule_generate_exclusions_status +lttng_event_rule_syscall_generate_exclusions(const struct lttng_event_rule *rule, + struct lttng_event_exclusion **exclusions) +{ + /* Unsupported. */ + *exclusions = NULL; + return LTTNG_EVENT_RULE_GENERATE_EXCLUSIONS_STATUS_NONE; +} + +static unsigned long +lttng_event_rule_syscall_hash( const struct lttng_event_rule *rule) { - /* Not supported. */ - return NULL; + 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 *lttng_event_rule_syscall_create(void) { struct lttng_event_rule *rule = NULL; struct lttng_event_rule_syscall *syscall_rule; @@ -248,6 +270,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; }