Commit fe36bb87 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tracing updates from Steven Rostedt:

 - Add options to the osnoise tracer:
      - 'panic_on_stop' option that panics the kernel if osnoise is
        greater than some user defined threshold.
      - 'preempt' option, to test noise while preemption is disabled
      - 'irq' option, to test noise when interrupts are disabled

 - Add .percent and .graph suffix to histograms to give different
   outputs

 - Add nohitcount to disable showing hitcount in histogram output

 - Add new __cpumask() to trace event fields to annotate that a unsigned
   long array is a cpumask to user space and should be treated as one.

 - Add trace_trigger kernel command line parameter to enable trace event
   triggers at boot up. Useful to trace stack traces, disable tracing
   and take snapshots.

 - Fix x86/kmmio mmio tracer to work with the updates to lockdep

 - Unify the panic and die notifiers

 - Add back ftrace_expect reference that is used to extract more
   information in the ftrace_bug() code.

 - Have trigger filter parsing errors show up in the tracing error log.

 - Updated MAINTAINERS file to add kernel tracing mailing list and
   patchwork info

 - Use IDA to keep track of event type numbers.

 - And minor fixes and clean ups

* tag 'trace-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: (44 commits)
  tracing: Fix cpumask() example typo
  tracing: Improve panic/die notifiers
  ftrace: Prevent RCU stall on PREEMPT_VOLUNTARY kernels
  tracing: Do not synchronize freeing of trigger filter on boot up
  tracing: Remove pointer (asterisk) and brackets from cpumask_t field
  tracing: Have trigger filter parsing errors show up in error_log
  x86/mm/kmmio: Remove redundant preempt_disable()
  tracing: Fix infinite loop in tracing_read_pipe on overflowed print_trace_line
  Documentation/osnoise: Add osnoise/options documentation
  tracing/osnoise: Add preempt and/or irq disabled options
  tracing/osnoise: Add PANIC_ON_STOP option
  Documentation/osnoise: Escape underscore of NO_ prefix
  tracing: Fix some checker warnings
  tracing/osnoise: Make osnoise_options static
  tracing: remove unnecessary trace_trigger ifdef
  ring-buffer: Handle resize in early boot up
  tracing/hist: Fix issue of losting command info in error_log
  tracing: Fix issue of missing one synthetic field
  tracing/hist: Fix out-of-bound write on 'action_data.var_ref_idx'
  tracing/hist: Fix wrong return value in parse_action_params()
  ...
parents 851f657a eb9d5894
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -6266,6 +6266,25 @@
			See also Documentation/trace/ftrace.rst "trace options"
			section.

	trace_trigger=[trigger-list]
			[FTRACE] Add a event trigger on specific events.
			Set a trigger on top of a specific event, with an optional
			filter.

			The format is is "trace_trigger=<event>.<trigger>[ if <filter>],..."
			Where more than one trigger may be specified that are comma deliminated.

			For example:

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

			The above will enable the "stacktrace" trigger on the "sched_switch"
			event but only trigger it if the "prev_state" of the "sched_switch"
			event is "2" (TASK_UNINTERUPTIBLE).

			See also "Event triggers" in Documentation/trace/events.rst


	traceoff_on_warning
			[FTRACE] enable this option to disable tracing when a
			warning is hit. This turns off "tracing_on". Tracing can
+9 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ Documentation written by Tom Zanussi

        hist:keys=<field1[,field2,...]>[:values=<field1[,field2,...]>]
          [:sort=<field1[,field2,...]>][:size=#entries][:pause][:continue]
          [:clear][:name=histname1][:<handler>.<action>] [if <filter>]
          [:clear][:name=histname1][:nohitcount][:<handler>.<action>] [if <filter>]

  When a matching event is hit, an entry is added to a hash table
  using the key(s) and value(s) named.  Keys and values correspond to
@@ -79,6 +79,8 @@ Documentation written by Tom Zanussi
	.log2          display log2 value rather than raw number
	.buckets=size  display grouping of values rather than raw number
	.usecs         display a common_timestamp in microseconds
        .percent       display a number of percentage value
        .graph         display a bar-graph of a value
	=============  =================================================

  Note that in general the semantics of a given field aren't
@@ -137,6 +139,12 @@ Documentation written by Tom Zanussi
  existing trigger, rather than via the '>' operator, which will cause
  the trigger to be removed through truncation.

  The 'nohitcount' (or NOHC) parameter will suppress display of
  raw hitcount in the histogram. This option requires at least one
  value field which is not a 'raw hitcount'. For example,
  'hist:...:vals=hitcount:nohitcount' is rejected, but
  'hist:...:vals=hitcount.percent:nohitcount' is OK.

- enable_hist/disable_hist

  The enable_hist and disable_hist triggers can be used to have one
+30 −2
Original line number Diff line number Diff line
@@ -92,8 +92,8 @@ Note that the example above shows a high number of HW noise samples.
The reason being is that this sample was taken on a virtual machine,
and the host interference is detected as a hardware interference.

Tracer options
---------------------
Tracer Configuration
--------------------

The tracer has a set of options inside the osnoise directory, they are:

@@ -109,6 +109,27 @@ The tracer has a set of options inside the osnoise directory, they are:
 - tracing_threshold: the minimum delta between two time() reads to be
   considered as noise, in us. When set to 0, the default value will
   be used, which is currently 5 us.
 - osnoise/options: a set of on/off options that can be enabled by
   writing the option name to the file or disabled by writing the option
   name preceded with the 'NO\_' prefix. For example, writing
   NO_OSNOISE_WORKLOAD disables the OSNOISE_WORKLOAD option. The
   special DEAFAULTS option resets all options to the default value.

Tracer Options
--------------

The osnoise/options file exposes a set of on/off configuration options for
the osnoise tracer. These options are:

 - DEFAULTS: reset the options to the default value.
 - OSNOISE_WORKLOAD: do not dispatch osnoise workload (see dedicated
   section below).
 - PANIC_ON_STOP: call panic() if the tracer stops. This option serves to
   capture a vmcore.
 - OSNOISE_PREEMPT_DISABLE: disable preemption while running the osnoise
   workload, allowing only IRQ and hardware-related noise.
 - OSNOISE_IRQ_DISABLE: disable IRQs while running the osnoise workload,
   allowing only NMIs and hardware-related noise, like hwlat tracer.

Additional Tracing
------------------
@@ -150,3 +171,10 @@ tracepoints is smaller than eight us reported in the sample_threshold.
The reason roots in the overhead of the entry and exit code that happens
before and after any interference execution. This justifies the dual
approach: measuring thread and tracing.

Running osnoise tracer without workload
---------------------------------------

By enabling the osnoise tracer with the NO_OSNOISE_WORKLOAD option set,
the osnoise: tracepoints serve to measure the execution time of
any type of Linux task, free from the interference of other tasks.
+9 −0
Original line number Diff line number Diff line
@@ -8528,6 +8528,9 @@ FUNCTION HOOKS (FTRACE)
M:	Steven Rostedt <rostedt@goodmis.org>
M:	Masami Hiramatsu <mhiramat@kernel.org>
R:	Mark Rutland <mark.rutland@arm.com>
L:	linux-kernel@vger.kernel.org
L:	linux-trace-kernel@vger.kernel.org
Q:	https://patchwork.kernel.org/project/linux-trace-kernel/list/
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
F:	Documentation/trace/ftrace*
@@ -11606,6 +11609,9 @@ M: Naveen N. Rao <naveen.n.rao@linux.ibm.com>
M:	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
M:	"David S. Miller" <davem@davemloft.net>
M:	Masami Hiramatsu <mhiramat@kernel.org>
L:	linux-kernel@vger.kernel.org
L:	linux-trace-kernel@vger.kernel.org
Q:	https://patchwork.kernel.org/project/linux-trace-kernel/list/
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
F:	Documentation/trace/kprobes.rst
@@ -21079,6 +21085,9 @@ F: drivers/hwmon/pmbus/tps546d24.c
TRACING
M:	Steven Rostedt <rostedt@goodmis.org>
M:	Masami Hiramatsu <mhiramat@kernel.org>
L:	linux-kernel@vger.kernel.org
L:	linux-trace-kernel@vger.kernel.org
Q:	https://patchwork.kernel.org/project/linux-trace-kernel/list/
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
F:	Documentation/trace/*
+2 −0
Original line number Diff line number Diff line
@@ -221,7 +221,9 @@ void ftrace_replace_code(int enable)

		ret = ftrace_verify_code(rec->ip, old);
		if (ret) {
			ftrace_expected = old;
			ftrace_bug(ret, rec);
			ftrace_expected = NULL;
			return;
		}
	}
Loading