Fix: lttng-syscalls.c: marking wrong syscall probe as unregistered
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 28 Jan 2020 22:19:20 +0000 (17:19 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 29 Jan 2020 16:16:28 +0000 (11:16 -0500)
When calling `lttng_syscalls_unregister()` we currently mark as
unregistered the wrong syscall probe type.

Concretely, when we unregister "sys_exit" we wrongfully mark that
sys_enter is unregistered and vice versa.

Given than currently entry and exit probes are always enabled together
(except on internal errors), the effect of this bug is not user-visible.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I64acf6a941a3d1fa1bf8be424f834ddb7fb92ace

lttng-syscalls.c

index ebd9246c32ef8b4e0ce1c469d1876b443166d67f..7a2d02a9ef1ff6c8d4e41ea39c62918c3c2a77e7 100644 (file)
@@ -905,15 +905,15 @@ int lttng_syscalls_unregister(struct lttng_channel *chan)
        if (!chan->sc_table)
                return 0;
        if (chan->sys_enter_registered) {
-               ret = lttng_wrapper_tracepoint_probe_unregister("sys_exit",
-                               (void *) syscall_exit_probe, chan);
+               ret = lttng_wrapper_tracepoint_probe_unregister("sys_enter",
+                               (void *) syscall_entry_probe, chan);
                if (ret)
                        return ret;
                chan->sys_enter_registered = 0;
        }
        if (chan->sys_exit_registered) {
-               ret = lttng_wrapper_tracepoint_probe_unregister("sys_enter",
-                               (void *) syscall_entry_probe, chan);
+               ret = lttng_wrapper_tracepoint_probe_unregister("sys_exit",
+                               (void *) syscall_exit_probe, chan);
                if (ret)
                        return ret;
                chan->sys_exit_registered = 0;
This page took 0.026915 seconds and 4 git commands to generate.