OSDN Git Service

tracing: Add trace_trigger kernel command line option
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 21 Oct 2022 01:00:56 +0000 (21:00 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 24 Nov 2022 00:08:30 +0000 (19:08 -0500)
commita01fdc897fa56ffb596d0a0cd7ea2ab3bd8398c5
tree451d14431799d6c4ba1d91079f00153d02a5f851
parent8230f27b1ccc4b8976c137e3d6d690f9d4ffca8d
tracing: Add trace_trigger kernel command line option

Allow triggers to be enabled at kernel boot up. For example:

  trace_trigger="sched_switch.stacktrace if prev_state == 2"

The above will enable the stacktrace trigger on top of the sched_switch
event and only trigger if its prev_state is 2 (TASK_UNINTERRUPTIBLE). Then
at boot up, a stacktrace will trigger and be recorded in the tracing ring
buffer every time the sched_switch happens where the previous state is
TASK_INTERRUPTIBLE.

Another useful trigger would be "traceoff" which can stop tracing on an
event if a field of the event matches a certain value defined by the
filter ("if" statement).

Link: https://lore.kernel.org/linux-trace-kernel/20221020210056.0d8d0a5b@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Documentation/admin-guide/kernel-parameters.txt
kernel/trace/trace_events.c