[PATCH v1 07/49] perf python: Improve perf script -l descriptions

From: Ian Rogers

Date: Sun Sep 20 2026 - 01:25:15 EST


Add module docstrings to counting.py, tracepoint.py, and twatch.py so
that 'perf script -l' displays concise descriptions for all available
standalone scripts:

```
$ perf script -l
List of available scripts:
...
counting
Example for counting perf events.
...
tracepoint
Example showing how to enable a tracepoint and access its fields.
twatch
Example to show how to enable a software event and track
context switches.
...
```

Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/python/counting.py | 1 +
tools/perf/python/tracepoint.py | 1 +
tools/perf/python/twatch.py | 1 +
3 files changed, 3 insertions(+)

diff --git a/tools/perf/python/counting.py b/tools/perf/python/counting.py
index 02121d2bb11d..9adbbeccdacd 100755
--- a/tools/perf/python/counting.py
+++ b/tools/perf/python/counting.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
+"""Example for counting perf events."""
# -*- python -*-
# -*- coding: utf-8 -*-

diff --git a/tools/perf/python/tracepoint.py b/tools/perf/python/tracepoint.py
index 9d49a25b3b1e..faa5311b8418 100755
--- a/tools/perf/python/tracepoint.py
+++ b/tools/perf/python/tracepoint.py
@@ -1,5 +1,6 @@
#! /usr/bin/env python
# SPDX-License-Identifier: GPL-2.0
+"""Example showing how to enable a tracepoint and access its fields."""
# -*- python -*-
# -*- coding: utf-8 -*-

diff --git a/tools/perf/python/twatch.py b/tools/perf/python/twatch.py
index ad35b1620781..b0f1bf113162 100755
--- a/tools/perf/python/twatch.py
+++ b/tools/perf/python/twatch.py
@@ -1,5 +1,6 @@
#! /usr/bin/env python
# SPDX-License-Identifier: GPL-2.0-only
+"""Example to show how to enable a software event and track context switches."""
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
--
2.55.0.1082.g2b9226bbc0-goog