• Huang Yiwei's avatar
    tracing: Support to dump instance traces by ftrace_dump_on_oops · 19f0423f
    Huang Yiwei authored
    Currently ftrace only dumps the global trace buffer on an OOPs. For
    debugging a production usecase, instance trace will be helpful to
    check specific problems since global trace buffer may be used for
    other purposes.
    
    This patch extend the ftrace_dump_on_oops parameter to dump a specific
    or multiple trace instances:
    
      - ftrace_dump_on_oops=0: as before -- don't dump
      - ftrace_dump_on_oops[=1]: as before -- dump the global trace buffer
      on all CPUs
      - ftrace_dump_on_oops=2 or =orig_cpu: as before -- dump the global
      trace buffer on CPU that triggered the oops
      - ftrace_dump_on_oops=<instance_name>: new behavior -- dump the
      tracing instance matching <instance_name>
      - ftrace_dump_on_oops[=2/orig_cpu],<instance1_name>[=2/orig_cpu],
      <instrance2_name>[=2/orig_cpu]: new behavior -- dump the global trace
      buffer and multiple instance buffer on all CPUs, or only dump on CPU
      that triggered the oops if =2 or =orig_cpu is given
    
    Also, the sysctl node can handle the input accordingly.
    
    Link: https://lore.kernel.org/linux-trace-kernel/20240223083126.1817731-1-quic_hyiwei@quicinc.com
    
    Cc: Ross Zwisler <zwisler@google.com>
    Cc: <mhiramat@kernel.org>
    Cc: <mark.rutland@arm.com>
    Cc: <mcgrof@kernel.org>
    Cc: <keescook@chromium.org>
    Cc: <j.granados@samsung.com>
    Cc: <mathieu.desnoyers@efficios.com>
    Cc: <corbet@lwn.net>
    Signed-off-by: default avatarHuang Yiwei <quic_hyiwei@quicinc.com>
    Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    19f0423f
kernel-parameters.txt 266 KB