Clean-up: replace erroneous of empty parameter list by void
[lttng-tools.git] / src / common / event-rule / kprobe.c
index 9cc5d7c5433b0016dea8efb51675d2a70956e8fa..6ec5cd402df5c590ab115a1384d6e5e34ec161b9 100644 (file)
@@ -6,11 +6,14 @@
  */
 
 #include <assert.h>
+#include <common/credentials.h>
 #include <common/error.h>
 #include <common/macros.h>
 #include <common/payload.h>
 #include <common/payload-view.h>
 #include <common/runas.h>
+#include <common/hashtable/hashtable.h>
+#include <common/hashtable/utils.h>
 #include <ctype.h>
 #include <lttng/constant.h>
 #include <lttng/event-rule/event-rule-internal.h>
@@ -146,7 +149,8 @@ end:
 }
 
 static enum lttng_error_code lttng_event_rule_kprobe_generate_filter_bytecode(
-               struct lttng_event_rule *rule, uid_t uid, gid_t gid)
+               struct lttng_event_rule *rule,
+               const struct lttng_credentials *creds)
 {
        /* Nothing to do. */
        return LTTNG_OK;
@@ -173,7 +177,23 @@ lttng_event_rule_kprobe_generate_exclusions(const struct lttng_event_rule *rule)
        return NULL;
 }
 
-struct lttng_event_rule *lttng_event_rule_kprobe_create()
+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(void)
 {
        struct lttng_event_rule *rule = NULL;
        struct lttng_event_rule_kprobe *krule;
@@ -196,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;
 }
This page took 0.025777 seconds and 4 git commands to generate.