Skip to content
Permalink
Daniel-Bristot…
Switch branches/tags

Commits on Feb 14, 2022

  1. Documentation/rv: Add watchdog-monitor documentation

    Adds documentation about the safe_wtd and safe_wtd_nwo RV monitors,
    and their usage via a safety application.
    
    Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  2. rv/safety_app: Add an safety_app sample

    This is the sample code of a safety application that uses the
    watchdog as a safety monitor and the RV monitors to monitor
    this interaction/get feedback from kernel about the watchdog states.
    
    This tool first creates a trace instance to follow the RV events
    and then enables RV monitor. After that, the tool configures
    the watchdog and starts running the main loop.
    
    The main loop runs a use-case-specific function, like checking
    the system. If the system is running as expected, it pings the
    watchdog. After pinging the watchdog, the tool then collects
    trace information to see if the RV monitor received the expected
    events and is in a safe/safe_nwo state.
    
    For further information, run safety_app --help
    
    The safety-app specification was developed together with Gabriele Paoloni,
    in the context of the Linux Foundation Elisa Project.
    
    Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  3. rv/monitor: Add safe watchdog nowayout monitor

    This is a simplification of the safe_wtd monitor, named safe_wtd_nwo.
    The difference between these two monitors is that the latter enforces
    the nowayout watchdog device option before opening the watchdog.
    
    In this way, once the watchdog is starts, the watchdog hardware will
    serve as an safety-monitor until the system shutdown.
    
    For further information, please refer to:
            Documentation/trace/rv/watchdog-monitor.rst
    
    The monitor specification was developed together with Gabriele Paoloni,
    in the context of the Linux Foundation Elisa Project.
    
    Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  4. rv/monitor: Add safe watchdog monitor

    The watchdog is an essential building block for the usage of Linux in
    safety-critical systems because it allows the system to be monitored from
    an external element - the watchdog hardware, acting as a safety-monitor.
    
    A user-space application controls the watchdog device via the watchdog
    interface. This application, hereafter safety_app, enables the watchdog
    and periodically pets the watchdog upon correct completion of the safety
    related processing.
    
    If the safety_app, for any reason, stops pinging the watchdog,
    the watchdog hardware can set the system in a fail-safe state. For
    example, shutting the system down.
    
    Given the importance of the safety_app / watchdog hardware couple,
    the interaction between these software pieces also needs some
    sort of monitoring. In other words, "who monitors the monitor?"
    
    The safe watchdog (safe_wtd) RV monitor monitors the interaction between
    the safety_app and the watchdog device, enforcing the correct sequence of
    events that leads the system to a safe state.
    
    Furthermore, the safety_app can monitor the RV monitor by collecting the
    events generated by the RV monitor itself via tracing interface. In this way,
    closing the monitoring loop with the safety_app.
    
    To reach a safe state, the safe_wtd RV monitor requires the
    safety_app to:
    
    	- Open the watchdog device
    	- Start the watchdog
    	- Set a timeout
    	- ping at least once
    
    The RV monitor also avoids some undesired actions. For example, to have
    other threads to touch the watchdog.
    
    The monitor also has a set of options, enabled via kernel command
    line/module options. They are:
    
    	- watchdog_id: the device id to monitor (default 0).
    	- dont_stop: once enabled, do not allow the RV monitor to be stopped
    		(default off);
    	- safe_timeout: define a maximum safe value that an user-space
    		application can set as the watchdog timeout
    		(default unlimited).
    	- check_timeout: After every ping, check if the time left in the
    		watchdog is less than or equal to the last timeout set
    		for the watchdog. It only works for watchdog devices that
    		provide the get_timeleft() function (default off).
    
    For further information, please refer to:
    	Documentation/trace/rv/watchdog-monitor.rst
    
    The monitor specification was developed together with Gabriele Paoloni,
    in the context of the Linux Foundation Elisa Project.
    
    Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  5. watchdog/dev: Add tracepoints

    Add a set of tracepoints, enabling the observability of the watchdog
    device interactions with user-space.
    
    The events are:
    	watchdog:watchdog_open
    	watchdog:watchdog_close
    	watchdog:watchdog_start
    	watchdog:watchdog_stop
    	watchdog:watchdog_set_timeout
    	watchdog:watchdog_ping
    	watchdog:watchdog_nowayout
    	watchdog:watchdog_set_keep_alive
    	watchdog:watchdog_keep_alive
    
    Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  6. Documentation/rv: Add deterministic automata instrumentation document…

    …ation
    
    Add the da_monitor_instrumentation.rst. It describes the basics
    of RV monitor instrumentation.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  7. Documentation/rv: Add deterministic automata monitor synthesis docume…

    …ntation
    
    Add the da_monitor_synthesis.rst introduces some concepts behind the
    Deterministic Automata (DA) monitor synthesis and interface.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  8. Documentation/rv: Add a basic documentation

    Add the runtime-verification.rst document, explaining the basics of RV
    and how to use the interface.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  9. rv/reactor: Add the panic reactor

    Sample reactor that panics the system when an exception is found. This
    is useful both to capture a vmcore, or to fail-safe a critical system.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  10. rv/reactor: Add the printk reactor

    Sample reactor that printks the reaction message.
    
    Note: do not use this reactor with rq_lock taken, it will lock the
    system until printk can handle that.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  11. rv/monitor: wwnr instrumentation and Makefile/Kconfig entries

    Adds the instrumentation to the previously created wwnr monitor, as an
    example of the developer work. It also adds a Makefile and Kconfig
    entries.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  12. rv/monitor: Add the wwnr monitor skeleton created by dot2k

    Per task wakeup while not running (wwnr) monitor, generated by dot2k
    with this command line:
    
      $ dot2k -d wwnr.dot -t per_task
    
    The model is:
     ----- %< -----
    digraph state_automaton {
    	center = true;
    	size = "7,11";
    	{node [shape = plaintext, style=invis, label=""] "__init_not_running"};
    	{node [shape = ellipse] "not_running"};
    	{node [shape = plaintext] "not_running"};
    	{node [shape = plaintext] "running"};
    	"__init_not_running" -> "not_running";
    	"not_running" [label = "not_running", color = green3];
    	"not_running" -> "not_running" [ label = "wakeup" ];
    	"not_running" -> "running" [ label = "switch_in" ];
    	"running" [label = "running"];
    	"running" -> "not_running" [ label = "switch_out" ];
    	{ rank = min ;
    		"__init_not_running";
    		"not_running";
    	}
    }
     ----- >% -----
    
    This model is broken, the reason is that a task can be running in the
    processor without being set as RUNNABLE. Think about a task about to
    sleep:
    
    1:	set_current_state(TASK_UNINTERRUPTIBLE);
    2:	schedule();
    
    And then imagine an IRQ happening in between the lines one and two,
    waking the task up. BOOM, the wakeup will happen while the task is
    running.
    
    Q: Why do we need this model, so?
    A: To test the reactors.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  13. rv/monitor: wip instrumentation and Makefile/Kconfig entries

    Adds the instrumentation to the previously created wip monitor, as an
    example of the developer work. It also adds a Makefile and Kconfig
    entries.
    
    This is a good example of the manual work that is left for the
    developer to do.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  14. rv/monitor: Add the wip monitor skeleton created by dot2k

    This is the direct output this command line:
      $ dot2k -d ~/wip.dot -t per_cpu
    
    with wip.dot as:
     ----- %< -----
    digraph state_automaton {
    	center = true;
    	size = "7,11";
    	rankdir = LR;
    	{node [shape = circle] "non_preemptive"};
    	{node [shape = plaintext, style=invis, label=""] "__init_preemptive"};
    	{node [shape = doublecircle] "preemptive"};
    	{node [shape = circle] "preemptive"};
    	"__init_preemptive" -> "preemptive";
    	"non_preemptive" [label = "non_preemptive"];
    	"non_preemptive" -> "non_preemptive" [ label = "sched_waking" ];
    	"non_preemptive" -> "preemptive" [ label = "preempt_enable" ];
    	"preemptive" [label = "preemptive"];
    	"preemptive" -> "non_preemptive" [ label = "preempt_disable" ];
    	{ rank = min ;
    		"__init_preemptive";
    		"preemptive";
    	}
    }
     ----- >% -----
    
    This model is broken because preempt_disable_notrace(). It is broken on
    purpose to test the reactors.
    
    It does not compile because it lacks the instrumentation, which will be
    add next.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  15. tools/rv: Add dot2k

    transform .dot file into kernel rv monitor
    
    usage: dot2k [-h] -d DOT_FILE -t MONITOR_TYPE [-n MODEL_NAME] [-D DESCRIPTION]
    
    optional arguments:
      -h, --help            show this help message and exit
      -d DOT_FILE, --dot DOT_FILE
      -t MONITOR_TYPE, --monitor_type MONITOR_TYPE
      -n MODEL_NAME, --model_name MODEL_NAME
      -D DESCRIPTION, --description DESCRIPTION
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  16. tools/rv: Add dot2c

    dot2c is a tool that transforms an automata in the graphiviz .dot file
    into an C representation of the automata.
    
    usage: dot2c [-h] dot_file
    
    dot2c: converts a .dot file into a C structure
    
    positional arguments:
      dot_file    The dot file to be converted
    
    optional arguments:
      -h, --help  show this help message and exit
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  17. rv/include: Add tracing helper functions

    Tracing helper functions to facilitate the instrumentation of
    auto-generated RV monitors create by dot2k.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  18. rv/include: Add deterministic automata monitor definition via C macros

    In Linux terms, the runtime verification monitors are encapsulated
    inside the "RV monitor" abstraction. The "RV monitor" includes a set
    of instances of the monitor (per-cpu monitor, per-task monitor, and
    so on), the helper functions that glue the monitor to the system
    reference model, and the trace output as a reaction for event parsing
    and exceptions, as depicted below:
    
    Linux  +----- RV Monitor ----------------------------------+ Formal
     Realm |                                                   |  Realm
     +-------------------+     +----------------+     +-----------------+
     |   Linux kernel    |     |     Monitor    |     |     Reference   |
     |     Tracing       |  -> |   Instance(s)  | <-  |       Model     |
     | (instrumentation) |     | (verification) |     | (specification) |
     +-------------------+     +----------------+     +-----------------+
            |                          |                       |
            |                          V                       |
            |                     +----------+                 |
            |                     | Reaction |                 |
            |                     +--+--+--+-+                 |
            |                        |  |  |                   |
            |                        |  |  +-> trace output ?  |
            +------------------------|--|----------------------+
                                     |  +----> panic ?
                                     +-------> <user-specified>
    
    The dot2c tool presented in this paper:
    
    DE OLIVEIRA, Daniel Bristot; CUCINOTTA, Tommaso; DE OLIVEIRA, Romulo
    Silva. Efficient formal verification for the Linux kernel. In:
    International Conference on Software Engineering and Formal Methods.
    Springer, Cham, 2019. p. 315-332.
    
    Translates a deterministic automaton in the DOT format into a C
    source code representation that to be used for monitoring connecting
    the Formal Reaml to Linux-like code.
    
    This header file goes beyond, extending the code generation to the
    verification stage, generating the code to the Monitor Instance(s)
    level using C macros. The trace event code inspires this approach.
    
    The benefits of the usage of macro for monitor synthesis is 3-fold:
    
    	- Reduces the code duplication;
    	- Facilitates the bug fix/improvement;
    	(but mainly:)
    	- Avoids the case of developers changing the core of the monitor
    	  code to manipulate the model in a (let's say) non-standard
    	  way.
    
    This initial implementation presents two different types of monitor
    instances:
    
    	- #define DECLARE_DA_MON_PER_CPU(name, type)
    	- #define DECLARE_DA_MON_PER_TASK(name, type)
    
    The first declares the functions for deterministic automata monitor
    with per-cpu instances, and the second with per-task instances.
    
    In both cases, the name is a string that identifies the monitor,
    and the type is the data type used by dot2c/k on the representation
    of the model.
    
    For example, the model "wip" below:
    
                         preempt_disable                       sched_waking
       +############+ >------------------> +################+ >------------+
     -># preemptive #                      # non-preemptive #              |
       +############+ <-----------------<  +################+ <------------+
                        preempt_enable
    
    with two states and three events can be stored in a 'char' type.
    Considering that the preemption control is a per-cpu behavior, the
    monitor declaration will be:
    
      DECLARE_DA_MON_PER_CPU(wip, char);
    
    The monitor is executed by sending events to be processed via the
    functions presented below:
    
      da_handle_event_$(MONITOR_NAME)($(event from event enum));
      da_handle_init_event_$(MONITOR_NAME)($(event from event enum));
    
    The function da_handle_event_$(MONITOR_NAME) is the regular case,
    while the function da_handle_init_event_$(MONITOR_NAME)() is a
    special case used to synchronize the system with the model.
    
    When a monitor is enabled, it is placed in the initial state of the
    automata. However, the monitor does not know if the system is in
    the initial state. Hence, the monitor ignores events sent by
    sent by da_handle_event_$(MONITOR_NAME) until the function
    da_handle_init_event_$(MONITOR_NAME)() is called.
    
    The function da_handle_init_event_$(MONITOR_NAME)() should be used for
    the case in which the system generates the event is the one that returns
    the automata to the initial state.
    
    After receiving a da_handle_init_event_$(MONITOR_NAME)() event, the
    monitor will know that it is in sync with the system and hence will
    start processing the next events.
    
    Using the wip model as example, the events "preempt_disable" and
    "sched_waking" should be sent to to monitor, respectively, via:
            da_handle_event_wip(preempt_disable);
            da_handle_event_wip(sched_waking);
    
    While the event "preempt_enabled" will use:
            da_handle_init_event_wip(preempt_enable);
    
    To notify the monitor that the system will be returning to the initial
    state, so the system and the monitor should be in sync.
    
    With the monitor synthesis in place, using these headers and dot2k,
    the developer's work should be limited to the instrumentation of
    the system, increasing the confidence in the overall approach.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  19. rv/include: Add helper functions for deterministic automata

    Formally, a deterministic automaton, denoted by G, is defined as a
    quintuple:
    
      G = { X, E, f, x_0, X_m }
    
    where:
    	- X is the set of states;
    	- E is the finite set of events;
    	- x_0 is the initial state;
    	- X_m (subset of X) is the set of marked states.
    	- f : X x E -> X $ is the transition function. It defines the
    	  state transition in the occurrence of a event from E in
    	  the state X. In the special case of deterministic automata,
    	  the occurence of the event in E in a state in X has a
    	  deterministic next state from X.
    
    An automaton can also be represented using a graphical format of
    vertices (nodes) and edges. The open-source tool Graphviz can produce
    this graphic format using the (textual) DOT language as the source code.
    
    The dot2c tool presented in this paper:
    
    DE OLIVEIRA, Daniel Bristot; CUCINOTTA, Tommaso; DE OLIVEIRA, Romulo
    Silva. Efficient formal verification for the Linux kernel. In:
    International Conference on Software Engineering and Formal Methods.
    Springer, Cham, 2019. p. 315-332.
    
    Translates a deterministic automaton in the DOT format into a C
    source code representation that to be used for monitoring.
    
    This header file implements helper functions to facilitate the usage
    of the C output from dot2c for monitoring.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  20. rv: Add runtime reactors interface

    A runtime monitor can cause a reaction to the detection of an
    exception on the model's execution. By default, the monitors have
    tracing reactions, printing the monitor output via tracepoints.
    But other reactions can be added (on-demand) via this interface.
    
    The user interface resembles the kernel tracing interface and
    presents these files:
    
    "available_reactors"
      - Reading shows the available reactors, one per line.
    
       For example:
       [root@f32 rv]# cat available_reactors
       nop
       panic
       printk
    
     "reacting_on"
       - It is an on/off general switch for reactors, disabling
       all reactions.
    
     "monitors/MONITOR/reactors"
       - List available reactors, with the select reaction for the given
       MONITOR inside []. The default one is the nop (no operation)
       reactor.
       - Writing the name of a reactor enables it to the given
       MONITOR.
    
       For example:
       [root@f32 rv]# cat monitors/wip/reactors
       [nop]
       panic
       printk
       [root@f32 rv]# echo panic > monitors/wip/reactors
       [root@f32 rv]# cat monitors/wip/reactors
       nop
       [panic]
       printk
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022
  21. rv: Add Runtime Verification (RV) interface

    RV is a lightweight (yet rigorous) method that complements classical
    exhaustive verification techniques (such as model checking and
    theorem proving) with a more practical approach to complex systems.
    
    RV works by analyzing the trace of the system's actual execution,
    comparing it against a formal specification of the system behavior.
    RV can give precise information on the runtime behavior of the
    monitored system while enabling the reaction for unexpected
    events, avoiding, for example, the propagation of a failure on
    safety-critical systems.
    
    The development of this interface roots in the development of the
    paper:
    
    DE OLIVEIRA, Daniel Bristot; CUCINOTTA, Tommaso; DE OLIVEIRA, Romulo
    Silva. Efficient formal verification for the Linux kernel. In:
    International Conference on Software Engineering and Formal Methods.
    Springer, Cham, 2019. p. 315-332.
    
    And:
    
    DE OLIVEIRA, Daniel Bristot, et al. Automata-based formal analysis
    and verification of the real-time Linux kernel. PhD Thesis, 2020.
    
    The RV interface resembles the tracing/ interface on purpose. The current
    path for the RV interface is /sys/kernel/tracing/rv/.
    
    It presents these files:
    
     "available_monitors"
       - List the available monitors, one per line.
    
       For example:
       [root@f32 rv]# cat available_monitors
       wip
       wwnr
    
     "enabled_monitors"
       - Lists the enabled monitors, one per line;
       - Writing to it enables a given monitor;
       - Writing a monitor name with a '-' prefix disables it;
       - Truncating the file disables all enabled monitors.
    
       For example:
       [root@f32 rv]# cat enabled_monitors
       [root@f32 rv]# echo wip > enabled_monitors
       [root@f32 rv]# echo wwnr >> enabled_monitors
       [root@f32 rv]# cat enabled_monitors
       wip
       wwnr
       [root@f32 rv]# echo -wip >> enabled_monitors
       [root@f32 rv]# cat enabled_monitors
       wwnr
       [root@f32 rv]# echo > enabled_monitors
       [root@f32 rv]# cat enabled_monitors
       [root@f32 rv]#
    
       Note that more than one monitor can be enabled concurrently.
    
     "monitoring_on"
       - It is an on/off general switcher for monitoring. Note
       that it does not disable enabled monitors, but stop the per-entity
       monitors of monitoring the events received from the system.
       It resambles the "tracing_on" switcher.
    
     "monitors/"
       Each monitor will have its one directory inside "monitors/". There
       the monitor specific files will be presented.
       The "monitors/" directory resambles the "events" directory on
       tracefs.
    
       For example:
       [root@f32 rv]# cd monitors/wip/
       [root@f32 wip]# ls
       desc  enable
       [root@f32 wip]# cat desc
       auto-generated wakeup in preemptive monitor.
       [root@f32 wip]# cat enable
       0
    
    For further information, see the comments in the header of
    kernel/trace/rv/rv.c from this patch.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Gabriele Paoloni <gpaoloni@redhat.com>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Daniel Bristot de Oliveira authored and intel-lab-lkp committed Feb 14, 2022

Commits on Jan 23, 2022

  1. ftrace: Fix assuming build time sort works for s390

    To speed up the boot process, as mcount_loc needs to be sorted for ftrace
    to work properly, sorting it at build time is more efficient than boot up
    and can save milliseconds of time. Unfortunately, this change broke s390
    as it will modify the mcount_loc location after the sorting takes place
    and will put back the unsorted locations. Since the sorting is skipped at
    boot up if it is believed that it was sorted at run time, ftrace can crash
    as its algorithms are dependent on the list being sorted.
    
    Add a new config BUILDTIME_MCOUNT_SORT that is set when
    BUILDTIME_TABLE_SORT but not if S390 is set. Use this config to determine
    if sorting should take place at boot up.
    
    Link: https://lore.kernel.org/all/yt9dee51ctfn.fsf@linux.ibm.com/
    
    Fixes: 72b3942 ("scripts: ftrace - move the sort-processing in ftrace_init")
    Reported-by: Sven Schnelle <svens@linux.ibm.com>
    Tested-by: Heiko Carstens <hca@linux.ibm.com>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    rostedt committed Jan 23, 2022

Commits on Jan 18, 2022

  1. script/sorttable: Fix some initialization problems

    elf_mcount_loc and mcount_sort_thread definitions are not
    initialized immediately within the function, which can cause
    the judgment logic to use uninitialized values when the
    initialization logic of subsequent code fails.
    
    Link: https://lkml.kernel.org/r/20211212113358.34208-2-yinan@linux.alibaba.com
    Link: https://lkml.kernel.org/r/20220118065241.42364-1-yinan@linux.alibaba.com
    
    Fixes: 72b3942 ("scripts: ftrace - move the sort-processing in ftrace_init")
    Tested-by: Nathan Chancellor <nathan@kernel.org>
    Reviewed-by: Nathan Chancellor <nathan@kernel.org>
    Signed-off-by: Yinan Liu <yinan@linux.alibaba.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Yinan Liu authored and rostedt committed Jan 18, 2022

Commits on Jan 14, 2022

  1. tracing: Add ustring operation to filtering string pointers

    Since referencing user space pointers is special, if the user wants to
    filter on a field that is a pointer to user space, then they need to
    specify it.
    
    Add a ".ustring" attribute to the field name for filters to state that the
    field is pointing to user space such that the kernel can take the
    appropriate action to read that pointer.
    
    Link: https://lore.kernel.org/all/yt9d8rvmt2jq.fsf@linux.ibm.com/
    
    Fixes: 77360f9 ("tracing: Add test for user space strings when filtering on string pointers")
    Tested-by: Sven Schnelle <svens@linux.ibm.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    rostedt committed Jan 14, 2022

Commits on Jan 13, 2022

  1. rtla: Add rtla timerlat hist documentation

    Man page for rtla timerlat hist mode.
    
    Link: https://lkml.kernel.org/r/4a184003fdb81e23be3fe5ec882b1c89d5a95458.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
  2. rtla: Add rtla timerlat top documentation

    Man page for rtla timerlat top mode.
    
    Link: https://lkml.kernel.org/r/58c3d6212e6c6f1f012deb2e998dd082da92075f.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
  3. rtla: Add rtla timerlat documentation

    Man page for rtla timerlat tool.
    
    Link: https://lkml.kernel.org/r/78678b8d024bf5a3a79f831ac9441b96e8d2f56e.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
  4. rtla: Add rtla osnoise hist documentation

    Man page for rtla osnoise hist mode.
    
    Link: https://lkml.kernel.org/r/d43cc5d516b8db180575c4b66c4aa67c6a724a8d.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
  5. rtla: Add rtla osnoise top documentation

    Man page for rtla osnoise top mode.
    
    Link: https://lkml.kernel.org/r/445aa2173ca152fc2e68719e3c1a2547dd01efd3.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
  6. rtla: Add rtla osnoise man page

    Man page for rtla osnoise command.
    
    Link: https://lkml.kernel.org/r/304747c602e46f6396e3bb75dfdcb42ae3656dca.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
  7. rtla: Add Documentation

    Adds the basis for rtla documentation. This patch also
    includes the rtla(1) man page.
    
    As suggested by Jonathan Corbet, we are placing these man
    pages at Documentation/tools/rtla, using rst format. It
    is not linked to the official documentation, though.
    
    The Makefile is based on bpftool's Documentation one.
    
    Link: https://lkml.kernel.org/r/5f510f3e962fc0cd531c43f5a815544dd720c3f2.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Suggested-by: Steven Rostedt <rostedt@goodmis.org>
    Suggested-by: Jonathan Corbet <corbet@lwn.net>
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
  8. rtla/timerlat: Add timerlat hist mode

    The rtla hist hist mode displays a histogram of each tracer event
    occurrence, both for IRQ and timer latencies. The tool also allows
    many configurations of the timerlat tracer and the collection of
    the tracer output.
    
    Here is one example of the rtla timerlat hist mode output:
      ---------- %< ----------
     [root@alien ~]# rtla timerlat hist -c 0-3 -d 1M
     # RTLA timerlat histogram
     # Time unit is microseconds (us)
     # Duration:   0 00:01:00
     Index   IRQ-000   Thr-000   IRQ-001   Thr-001   IRQ-002   Thr-002   IRQ-003   Thr-003
     0         58572         0     59373         0     58691         0     58895         0
     1          1422     57021       628     57241      1310     56160      1102     56805
     2             6      2931         0      2695         0      3567         4      3031
     3             1        40         0        53         0       260         0       142
     4             0         7         0         5         0         6         0        17
     5             0         2         0         5         0         7         0         4
     6             0         0         0         2         0         1         0         1
     8             0         0         0         0         0         0         0         1
     over:         0         0         0         0         0         0         0         0
     count:    60001     60001     60001     60001     60001     60001     60001     60001
     min:          0         1         0         1         0         1         0         1
     avg:          0         1         0         1         0         1         0         1
     max:          3         5         1         6         1         6         2         8
      ---------- >% ----------
    
    Running
     - rtla timerlat hist --help
    provides information about the available options.
    
    Link: https://lkml.kernel.org/r/7049ed3c46b7d6aceab18ffe7770003dfc4ddceb.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
  9. rtla: Add timerlat tool and timelart top mode

    The rtla timerlat tool is an interface for the timerlat tracer.
    The timerlat tracer dispatches a kernel thread per-cpu. These threads set a
    periodic timer to wake themselves up and go back to sleep. After the
    wakeup, they collect and generate useful information for the debugging of
    operating system timer latency.
    
    The timerlat tracer outputs information in two ways. It periodically
    prints the timer latency at the timer IRQ handler and the Thread handler.
    It also provides information for each noise via the osnoise tracepoints.
    
    The rtla timerlat top mode displays a summary of the periodic output from
    the timerlat tracer.
    
    Here is one example of the rtla timerlat tool output:
     ---------- %< ----------
    [root@alien ~]# rtla timerlat top -c 0-3 -d 1m
                                         Timer Latency
      0 00:01:00   |          IRQ Timer Latency (us)        |         Thread Timer Latency (us)
    CPU COUNT      |      cur       min       avg       max |      cur       min       avg       max
      0 #60001     |        0         0         0         3 |        1         1         1         6
      1 #60001     |        0         0         0         3 |        2         1         1         5
      2 #60001     |        0         0         1         6 |        1         1         2         7
      3 #60001     |        0         0         0         7 |        1         1         1        11
     ---------- >% ----------
    
    Running:
      # rtla timerlat --help
      # rtla timerlat top --help
    provides information about the available options.
    
    Link: https://lkml.kernel.org/r/e95032e20c2b88c962195bf7693bb53c9ebcced8.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
  10. rtla/osnoise: Add the hist mode

    The rtla osnoise hist tool collects all osnoise:sample_threshold
    occurrence in a histogram, displaying the results in a user-friendly
    way. The tool also allows many configurations of the osnoise tracer
    and the collection of the tracer output.
    
    Here is one example of the rtla osnoise hist tool output:
      ---------- %< ----------
     [root@f34 ~]# rtla osnoise hist --bucket-size 10 --entries 100 -c 0-8 -d 1M -r 9000 -P F:1
     # RTLA osnoise histogram
     # Time unit is microseconds (us)
     # Duration:   0 00:01:00
     Index   CPU-000   CPU-001   CPU-002   CPU-003   CPU-004   CPU-005   CPU-006   CPU-007   CPU-008
     0           430       434       352       455       440       463       467       436       484
     10           88        88        92       141       120       100       126       166       100
     20           19         7        12        22         8         8        13        13        16
     30            6         0         2         0         1         2         2         1         0
     50            0         0         0         0         0         0         1         0         0
     over:         0         0         0         0         0         0         0         0         0
     count:      543       529       458       618       569       573       609       616       600
     min:          0         0         0         0         0         0         0         0         0
     avg:          0         0         0         0         0         0         0         0         0
     max:         30        20        30        20        30        30        50        30        20
      ---------- >% ----------
    
    Running
     - rtla osnoise hist --help
    
    provides information about the available options.
    
    Link: https://lkml.kernel.org/r/c68060544de89b8b62510ed91c7369f162eb465b.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
  11. rtla/osnoise: Add osnoise top mode

    The rtla osnoise tool is an interface for the osnoise tracer. The
    osnoise tracer dispatches a kernel thread per-cpu. These threads read
    the time in a loop while with preemption, softirqs and IRQs enabled,
    thus allowing all the sources of osnoise during its execution. The
    osnoise threads take note of the entry and exit point of any source
    of interferences, increasing a per-cpu interference counter. The
    osnoise tracer also saves an interference counter for each source
    of interference.
    
    The rtla osnoise top mode displays information about the periodic
    summary from the osnoise tracer.
    
    One example of rtla osnoise top output is:
    
    [root@alien ~]# rtla osnoise top -c 0-3 -d 1m -q -r 900000 -P F:1
                                             Operating System Noise
    duration:   0 00:01:00 | time is in us
    CPU Period       Runtime        Noise  % CPU Aval   Max Noise   Max Single          HW          NMI          IRQ      Softirq       Thread
      0 #58         52200000         1031    99.99802          91           60           0            0        52285            0          101
      1 torvalds#59         53100000            5    99.99999           5            5           0            9        53122            0           18
      2 torvalds#59         53100000            7    99.99998           7            7           0            8        53115            0           18
      3 torvalds#59         53100000         8274    99.98441         277           23           0            9        53778            0          660
    
    "rtla osnoise top --help" works and provide information about the
    available options.
    
    Link: https://lkml.kernel.org/r/0d796993abf587ae5a170bb8415c49368d4999e1.1639158831.git.bristot@kernel.org
    
    Cc: Tao Zhou <tao.zhou@linux.dev>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Tom Zanussi <zanussi@kernel.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
    Cc: linux-rt-users@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Daniel Bristot de Oliveira authored and rostedt committed Jan 13, 2022
Older