Fix: non-enabler events should be disabled by default
[lttng-modules.git] / probes / lttng-kretprobes.c
index 5b63c453206c293df542b770326c23163260ce47..52b3f78138f94978427eedc8e197175527270274 100644 (file)
@@ -139,7 +139,7 @@ int lttng_create_kprobe_event(const char *name, struct lttng_event *event,
        fields[0].type.atype = atype_integer;
        fields[0].type.u.basic.integer.size = sizeof(unsigned long) * CHAR_BIT;
        fields[0].type.u.basic.integer.alignment = lttng_alignof(unsigned long) * CHAR_BIT;
-       fields[0].type.u.basic.integer.signedness = is_signed_type(unsigned long);
+       fields[0].type.u.basic.integer.signedness = lttng_is_signed_type(unsigned long);
        fields[0].type.u.basic.integer.reverse_byte_order = 0;
        fields[0].type.u.basic.integer.base = 16;
        fields[0].type.u.basic.integer.encoding = lttng_encode_none;
@@ -148,7 +148,7 @@ int lttng_create_kprobe_event(const char *name, struct lttng_event *event,
        fields[1].type.atype = atype_integer;
        fields[1].type.u.basic.integer.size = sizeof(unsigned long) * CHAR_BIT;
        fields[1].type.u.basic.integer.alignment = lttng_alignof(unsigned long) * CHAR_BIT;
-       fields[1].type.u.basic.integer.signedness = is_signed_type(unsigned long);
+       fields[1].type.u.basic.integer.signedness = lttng_is_signed_type(unsigned long);
        fields[1].type.u.basic.integer.reverse_byte_order = 0;
        fields[1].type.u.basic.integer.base = 16;
        fields[1].type.u.basic.integer.encoding = lttng_encode_none;
@@ -285,6 +285,30 @@ void lttng_kretprobes_destroy_private(struct lttng_event *event)
 }
 EXPORT_SYMBOL_GPL(lttng_kretprobes_destroy_private);
 
+int lttng_kretprobes_event_enable_state(struct lttng_event *event,
+               int enable)
+{
+       struct lttng_event *event_return;
+       struct lttng_krp *lttng_krp;
+
+       if (event->instrumentation != LTTNG_KERNEL_KRETPROBE) {
+               return -EINVAL;
+       }
+       if (event->enabled == enable) {
+               return -EBUSY;
+       }
+       lttng_krp = event->u.kretprobe.lttng_krp;
+       event_return = lttng_krp->event[EVENT_RETURN];
+       ACCESS_ONCE(event->enabled) = enable;
+       ACCESS_ONCE(event_return->enabled) = enable;
+       return 0;
+}
+EXPORT_SYMBOL_GPL(lttng_kretprobes_event_enable_state);
+
 MODULE_LICENSE("GPL and additional rights");
 MODULE_AUTHOR("Mathieu Desnoyers");
 MODULE_DESCRIPTION("Linux Trace Toolkit Kretprobes Support");
+MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION) "."
+       __stringify(LTTNG_MODULES_MINOR_VERSION) "."
+       __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION)
+       LTTNG_MODULES_EXTRAVERSION);
This page took 0.024615 seconds and 4 git commands to generate.