#include <common/payload.h>
#include <common/payload-view.h>
#include <common/runas.h>
+#include <common/hashtable/hashtable.h>
+#include <common/hashtable/utils.h>
#include <lttng/event-rule/event-rule-internal.h>
#include <lttng/event-rule/syscall-internal.h>
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;
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;
}