<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-rng/tools/perf/python/export-to-postgresql.py, branch master</title>
<subtitle>Development tree for the kernel CSPRNG</subtitle>
<id>https://git.zx2c4.com/linux-rng/atom/tools/perf/python/export-to-postgresql.py?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-rng/atom/tools/perf/python/export-to-postgresql.py?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/'/>
<updated>2026-09-30T18:34:16Z</updated>
<entry>
<title>perf python: Avoid shadowing exception name in PostgreSQL exporter</title>
<updated>2026-09-30T18:34:16Z</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2026-09-30T13:11:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=ccccf88a19322349612d631503af64592e263754'/>
<id>urn:sha1: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>
</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>
