<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-rng/tools/perf/tests/shell/test_export_to_postgresql_python.sh, branch master</title>
<subtitle>Development tree for the kernel CSPRNG</subtitle>
<id>https://git.zx2c4.com/linux-rng/atom/tools/perf/tests/shell/test_export_to_postgresql_python.sh?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-rng/atom/tools/perf/tests/shell/test_export_to_postgresql_python.sh?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/'/>
<updated>2026-09-29T18:51:44Z</updated>
<entry>
<title>perf test: Deflake Intel PT Python shell tests under load</title>
<updated>2026-09-29T18:51:44Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2026-09-29T06:58:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=acdfc9b2fe2d83684ae66a87b5c78412d52d5d4c'/>
<id>urn:sha1:acdfc9b2fe2d83684ae66a87b5c78412d52d5d4c</id>
<content type='text'>
In test_intel_pt_events_python.sh, test_export_to_sqlite_python.sh, and
test_export_to_postgresql_python.sh, 'sh -c "uname; true"' uses the
shell builtin 'true' and exits within microseconds of 'uname', sending
SIGCHLD to 'perf record' before the Intel PT AUX buffer is always
flushed under heavy parallel load (~5-10% drop rate).

Sleep 0.05s in the subshell after 'uname' ('sh -c "uname; sleep 0.05"')
so 'uname' completely exits and flushes its AUX trace before 'sh' exits,
and wrap the record and verification step in a bounded retry loop (up to
5 attempts). Also pass '-B -N --no-bpf-event' to 'perf record -g' in
test_export_to_sqlite_python.sh and test_export_to_postgresql_python.sh
to avoid build-id cache and BPF synthesis overhead.

Fixes: d4ce72e9e238fd70 ("perf python: Port intel-pt-events and libxed to perf module")
Fixes: 62d350135e676a11 ("perf python: Port export-to-sqlite to perf module")
Fixes: b1f968c9656a8a87 ("perf python: Port export-to-postgresql 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>
</entry>
<entry>
<title>perf script: Support standalone scripts and remove embedded scripting</title>
<updated>2026-09-26T19:16:03Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2026-09-26T06:20:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=b02aa1d1343f580e5a43789b392e0c813bc1cba9'/>
<id>urn:sha1:b02aa1d1343f580e5a43789b392e0c813bc1cba9</id>
<content type='text'>
Refactor 'perf script' to launch standalone scripts directly via fork()
and execvp() and remove the legacy embedded Perl and Python scripting
engines:
- Remove the embedded Perl scripting engine
  (util/scripting-engines/trace-event-perl.c), Perl scripts, bin
  wrappers, and Trace-Util library
  (scripts/perl/Perf-Trace-Util/), and script_perl.sh test.
- Remove libperl feature checks from Makefile.config, Makefile.perf,
  builtin-check.c, and Documentation/perf-check.txt.
- Remove -g / --gen-script option and scripting_ops dispatch table from
  builtin-script.c and trace-event-scripting.c.
- Hide the legacy -s / --script option and update script discovery in
  find_script() and list_available_scripts() to prioritize the system
  'python' directory over bare filenames in the current directory.
- Update the Python script shell tests (test_arm_coresight_disasm.sh,
  test_task_analyzer.sh, and test_*_python.sh) to invoke scripts via
  'perf script &lt;script&gt;' rather than running the Python interpreter
  directly on the script file path.

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>
</entry>
<entry>
<title>perf python: Port export-to-postgresql to perf module</title>
<updated>2026-09-26T18:49:31Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2026-09-26T06:20:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=b1f968c9656a8a874f566340ae501f888e700ad0'/>
<id>urn:sha1:b1f968c9656a8a874f566340ae501f888e700ad0</id>
<content type='text'>
Port export-to-postgresql.py to a standalone script in
tools/perf/python/ using the perf module and libpq via ctypes.

Improvements compared to the legacy script:
- Remove the dependency on PySide/QtSql for database creation and DDL
  execution by driving libpq directly via ctypes (PQconnectdb, PQexec,
  PQputCopyData, PQputCopyEnd) and streaming binary PostgreSQL COPY
  files in PostgresExporter, enabling export on headless servers without
  Qt installed.
- Harden database connection and SQL identifier handling by rejecting
  URI ('://') and connection-parameter ('=') injection strings in
  setup_db() and connect(), escaping single quotes and backslashes in
  connection strings, and quoting SQL identifiers (quote_ident).
- Support Intel PT and instruction trace export via
  perf.session(itrace=...) and perf.call_return callbacks, reconstructing
  relational call_paths and calls tables (including id=0 placeholder
  rows and callfk/returnfk foreign keys) and unpacking synthesized PT
  payloads (ptwrite, cbr, mwait, pwre, exstop, pwrx).
- Use a dedicated context_switch ID counter so context-switch exports
  do not advance sample database IDs out of sync with call_return
  references.

Update Documentation/db-export.txt and add a shell test
(test_export_to_postgresql_python.sh) to verify the standalone exporter.

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>
</entry>
</feed>
