Use bytecode seqnum to force the evaluation ordering of capture bytecode
[lttng-tools.git] / src / common / event-rule / kprobe.c
index 6846f0cb16a2b664c4635227b09d4b2ee58535b9..12e6010ac1f25723caa73b72e74cf5d0f27df32f 100644 (file)
@@ -12,6 +12,8 @@
 #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>
@@ -161,21 +163,39 @@ static const char *lttng_event_rule_kprobe_get_filter(
        return NULL;
 }
 
-static const struct lttng_filter_bytecode *
+static const struct lttng_bytecode *
 lttng_event_rule_kprobe_get_filter_bytecode(const struct lttng_event_rule *rule)
 {
        /* Not supported. */
        return NULL;
 }
 
-static struct lttng_event_exclusion *
-lttng_event_rule_kprobe_generate_exclusions(const struct lttng_event_rule *rule)
+static enum lttng_event_rule_generate_exclusions_status
+lttng_event_rule_kprobe_generate_exclusions(const struct lttng_event_rule *rule,
+               struct lttng_event_exclusion **exclusions)
 {
        /* Not supported. */
-       return NULL;
+       *exclusions = NULL;
+       return LTTNG_EVENT_RULE_GENERATE_EXCLUSIONS_STATUS_NONE;
+}
+
+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()
+struct lttng_event_rule *lttng_event_rule_kprobe_create(void)
 {
        struct lttng_event_rule *rule = NULL;
        struct lttng_event_rule_kprobe *krule;
@@ -198,6 +218,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.025466 seconds and 5 git commands to generate.