Skip to contentSkip to conversation

Documentation/rtla: Cover BPF sample collection

PATCH In review Tomas Glozar 4 participants 11 messages Mar 11, 2025 – Apr 14, 2025

Subsystems (3)
lore
Share & tools
lore

Tomas Glozar

author maintainer
#0 lore raw

cover Documentation/rtla: Cover BPF sample collection

This is a follow-up to the BPF sample collection patchset [1], documenting both the feature's build requirements in the readme and the feature itself in the manpages.

A few fixes affecting the same manpages are also included in the patchset.

[1] https://lore.kernel.org/linux-trace-kernel/[email protected]/T/#u

Tomas Glozar (4):
Documentation/rtla: Fix duplicate text about timerlat tracer Documentation/rtla: Fix typo in rtla-timerlat.rst Documentation/rtla: Fix typo in common_timerlat_description.rst Documentation/rtla: Include BPF sample collection

 .../tools/rtla/common_timerlat_description.rst         | 10 +++++++++-
 Documentation/tools/rtla/rtla-timerlat.rst             |  9 +++------
 tools/tracing/rtla/README.txt                          |  7 +++++++
 3 files changed, 19 insertions(+), 7 deletions(-)
Signature · 1 line
2.48.1
author maintainer
#1 lore raw

PATCH 1/4 Documentation/rtla: Fix duplicate text about timerlat tracer

A passage about how the timerlat tracer outputs information is included in both common_timerlat_description.rst and rtla-timerlat.rst, leading it to be displayed twice in the rtla-timerlat page.

Remove the duplicate passage from rtla-timerlat.rst.

Fixes 29380d4055e5 ("rtla: Add rtla timerlat documentation")
---
 Documentation/tools/rtla/rtla-timerlat.rst | 3 ---
 1 file changed, 3 deletions(-)
Documentation/tools/rtla/rtla-timerlat.rst +0 -3
index 44a49e6f302b..b334fb00ba0e 100644
@@ -16,9 +16,6 @@ DESCRIPTION
 
 .. include:: common_timerlat_description.rst
 
-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. The **rtla hist hist** mode displays a histogram
 of each tracer event occurrence. For further details, please refer to the
Signature · 1 line
2.48.1
author maintainer
#2 lore raw

PATCH 2/4 Documentation/rtla: Fix typo in rtla-timerlat.rst

In reply to Tomas Glozar

The file says "rtla hist hist mode" instead of "rtla timerlat hist mode".

Fix the typo.

Fixes 29380d4055e5 ("rtla: Add rtla timerlat documentation")
---
 Documentation/tools/rtla/rtla-timerlat.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/tools/rtla/rtla-timerlat.rst +3 -3
index b334fb00ba0e..20e2d259467f 100644
@@ -17,9 +17,9 @@ DESCRIPTION
 .. include:: common_timerlat_description.rst
 
 The **rtla timerlat top** mode displays a summary of the periodic output
-from the *timerlat* tracer. The **rtla hist hist** mode displays a histogram
-of each tracer event occurrence. For further details, please refer to the
-respective man page.
+from the *timerlat* tracer. The **rtla timerlat hist** mode displays
+a histogram of each tracer event occurrence. For further details, please
+refer to the respective man page.
 
 MODES
 =====
Signature · 1 line
2.48.1
author maintainer
#3 lore raw

PATCH 3/4 Documentation/rtla: Fix typo in common_timerlat_description.rst

In reply to Tomas Glozar

Fix "it enable" to "it enables".

Fixes 29380d4055e5 ("rtla: Add rtla timerlat documentation")
---
 Documentation/tools/rtla/common_timerlat_description.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/tools/rtla/common_timerlat_description.rst +1 -1
index 321201cb8597..8cd3e717baa8 100644
@@ -6,5 +6,5 @@ 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 enable the trace of the most relevant information via
+handler. It also enables the trace of the most relevant information via
 **osnoise:** tracepoints.
Signature · 1 line
2.48.1
author maintainer
#4 lore raw

PATCH 4/4 Documentation/rtla: Include BPF sample collection

In reply to Tomas Glozar

Add dependencies needed to build rtla with BPF sample collection support to README, and document both ways of sample collection in the manpages.

---
 Documentation/tools/rtla/common_timerlat_description.rst | 8 ++++++++
 tools/tracing/rtla/README.txt                            | 7 +++++++
 2 files changed, 15 insertions(+)
Documentation/tools/rtla/common_timerlat_description.rst +8 -0
index 8cd3e717baa8..49fcae3ffdec 100644
@@ -8,3 +8,11 @@ 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 enables the trace of the most relevant information via
 **osnoise:** tracepoints.
+
+The **rtla timerlat** tool sets the options of the *timerlat* tracer
+and collects and displays a summary of the results. By default,
+the collection is done synchronously in kernel space using a dedicated
+BPF program attached to the *timerlat* tracer. If either BPF or
+the **osnoise:timerlat_sample** tracepoint it attaches to is
+unavailable, the **rtla timerlat** tool falls back to using tracefs to
+process the data asynchronously in user space.
tools/tracing/rtla/README.txt +7 -0
index dd5621038c55..43e98311d10f 100644
@@ -13,6 +13,13 @@ RTLA depends on the following libraries and tools:
  - libtraceevent
  - libcpupower (optional, for --deepest-idle-state)
 
+For BPF sample collection support, the following extra dependencies are
+required:
+
+ - libbpf 1.0.0 or later
+ - bpftool with skeleton support
+ - clang with BPF CO-RE support
+
 It also depends on python3-docutils to compile man pages.
 
 For development, we suggest the following steps for compiling rtla:
Signature · 1 line
2.48.1
#5 lore raw

Re: [PATCH 4/4] Documentation/rtla: Include BPF sample collection

Quoted 14 lines · Tomas Glozar

Add dependencies needed to build rtla with BPF sample collection support to README, and document both ways of sample collection in the manpages.

---
 Documentation/tools/rtla/common_timerlat_description.rst | 8 ++++++++
 tools/tracing/rtla/README.txt                            | 7 +++++++
 2 files changed, 15 insertions(+)
Documentation/tools/rtla/common_timerlat_description.rst +0 -0
index 8cd3e717baa8..49fcae3ffdec 100644

Documentation/tools/rtla/common_timerlat_description.rst The *timerlat* tracer outputs information in two ways. It periodically · line 16

Quoted 9 lines
Documentation/tools/rtla/common_timerlat_description.rst +6 -0
@@ -8,3 +8,11 @@ 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 enables the trace of the most relevant information via
 **osnoise:** tracepoints.
+
+The **rtla timerlat** tool sets the options of the *timerlat* tracer
+and collects and displays a summary of the results. By default,
+the collection is done synchronously in kernel space using a dedicated
+BPF program attached to the *timerlat* tracer. If either BPF or
+the **osnoise:timerlat_sample** tracepoint it attaches to is

In the last phrase, s/is/are/. So that "If either... or... are unavailable".

Luis

Quoted 23 lines
Documentation/tools/rtla/common_timerlat_description.rst +2 -0
+unavailable, the **rtla timerlat** tool falls back to using tracefs to
+process the data asynchronously in user space.
tools/tracing/rtla/README.txt +7 -0
index dd5621038c55..43e98311d10f 100644
@@ -13,6 +13,13 @@ RTLA depends on the following libraries and tools:
  - libtraceevent
  - libcpupower (optional, for --deepest-idle-state)
 
+For BPF sample collection support, the following extra dependencies are
+required:
+
+ - libbpf 1.0.0 or later
+ - bpftool with skeleton support
+ - clang with BPF CO-RE support
+
 It also depends on python3-docutils to compile man pages.
 
 For development, we suggest the following steps for compiling rtla:
Signature · 1 line
2.48.1

---end quoted text---

author maintainer
#6 lore raw

Re: [PATCH 4/4] Documentation/rtla: Include BPF sample collection

út 11. 3. 2025 v 14:07 odesílatel Luis Claudio R. Goncalves <[email protected]> napsal:

Quoted 5 lines

In the last phrase, s/is/are/. So that "If either... or... are unavailable".

Luis

All references I found on this topic say the verb should be singular (since both "BPF" and "the osnoise:timerlat_sample tracepoint" are singular). Search for "either or subject verb agreement", e.g. [1].

[1] https://www.englishgrammar.org/subjectverb-agreement-2/

Tomas

maintainer
#7 lore raw

Re: [PATCH 4/4] Documentation/rtla: Include BPF sample collection

Quoted 5 lines · Tomas Glozar

út 11. 3. 2025 v 14:07 odesílatel Luis Claudio R. Goncalves <[email protected]> napsal:

Quoted 3 lines

In the last phrase, s/is/are/. So that "If either... or... are unavailable".

Quoted 8 lines
Quoted 2 lines

Luis

All references I found on this topic say the verb should be singular (since both "BPF" and "the osnoise:timerlat_sample tracepoint" are singular). Search for "either or subject verb agreement", e.g. [1].

[1] https://www.englishgrammar.org/subjectverb-agreement-2/

I concur with that reasoning, FWIW.

What is the intended path to get this one upstream; should I take it?

Thanks,

jon

maintainer Acked-by
#8 lore raw

Re: [PATCH 4/4] Documentation/rtla: Include BPF sample collection

Quoted 1 line · On Mon, 17 Mar 2025 16:47:41 -0600 Jonathan Corbet <[email protected]> wrote:

What is the intended path to get this one upstream; should I take it?

Hi Jon,

Yes, can you take this through your tree?

You can add:

Thanks!

-- Steve

maintainer
#9 lore raw

Re: [PATCH 4/4] Documentation/rtla: Include BPF sample collection

Quoted 5 lines · Steven Rostedt
Quoted 1 line · On Mon, 17 Mar 2025 16:47:41 -0600 Jonathan Corbet <[email protected]> wrote:

What is the intended path to get this one upstream; should I take it?

Quoted 7 lines

Hi Jon,

Yes, can you take this through your tree?

You can add:

...and I have finally done that ...

Thanks,

jon

Reviewed-by on the v1 series
#10 lore raw
In reply to Tomas Glozar
Quoted 8 lines · Tomas Glozar

This is a follow-up to the BPF sample collection patchset [1], documenting both the feature's build requirements in the readme and the feature itself in the manpages.

A few fixes affecting the same manpages are also included in the patchset.

[1] https://lore.kernel.org/linux-trace-kernel/[email protected]/T/#u

LGTM.

Quoted 6 lines

Tomas Glozar (4):
Documentation/rtla: Fix duplicate text about timerlat tracer Documentation/rtla: Fix typo in rtla-timerlat.rst Documentation/rtla: Fix typo in common_timerlat_description.rst Documentation/rtla: Include BPF sample collection

Quoted 8 lines
 .../tools/rtla/common_timerlat_description.rst         | 10 +++++++++-
 Documentation/tools/rtla/rtla-timerlat.rst             |  9 +++------
 tools/tracing/rtla/README.txt                          |  7 +++++++
 3 files changed, 19 insertions(+), 7 deletions(-)
Signature · 1 line
2.48.1

---end quoted text---