]> Pileus Git - ~andy/linux/blobdiff - kernel/trace/Kconfig
ring-buffer: Add ring buffer startup selftest
[~andy/linux] / kernel / trace / Kconfig
index 5d89335a485f7480ea4fa3924261e5d659e79ad0..0b5ecf5517fa6d3bb1464a9f183396b07253fbd8 100644 (file)
@@ -39,6 +39,9 @@ config HAVE_DYNAMIC_FTRACE
        help
          See Documentation/trace/ftrace-design.txt
 
+config HAVE_DYNAMIC_FTRACE_WITH_REGS
+       bool
+
 config HAVE_FTRACE_MCOUNT_RECORD
        bool
        help
@@ -188,6 +191,8 @@ config IRQSOFF_TRACER
        select GENERIC_TRACER
        select TRACER_MAX_TRACE
        select RING_BUFFER_ALLOW_SWAP
+       select TRACER_SNAPSHOT
+       select TRACER_SNAPSHOT_PER_CPU_SWAP
        help
          This option measures the time spent in irqs-off critical
          sections, with microsecond accuracy.
@@ -210,6 +215,8 @@ config PREEMPT_TRACER
        select GENERIC_TRACER
        select TRACER_MAX_TRACE
        select RING_BUFFER_ALLOW_SWAP
+       select TRACER_SNAPSHOT
+       select TRACER_SNAPSHOT_PER_CPU_SWAP
        help
          This option measures the time spent in preemption-off critical
          sections, with microsecond accuracy.
@@ -229,6 +236,7 @@ config SCHED_TRACER
        select GENERIC_TRACER
        select CONTEXT_SWITCH_TRACER
        select TRACER_MAX_TRACE
+       select TRACER_SNAPSHOT
        help
          This tracer tracks the latency of the highest priority task
          to be scheduled in, starting from the point it has woken up.
@@ -250,6 +258,37 @@ config FTRACE_SYSCALLS
        help
          Basic tracer to catch the syscall entry and exit events.
 
+config TRACER_SNAPSHOT
+       bool "Create a snapshot trace buffer"
+       select TRACER_MAX_TRACE
+       help
+         Allow tracing users to take snapshot of the current buffer using the
+         ftrace interface, e.g.:
+
+             echo 1 > /sys/kernel/debug/tracing/snapshot
+             cat snapshot
+
+config TRACER_SNAPSHOT_PER_CPU_SWAP
+        bool "Allow snapshot to swap per CPU"
+       depends on TRACER_SNAPSHOT
+       select RING_BUFFER_ALLOW_SWAP
+       help
+         Allow doing a snapshot of a single CPU buffer instead of a
+         full swap (all buffers). If this is set, then the following is
+         allowed:
+
+             echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot
+
+         After which, only the tracing buffer for CPU 2 was swapped with
+         the main tracing buffer, and the other CPU buffers remain the same.
+
+         When this is enabled, this adds a little more overhead to the
+         trace recording, as it needs to add some checks to synchronize
+         recording with swaps. But this does not affect the performance
+         of the overall system. This is enabled by default when the preempt
+         or irq latency tracers are enabled, as those need to swap as well
+         and already adds the overhead (plus a lot more).
+
 config TRACE_BRANCH_PROFILING
        bool
        select GENERIC_TRACER
@@ -416,23 +455,32 @@ config PROBE_EVENTS
        def_bool n
 
 config DYNAMIC_FTRACE
-       bool "enable/disable ftrace tracepoints dynamically"
+       bool "enable/disable function tracing dynamically"
        depends on FUNCTION_TRACER
        depends on HAVE_DYNAMIC_FTRACE
        default y
        help
-          This option will modify all the calls to ftrace dynamically
-         (will patch them out of the binary image and replace them
-         with a No-Op instruction) as they are called. A table is
-         created to dynamically enable them again.
+         This option will modify all the calls to function tracing
+         dynamically (will patch them out of the binary image and
+         replace them with a No-Op instruction) on boot up. During
+         compile time, a table is made of all the locations that ftrace
+         can function trace, and this table is linked into the kernel
+         image. When this is enabled, functions can be individually
+         enabled, and the functions not enabled will not affect
+         performance of the system.
+
+         See the files in /sys/kernel/debug/tracing:
+           available_filter_functions
+           set_ftrace_filter
+           set_ftrace_notrace
 
          This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
          otherwise has native performance as long as no tracing is active.
 
-         The changes to the code are done by a kernel thread that
-         wakes up once a second and checks to see if any ftrace calls
-         were made. If so, it runs stop_machine (stops all CPUS)
-         and modifies the code to jump over the call to ftrace.
+config DYNAMIC_FTRACE_WITH_REGS
+       def_bool y
+       depends on DYNAMIC_FTRACE
+       depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
 
 config FUNCTION_PROFILER
        bool "Kernel function profiler"
@@ -517,6 +565,29 @@ config RING_BUFFER_BENCHMARK
 
          If unsure, say N.
 
+config RING_BUFFER_STARTUP_TEST
+       bool "Ring buffer startup self test"
+       depends on RING_BUFFER
+       help
+         Run a simple self test on the ring buffer on boot up. Late in the
+        kernel boot sequence, the test will start that kicks off
+        a thread per cpu. Each thread will write various size events
+        into the ring buffer. Another thread is created to send IPIs
+        to each of the threads, where the IPI handler will also write
+        to the ring buffer, to test/stress the nesting ability.
+        If any anomalies are discovered, a warning will be displayed
+        and all ring buffers will be disabled.
+
+        The test runs for 10 seconds. This will slow your boot time
+        by at least 10 more seconds.
+
+        At the end of the test, statics and more checks are done.
+        It will output the stats of each per cpu buffer. What
+        was written, the sizes, what was read, what was lost, and
+        other similar details.
+
+        If unsure, say N
+
 endif # FTRACE
 
 endif # TRACING_SUPPORT