2020-04-23 19:39:12

by Stephen Kitt

[permalink] [raw]
Subject: [PATCH 2/3] docs: sysctl/kernel: document ftrace entries

Based on the ftrace documentation, the tp_printk boot parameter
documentation, and the implementation in kernel/trace/trace.c.

Signed-off-by: Stephen Kitt <[email protected]>
---
Documentation/admin-guide/sysctl/kernel.rst | 50 +++++++++++++++++++++
1 file changed, 50 insertions(+)

diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 82bfd5892663..d4bbdaf96ebc 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -265,6 +265,27 @@ domain names are in general different. For a detailed discussion
see the ``hostname(1)`` man page.


+ftrace_dump_on_oops
+===================
+
+Determines whether ``ftrace_dump()`` should be called on an oops (or
+kernel panic). This will output the contents of the ftrace buffers to
+the console. This is very useful for capturing traces that lead to
+crashes and outputing it to a serial console.
+
+= ===================================================
+0 Disabled (default).
+1 Dump buffers of all CPUs.
+2 Dump the buffer of the CPU that triggered the oops.
+= ===================================================
+
+
+ftrace_enabled, stack_tracer_enabled
+====================================
+
+See :doc:`/trace/ftrace`.
+
+
hardlockup_all_cpu_backtrace
============================

@@ -1191,6 +1212,35 @@ If a value outside of this range is written to ``threads-max`` an
``EINVAL`` error occurs.


+traceoff_on_warning
+===================
+
+When set, disables tracing (see :doc:`/trace/ftrace`) when a
+``WARN()`` is hit.
+
+
+tracepoint_printk
+=================
+
+When tracepoints are sent to printk() (enabled by the ``tp_printk``
+boot parameter), this entry provides runtime control::
+
+ echo 0 > /proc/sys/kernel/tracepoint_printk
+
+will stop tracepoints from being sent to printk(), and
+
+::
+
+ echo 1 > /proc/sys/kernel/tracepoint_printk
+
+will send them to printk() again.
+
+This only works if the kernel was booted with ``tp_printk`` enabled.
+
+See :doc:`/admin-guide/kernel-parameters` and
+:doc:`/trace/boottime-trace`.
+
+
unknown_nmi_panic
=================

--
2.20.1


2020-04-28 18:45:16

by Jonathan Corbet

[permalink] [raw]
Subject: Re: [PATCH 2/3] docs: sysctl/kernel: document ftrace entries

On Thu, 23 Apr 2020 20:36:50 +0200
Stephen Kitt <[email protected]> wrote:

> Based on the ftrace documentation, the tp_printk boot parameter
> documentation, and the implementation in kernel/trace/trace.c.
>
> Signed-off-by: Stephen Kitt <[email protected]>

This one could benefit from an ack from Steve (CC'd). Also one other
little nit below:

> Documentation/admin-guide/sysctl/kernel.rst | 50 +++++++++++++++++++++
> 1 file changed, 50 insertions(+)
>
> diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
> index 82bfd5892663..d4bbdaf96ebc 100644
> --- a/Documentation/admin-guide/sysctl/kernel.rst
> +++ b/Documentation/admin-guide/sysctl/kernel.rst
> @@ -265,6 +265,27 @@ domain names are in general different. For a detailed discussion
> see the ``hostname(1)`` man page.
>
>
> +ftrace_dump_on_oops
> +===================
> +
> +Determines whether ``ftrace_dump()`` should be called on an oops (or
> +kernel panic). This will output the contents of the ftrace buffers to
> +the console. This is very useful for capturing traces that lead to
> +crashes and outputing it to a serial console.
> +
> += ===================================================
> +0 Disabled (default).
> +1 Dump buffers of all CPUs.
> +2 Dump the buffer of the CPU that triggered the oops.
> += ===================================================
> +
> +
> +ftrace_enabled, stack_tracer_enabled
> +====================================
> +
> +See :doc:`/trace/ftrace`.
> +
> +
> hardlockup_all_cpu_backtrace
> ============================
>
> @@ -1191,6 +1212,35 @@ If a value outside of this range is written to ``threads-max`` an
> ``EINVAL`` error occurs.
>
>
> +traceoff_on_warning
> +===================
> +
> +When set, disables tracing (see :doc:`/trace/ftrace`) when a
> +``WARN()`` is hit.
> +
> +
> +tracepoint_printk
> +=================
> +
> +When tracepoints are sent to printk() (enabled by the ``tp_printk``
> +boot parameter), this entry provides runtime control::
> +
> + echo 0 > /proc/sys/kernel/tracepoint_printk
> +
> +will stop tracepoints from being sent to printk(), and
> +
> +::

I would just make that ", and::" and avoid the separate line.

> +
> + echo 1 > /proc/sys/kernel/tracepoint_printk
> +
> +will send them to printk() again.
> +
> +This only works if the kernel was booted with ``tp_printk`` enabled.
> +
> +See :doc:`/admin-guide/kernel-parameters` and
> +:doc:`/trace/boottime-trace`.
> +
> +
> unknown_nmi_panic
> =================
>

Thanks,

jon

2020-04-28 20:07:06

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 2/3] docs: sysctl/kernel: document ftrace entries

On Tue, 28 Apr 2020 12:41:33 -0600
Jonathan Corbet <[email protected]> wrote:

> On Thu, 23 Apr 2020 20:36:50 +0200
> Stephen Kitt <[email protected]> wrote:
>
> > Based on the ftrace documentation, the tp_printk boot parameter
> > documentation, and the implementation in kernel/trace/trace.c.
> >
> > Signed-off-by: Stephen Kitt <[email protected]>
>
> This one could benefit from an ack from Steve (CC'd). Also one other

Thanks! I verified that the documentation is correct.

Acked-by: Steven Rostedt (VMware) <[email protected]>

-- Steve



> little nit below:
>
> > Documentation/admin-guide/sysctl/kernel.rst | 50 +++++++++++++++++++++
> > 1 file changed, 50 insertions(+)
> >
> > diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
> > index 82bfd5892663..d4bbdaf96ebc 100644
> > --- a/Documentation/admin-guide/sysctl/kernel.rst
> > +++ b/Documentation/admin-guide/sysctl/kernel.rst
> > @@ -265,6 +265,27 @@ domain names are in general different. For a detailed discussion
> > see the ``hostname(1)`` man page.
> >
> >
> > +ftrace_dump_on_oops
> > +===================
> > +
> > +Determines whether ``ftrace_dump()`` should be called on an oops (or
> > +kernel panic). This will output the contents of the ftrace buffers to
> > +the console. This is very useful for capturing traces that lead to
> > +crashes and outputing it to a serial console.
> > +
> > += ===================================================
> > +0 Disabled (default).
> > +1 Dump buffers of all CPUs.
> > +2 Dump the buffer of the CPU that triggered the oops.
> > += ===================================================
> > +
> > +
> > +ftrace_enabled, stack_tracer_enabled
> > +====================================
> > +
> > +See :doc:`/trace/ftrace`.
> > +
> > +
> > hardlockup_all_cpu_backtrace
> > ============================
> >
> > @@ -1191,6 +1212,35 @@ If a value outside of this range is written to ``threads-max`` an
> > ``EINVAL`` error occurs.
> >
> >
> > +traceoff_on_warning
> > +===================
> > +
> > +When set, disables tracing (see :doc:`/trace/ftrace`) when a
> > +``WARN()`` is hit.
> > +
> > +
> > +tracepoint_printk
> > +=================
> > +
> > +When tracepoints are sent to printk() (enabled by the ``tp_printk``
> > +boot parameter), this entry provides runtime control::
> > +
> > + echo 0 > /proc/sys/kernel/tracepoint_printk
> > +
> > +will stop tracepoints from being sent to printk(), and
> > +
> > +::
>
> I would just make that ", and::" and avoid the separate line.
>
> > +
> > + echo 1 > /proc/sys/kernel/tracepoint_printk
> > +
> > +will send them to printk() again.
> > +
> > +This only works if the kernel was booted with ``tp_printk`` enabled.
> > +
> > +See :doc:`/admin-guide/kernel-parameters` and
> > +:doc:`/trace/boottime-trace`.
> > +
> > +
> > unknown_nmi_panic
> > =================
> >
>
> Thanks,
>
> jon

2020-04-29 21:36:28

by Stephen Kitt

[permalink] [raw]
Subject: Re: [PATCH 2/3] docs: sysctl/kernel: document ftrace entries

On Tue, 28 Apr 2020 12:41:33 -0600, Jonathan Corbet <[email protected]> wrote:
> On Thu, 23 Apr 2020 20:36:50 +0200
> Stephen Kitt <[email protected]> wrote:
> > Based on the ftrace documentation, the tp_printk boot parameter
> > documentation, and the implementation in kernel/trace/trace.c.
> >
> > Signed-off-by: Stephen Kitt <[email protected]>
>
> This one could benefit from an ack from Steve (CC'd). Also one other
> little nit below:

Thanks (and thanks for the review Steve). I’ll follow up with v2 shortly,
fixing the spelling and grammar here:

> > +the console. This is very useful for capturing traces that lead to
> > +crashes and outputing it to a serial console.

in addition to this:

> > +will stop tracepoints from being sent to printk(), and
> > +
> > +::
>
> I would just make that ", and::" and avoid the separate line.

Regards,

Stephen


Attachments:
(No filename) (849.00 B)
OpenPGP digital signature