Re: [PATCH V5 06/16] Documentation/rv: Add a basic documentation

From: Tao Zhou
Date: Sun Jul 17 2022 - 11:19:41 EST


On Wed, Jul 13, 2022 at 11:17:22PM +0200, Daniel Bristot de Oliveira wrote:
> Add the runtime-verification.rst document, explaining the basics of RV
> and how to use the interface.
>
> Cc: Wim Van Sebroeck <wim@xxxxxxxxxxxxxxxxxx>
> Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
> Cc: Jonathan Corbet <corbet@xxxxxxx>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Will Deacon <will@xxxxxxxxxx>
> Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
> Cc: Marco Elver <elver@xxxxxxxxxx>
> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
> Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
> Cc: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
> Cc: Gabriele Paoloni <gpaoloni@xxxxxxxxxx>
> Cc: Juri Lelli <juri.lelli@xxxxxxxxxx>
> Cc: Clark Williams <williams@xxxxxxxxxx>
> Cc: Tao Zhou <tao.zhou@xxxxxxxxx>
> Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
> Cc: linux-doc@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: linux-trace-devel@xxxxxxxxxxxxxxx
> Signed-off-by: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
> ---
> Documentation/trace/index.rst | 1 +
> Documentation/trace/rv/index.rst | 9 +
> .../trace/rv/runtime-verification.rst | 233 ++++++++++++++++++
> kernel/trace/rv/Kconfig | 3 +
> kernel/trace/rv/rv.c | 3 +
> 5 files changed, 249 insertions(+)
> create mode 100644 Documentation/trace/rv/index.rst
> create mode 100644 Documentation/trace/rv/runtime-verification.rst
> + runtime-verification.rst

[snip]

> +The user interface
> +==================
> +
> +The user interface resembles the tracing interface (on purpose). It is
> +currently at "/sys/kernel/tracing/rv/".
> +
> +The following files/folders are currently available:
> +
> +**available_monitors**
> +
> +- Reading list the available monitors, one per line
> +
> +For example::
> +
> + # cat available_monitors
> + wip
> + wwnr
> +
> +**available_reactors**
> +
> +- Reading shows the available reactors, one per line.
> +
> +For example::
> +
> + # cat available_reactors
> + nop
> + panic
> + printk
> +
> +**enabled_monitors**:
> +
> +- Reading lists the enabled monitors, one per line
> +- Writing to it enables a given monitor
> +- Writing a monitor name with a '-' prefix disables it

s/-/!/

> +- Truncating the file disables all enabled monitors
> +
> +For example::
> +
> + # cat enabled_monitors
> + # echo wip > enabled_monitors
> + # echo wwnr >> enabled_monitors
> + # cat enabled_monitors
> + wip
> + wwnr
> + # echo '!wip' >> enabled_monitors
> + # cat enabled_monitors
> + wwnr
> + # echo > enabled_monitors
> + # cat enabled_monitors
> + #
> +
> +Note that it is possible to enable more than one monitor concurrently.
> +
> +
> +**monitoring_on**
> +
> +This is an on/off general switcher for monitoring. It resembles the
> +"tracing_on" switcher in the trace interface.
> +
> +- Writing "0" stops the monitoring
> +- Writing "1" continues the monitoring
> +- Reading returns the current status of the monitoring
> +
> +Note that it does not disable enabled monitors but stop the per-entity
> +monitors monitoring the events received from the system.
> +
> +**reacting_on**
> +
> +- Writing "0" prevents reactions for happening
> +- Writing "1" enable reactions
> +- Reading returns the current status of the monitoring

s/monitoring/reaction/