<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/tools/perf/python, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>perf treport: Fix profile builder type narrowing in progress callback</title>
<updated>2026-10-19T12:25:01+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@linaro.org</email>
</author>
<published>2026-10-06T13:03:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dd1c6ac2f70f6a5b2d57bec2584de7bc7c144508'/>
<id>dd1c6ac2f70f6a5b2d57bec2584de7bc7c144508</id>
<content type='text'>
Mypy does not retain the narrowing of an optional local variable inside
the nested progress callback, causing the perf build to fail with:

  python/treport.py:649: error: Item "None" of "ProfileBuilder | None" has no attribute "cancelled" [union-attr]

Check the loading builder before assigning it to profile so the captured
variable is inferred as ProfileBuilder rather than
Optional[ProfileBuilder]. Keep the existing assertion and background
loading behavior.

Fixes: b379b70b7b7b ("perf treport: Show the profile while it loads")
Assisted-by: Codex:GPT-6.1-Sol
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mypy does not retain the narrowing of an optional local variable inside
the nested progress callback, causing the perf build to fail with:

  python/treport.py:649: error: Item "None" of "ProfileBuilder | None" has no attribute "cancelled" [union-attr]

Check the loading builder before assigning it to profile so the captured
variable is inferred as ProfileBuilder rather than
Optional[ProfileBuilder]. Keep the existing assertion and background
loading behavior.

Fixes: b379b70b7b7b ("perf treport: Show the profile while it loads")
Assisted-by: Codex:GPT-6.1-Sol
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf timechart: Fix task row type narrowing in goto_task()</title>
<updated>2026-10-19T12:24:59+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@linaro.org</email>
</author>
<published>2026-10-06T13:03:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5927da00783dc8e5a20e059ba2762cdcff1fd3b6'/>
<id>5927da00783dc8e5a20e059ba2762cdcff1fd3b6</id>
<content type='text'>
Mypy cannot narrow Row to TaskRow or IoRow when the class passed to
isinstance() comes from a loop variable, causing the perf build to fail
with:

  python/ttimechart.py:1686: error: "Row" has no attribute "task" [attr-defined]

Check against TaskRow and IoRow explicitly so mypy can verify access to
the task attribute. The tasks and I/O views contain TaskRow and IoRow
instances respectively, so task navigation behaves as before.

Fixes: e7a72d6919804e5e ("perf timechart: Add an interactive --tui mode")
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Assisted-by: Codex:GPT-6.1-Sol
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Cc: Alice Rogers &lt;alice.mei.rogers@gmail.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mypy cannot narrow Row to TaskRow or IoRow when the class passed to
isinstance() comes from a loop variable, causing the perf build to fail
with:

  python/ttimechart.py:1686: error: "Row" has no attribute "task" [attr-defined]

Check against TaskRow and IoRow explicitly so mypy can verify access to
the task attribute. The tasks and I/O views contain TaskRow and IoRow
instances respectively, so task navigation behaves as before.

Fixes: e7a72d6919804e5e ("perf timechart: Add an interactive --tui mode")
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Assisted-by: Codex:GPT-6.1-Sol
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Cc: Alice Rogers &lt;alice.mei.rogers@gmail.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf timechart: Add an interactive --tui mode</title>
<updated>2026-10-03T09:41:36+00:00</updated>
<author>
<name>Alice Rogers</name>
<email>alice.mei.rogers@gmail.com</email>
</author>
<published>2026-10-02T18:26:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e7a72d6919804e5e5a10e13d71e259acbc7510bc'/>
<id>e7a72d6919804e5e5a10e13d71e259acbc7510bc</id>
<content type='text'>
Add ttimechart.py, a textual based interactive timechart, and a --tui
option to perf timechart that launches it through perf script. Rather
than writing an SVG file, per-CPU (busy, frequency and idle state),
per-task (running, runnable and blocked) and I/O timelines are shown in
the terminal along with a summary table. The timelines can be zoomed,
panned and the state of the selected row at the cursor is described,
including the task that woke it. The -i, -P, -T and -p options are
passed to the script.

The data is loaded in a background thread and the timelines are shown
and updated as it loads. A --dump option prints a text summary without
the UI.

Committer testing:

Fist record a short session with:

  root@x2:/home/acme/git/perf-tools-next# perf timechart record
  ^C[ perf record: Woken up 9 times to write data ]
  [ perf record: Captured and wrote 4.489 MB perf.data (29719 samples) ]
  root@x2:/home/acme/git/perf-tools-next#

Then try the TUI with:

  root@x2:/home/acme/git/perf-tools-next# tools/perf/python/ttimechart.py

or:

  root@x2:/home/acme/git/perf-tools-next# perf timechart --tui

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Alice Rogers &lt;alice.mei.rogers@gmail.com&gt;
Co-developed-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add ttimechart.py, a textual based interactive timechart, and a --tui
option to perf timechart that launches it through perf script. Rather
than writing an SVG file, per-CPU (busy, frequency and idle state),
per-task (running, runnable and blocked) and I/O timelines are shown in
the terminal along with a summary table. The timelines can be zoomed,
panned and the state of the selected row at the cursor is described,
including the task that woke it. The -i, -P, -T and -p options are
passed to the script.

The data is loaded in a background thread and the timelines are shown
and updated as it loads. A --dump option prints a text summary without
the UI.

Committer testing:

Fist record a short session with:

  root@x2:/home/acme/git/perf-tools-next# perf timechart record
  ^C[ perf record: Woken up 9 times to write data ]
  [ perf record: Captured and wrote 4.489 MB perf.data (29719 samples) ]
  root@x2:/home/acme/git/perf-tools-next#

Then try the TUI with:

  root@x2:/home/acme/git/perf-tools-next# tools/perf/python/ttimechart.py

or:

  root@x2:/home/acme/git/perf-tools-next# perf timechart --tui

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Alice Rogers &lt;alice.mei.rogers@gmail.com&gt;
Co-developed-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf treport: Show the profile while it loads</title>
<updated>2026-10-03T09:23:21+00:00</updated>
<author>
<name>Alice Rogers</name>
<email>alice.mei.rogers@gmail.com</email>
</author>
<published>2026-10-02T18:26:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b379b70b7b7b41ff3a8ec91f1506ee66dca80df4'/>
<id>b379b70b7b7b41ff3a8ec91f1506ee66dca80df4</id>
<content type='text'>
Reading a large perf.data file caused a long stall before the treport
app started. Start the app immediately and build the profile in a
background thread, showing the report tree and flame graph as they are
built with the progress in the header. The time between updates grows
with the load time as updating the views costs more as the profile
grows. A lock guards the profile shared between the threads. Quitting
while loading cancels the load.

Tree nodes are now created lazily as they are expanded, expanded nodes
and the cursor are kept across updates, and events are kept in the order
they are first seen as their values aren't comparable. Node names are
escaped so they aren't interpreted as markup.

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Alice Rogers &lt;alice.mei.rogers@gmail.com&gt;
Co-developed-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reading a large perf.data file caused a long stall before the treport
app started. Start the app immediately and build the profile in a
background thread, showing the report tree and flame graph as they are
built with the progress in the header. The time between updates grows
with the load time as updating the views costs more as the profile
grows. A lock guards the profile shared between the threads. Quitting
while loading cancels the load.

Tree nodes are now created lazily as they are expanded, expanded nodes
and the cursor are kept across updates, and events are kept in the order
they are first seen as their values aren't comparable. Node names are
escaped so they aren't interpreted as markup.

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Alice Rogers &lt;alice.mei.rogers@gmail.com&gt;
Co-developed-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf python: Avoid shadowing exception name in PostgreSQL exporter</title>
<updated>2026-09-30T18:34:16+00:00</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2026-09-30T13:11:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ccccf88a19322349612d631503af64592e263754'/>
<id>ccccf88a19322349612d631503af64592e263754</id>
<content type='text'>
During the perf build, pylint reports:

  ************* Module export-to-postgresql
  python/export-to-postgresql.py:319:8: W0621: Redefining name 'e' from outer scope (line 100) (redefined-outer-name)

Rename 'e' to 'db_error' to clear the warning.

Fixes: b1f968c9656a8a87 ("perf python: Port export-to-postgresql to perf module")
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Assisted-by: Codex:gpt-6
Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During the perf build, pylint reports:

  ************* Module export-to-postgresql
  python/export-to-postgresql.py:319:8: W0621: Redefining name 'e' from outer scope (line 100) (redefined-outer-name)

Rename 'e' to 'db_error' to clear the warning.

Fixes: b1f968c9656a8a87 ("perf python: Port export-to-postgresql to perf module")
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Assisted-by: Codex:gpt-6
Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf python event_analyzing_sample: Default to in-memory SQLite database</title>
<updated>2026-09-29T18:53:09+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2026-09-29T06:58:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4b34e3ad4cbb91ff5d6f99bb9c7dd85694c15bec'/>
<id>4b34e3ad4cbb91ff5d6f99bb9c7dd85694c15bec</id>
<content type='text'>
When -d/--db is not specified, event_analyzing_sample.py created a
temporary file in /tmp via tempfile.mkstemp() and deleted it in
trace_end(). As noted during review, creating the database in a shared
/tmp directory does not reserve SQLite's auxiliary sidecar filenames
(-journal or -wal), and a temporary on-disk file is unnecessary when the
caller did not ask to persist the database.

Default to sqlite3.connect(":memory:") when db_path is not provided,
removing the temporary file creation and cleanup logic, and test both
the default in-memory mode and explicit -d file mode in
test_event_analyzing_sample_python.sh.

Fixes: eeb70645a8097437 ("perf python: Port event_analyzing_sample to perf module")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When -d/--db is not specified, event_analyzing_sample.py created a
temporary file in /tmp via tempfile.mkstemp() and deleted it in
trace_end(). As noted during review, creating the database in a shared
/tmp directory does not reserve SQLite's auxiliary sidecar filenames
(-journal or -wal), and a temporary on-disk file is unnecessary when the
caller did not ask to persist the database.

Default to sqlite3.connect(":memory:") when db_path is not provided,
removing the temporary file creation and cleanup logic, and test both
the default in-memory mode and explicit -d file mode in
test_event_analyzing_sample_python.sh.

Fixes: eeb70645a8097437 ("perf python: Port event_analyzing_sample to perf module")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf python stat-cpi: Fix live mode signal races and test flakiness</title>
<updated>2026-09-29T18:51:23+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2026-09-29T06:58:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2fc36cce77d8d94e4a17bc41ac9438bdb64ceb89'/>
<id>2fc36cce77d8d94e4a17bc41ac9438bdb64ceb89</id>
<content type='text'>
In test_stat_cpi_python.sh, 'perf test -w noploop &amp;' defaults to a
1-second duration and can exit under heavy parallel load before
'perf stat -p' and 'perf script stat-cpi' finish starting up. In
addition, the fixed 'sleep 0.5' before sending SIGINT can fire before
Python finishes importing the perf module, opening the live evlist, and
flushing the first interval.

In stat-cpi.py, register SIGINT and SIGTERM handlers before calling
_open_live_evlist() and pass flush=True when printing live output so
redirected stdout is flushed immediately after each interval.

In test_stat_cpi_python.sh, run 'perf test -w noploop 60 &amp;' so the
target workload stays alive until killed, and poll the output file for
'cpi' (up to 5 seconds) before sending SIGINT.

Fixes: 4425182d426b ("perf python: Port stat-cpi to perf module")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In test_stat_cpi_python.sh, 'perf test -w noploop &amp;' defaults to a
1-second duration and can exit under heavy parallel load before
'perf stat -p' and 'perf script stat-cpi' finish starting up. In
addition, the fixed 'sleep 0.5' before sending SIGINT can fire before
Python finishes importing the perf module, opening the live evlist, and
flushing the first interval.

In stat-cpi.py, register SIGINT and SIGTERM handlers before calling
_open_live_evlist() and pass flush=True when printing live output so
redirected stdout is flushed immediately after each interval.

In test_stat_cpi_python.sh, run 'perf test -w noploop 60 &amp;' so the
target workload stays alive until killed, and poll the output file for
'cpi' (up to 5 seconds) before sending SIGINT.

Fixes: 4425182d426b ("perf python: Port stat-cpi to perf module")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf python sctop: Fix offline interval printing and test flakiness</title>
<updated>2026-09-29T18:51:06+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2026-09-29T06:58:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ac6e4e290bd8a0ae9c12c148b62f2be4b5d7a422'/>
<id>ac6e4e290bd8a0ae9c12c148b62f2be4b5d7a422</id>
<content type='text'>
In sctop.py:
- If an earlier interval elapsed and printed an empty table before the
  target comm ('sleep') executed any syscalls, analyzer.printed became
  True and the final partial interval containing the target comm's
  syscalls was never flushed at EOF. Flush print_current_totals() in
  finally when analyzer.syscalls is non-empty as well as when nothing
  has been printed yet.
- Initialize analyzer.e_machine after creating perf.session rather than
  when session is still None.

In test_sctop_python.sh:
- Use a private temporary directory via 'mktemp -d'.
- Drop '-a' and pass '-B -N --no-bpf-event' to 'perf record', and sleep
  briefly in the subshell ('sh -c "sleep 0.1; sleep 0.05"') with a
  bounded retry loop so 'sleep's PERF_RECORD_COMM and sys_enter events
  are reliably captured under heavy load.

Fixes: b83f0bacf5e4f936 ("perf python: Port sctop to perf module")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In sctop.py:
- If an earlier interval elapsed and printed an empty table before the
  target comm ('sleep') executed any syscalls, analyzer.printed became
  True and the final partial interval containing the target comm's
  syscalls was never flushed at EOF. Flush print_current_totals() in
  finally when analyzer.syscalls is non-empty as well as when nothing
  has been printed yet.
- Initialize analyzer.e_machine after creating perf.session rather than
  when session is still None.

In test_sctop_python.sh:
- Use a private temporary directory via 'mktemp -d'.
- Drop '-a' and pass '-B -N --no-bpf-event' to 'perf record', and sleep
  briefly in the subshell ('sh -c "sleep 0.1; sleep 0.05"') with a
  bounded retry loop so 'sleep's PERF_RECORD_COMM and sys_enter events
  are reliably captured under heavy load.

Fixes: b83f0bacf5e4f936 ("perf python: Port sctop to perf module")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf python: Fix arm-cs-trace-disasm type error</title>
<updated>2026-09-28T16:30:01+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@linaro.org</email>
</author>
<published>2026-09-28T12:58:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=da39380560de588b5e16efc334f62ecc6dd9af40'/>
<id>da39380560de588b5e16efc334f62ecc6dd9af40</id>
<content type='text'>
The perf sample dso_bid getter returns a string or None, matching its
Optional[str] annotation. Attempting to decode it as bytes causes mypy
to report union-attr errors, even though this was behind a conditional
that checked for bytes type.

Use the string directly, retaining the fallback for an unknown build ID.

This fixes the following build error:

  python/arm-cs-trace-disasm.py:266: error: Item "None" of "str | None" has no attribute "decode"  [union-attr]

Fixes: 279b402e5143214c ("perf python: Port arm-cs-trace-disasm to perf module")
Reviewed-by: Leo Yan &lt;leo.yan@arm.com&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Assisted-by: Codex:GPT-6-Astra
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The perf sample dso_bid getter returns a string or None, matching its
Optional[str] annotation. Attempting to decode it as bytes causes mypy
to report union-attr errors, even though this was behind a conditional
that checked for bytes type.

Use the string directly, retaining the fallback for an unknown build ID.

This fixes the following build error:

  python/arm-cs-trace-disasm.py:266: error: Item "None" of "str | None" has no attribute "decode"  [union-attr]

Fixes: 279b402e5143214c ("perf python: Port arm-cs-trace-disasm to perf module")
Reviewed-by: Leo Yan &lt;leo.yan@arm.com&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Assisted-by: Codex:GPT-6-Astra
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf python: Move and clean up parallel-perf.py</title>
<updated>2026-09-26T18:49:31+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2026-09-26T06:20:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5084b5f91a70e0aa2811c7c894ac19424bfc4194'/>
<id>5084b5f91a70e0aa2811c7c894ac19424bfc4194</id>
<content type='text'>
Move parallel-perf.py from tools/perf/scripts/python/ to
tools/perf/python/ as it is a standalone Python utility that invokes
'perf script' in parallel across time slices and CPUs. Update
tools/perf/tests/shell/script.sh accordingly.

Also fix bugs and clean up the script to pass mypy and pylint without
suppression comments:
- Fix Work.command() to return the shlex.quote()-escaped command string
  (previously sh_cmd was computed with shlex.quote() and discarded in
  favor of unquoted self.cmd).
- Close self.popen.stdout in the parent process after spawning the
  consumer subprocess in Work.start() when --pipe-to is used, ensuring
  the producer receives SIGPIPE if the consumer exits early and avoiding
  leaking the pipe file descriptor.
- Convert method and function names to snake_case, specify utf-8 file
  encodings, and add type annotations and docstrings.

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move parallel-perf.py from tools/perf/scripts/python/ to
tools/perf/python/ as it is a standalone Python utility that invokes
'perf script' in parallel across time slices and CPUs. Update
tools/perf/tests/shell/script.sh accordingly.

Also fix bugs and clean up the script to pass mypy and pylint without
suppression comments:
- Fix Work.command() to return the shlex.quote()-escaped command string
  (previously sh_cmd was computed with shlex.quote() and discarded in
  favor of unquoted self.cmd).
- Close self.popen.stdout in the parent process after spawning the
  consumer subprocess in Work.start() when --pipe-to is used, ensuring
  the producer receives SIGPIPE if the consumer exits early and avoiding
  leaking the pipe file descriptor.
- Convert method and function names to snake_case, specify utf-8 file
  encodings, and add type annotations and docstrings.

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
