Cleanup: tracepoint probe register/unregister: use parent field
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 1 Nov 2021 20:39:22 +0000 (16:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 1 Nov 2021 20:40:21 +0000 (16:40 -0400)
Use the parent field to match the type expected in the probe callback.

This works so far only because parent is the first field of the children
structures.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I05fb3cdc75c1c04abb352cdebdaa90f780d0c789

src/lttng-events.c

index dd8b55e065f06b16b63d6ab966f27174678f56f7..ebeda98668ddecc9ba97b3a21a66b950dd88d6c2 100644 (file)
@@ -1452,7 +1452,7 @@ void register_event_recorder(struct lttng_kernel_event_recorder *event_recorder)
        case LTTNG_KERNEL_ABI_TRACEPOINT:
                ret = lttng_wrapper_tracepoint_probe_register(desc->event_kname,
                                                  desc->tp_class->probe_callback,
-                                                 event_recorder);
+                                                 &event_recorder->parent);
                break;
 
        case LTTNG_KERNEL_ABI_SYSCALL:
@@ -1495,7 +1495,7 @@ int _lttng_event_recorder_unregister(struct lttng_kernel_event_recorder *event_r
        case LTTNG_KERNEL_ABI_TRACEPOINT:
                ret = lttng_wrapper_tracepoint_probe_unregister(event_priv->desc->event_kname,
                                                  event_priv->desc->tp_class->probe_callback,
-                                                 event_recorder);
+                                                 &event_recorder->parent);
                break;
 
        case LTTNG_KERNEL_ABI_KPROBE:
@@ -1546,7 +1546,7 @@ void register_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
        case LTTNG_KERNEL_ABI_TRACEPOINT:
                ret = lttng_wrapper_tracepoint_probe_register(desc->event_kname,
                                                  desc->tp_class->probe_callback,
-                                                 event_notifier);
+                                                 &event_notifier->parent);
                break;
 
        case LTTNG_KERNEL_ABI_SYSCALL:
@@ -1587,7 +1587,7 @@ int _lttng_event_notifier_unregister(
        case LTTNG_KERNEL_ABI_TRACEPOINT:
                ret = lttng_wrapper_tracepoint_probe_unregister(event_notifier->priv->parent.desc->event_kname,
                                                  event_notifier->priv->parent.desc->tp_class->probe_callback,
-                                                 event_notifier);
+                                                 &event_notifier->parent);
                break;
 
        case LTTNG_KERNEL_ABI_KPROBE:
This page took 0.028241 seconds and 4 git commands to generate.