Skip to content
Commit 4bbf59a9 authored by Daniel Bristot de Oliveira's avatar Daniel Bristot de Oliveira Committed by Steven Rostedt (Google)
Browse files

rtla: Fix segmentation fault when failing to enable -t

rtla osnoise and timerlat are causing a segmentation fault when running
with the --trace option on a kernel that does not support multiple
instances. For example:

    [root@f34 rtla]# rtla osnoise top -t
    failed to enable the tracer osnoise
    Could not enable osnoiser tracer for tracing
    Failed to enable the trace instance
    Segmentation fault (core dumped)

This error happens because the exit code of the tools is trying
to destroy the trace instance that failed to be created.

Make osnoise_destroy_tool() aware of possible NULL osnoise_tool *,
and do not attempt to destroy it. This also simplifies the exit code.

Link: https://lkml.kernel.org/r/5660a2b6bf66c2655842360f2d7f6b48db5dba23.1644327249.git.bristot@kernel.org



Suggested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Fixes: 1eceb2fc ("rtla/osnoise: Add osnoise top mode")
Fixes: 829a6c0b ("rtla/osnoise: Add the hist mode")
Fixes: a828cd18 ("rtla: Add timerlat tool and timelart ...
parent 1a622909
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment