Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: f5fb3637cb7ab86ba80516c56ebdb6973cafce08
      
https://github.com/qemu/qemu/commit/f5fb3637cb7ab86ba80516c56ebdb6973cafce08
  Author: Paolo Bonzini <[email protected]>
  Date:   2026-01-19 (Mon, 19 Jan 2026)

  Changed paths:
    M scripts/tracetool/__init__.py

  Log Message:
  -----------
  tracetool: rename variable with conflicting types

"backend" is used as both a string and a backend.Wrapper.  In preparation
for adding type annotations, use different names.

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: d877dd3e368874c2137c351973031f30164ec2e7
      
https://github.com/qemu/qemu/commit/d877dd3e368874c2137c351973031f30164ec2e7
  Author: Paolo Bonzini <[email protected]>
  Date:   2026-01-19 (Mon, 19 Jan 2026)

  Changed paths:
    A python/tests/tracetool-isort.sh
    M scripts/tracetool.py
    M scripts/tracetool/backend/dtrace.py
    M scripts/tracetool/backend/ftrace.py
    M scripts/tracetool/backend/log.py
    M scripts/tracetool/backend/simple.py
    M scripts/tracetool/backend/syslog.py
    M scripts/tracetool/backend/ust.py
    M scripts/tracetool/format/d.py
    M scripts/tracetool/format/log_stap.py
    M scripts/tracetool/format/stap.py

  Log Message:
  -----------
  tracetool: apply isort and add check

Sort imports automatically, to keep the coding style more uniform.

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 069f590ed16294c1850c91d703cb7f7101b3929f
      
https://github.com/qemu/qemu/commit/069f590ed16294c1850c91d703cb7f7101b3929f
  Author: Paolo Bonzini <[email protected]>
  Date:   2026-01-19 (Mon, 19 Jan 2026)

  Changed paths:
    M scripts/tracetool.py
    M scripts/tracetool/__init__.py
    M scripts/tracetool/backend/__init__.py
    M scripts/tracetool/backend/dtrace.py
    M scripts/tracetool/backend/ftrace.py
    M scripts/tracetool/backend/log.py
    M scripts/tracetool/backend/simple.py
    M scripts/tracetool/backend/syslog.py
    M scripts/tracetool/backend/ust.py
    M scripts/tracetool/format/__init__.py
    M scripts/tracetool/format/c.py
    M scripts/tracetool/format/d.py
    M scripts/tracetool/format/h.py
    M scripts/tracetool/format/log_stap.py
    M scripts/tracetool/format/rs.py
    M scripts/tracetool/format/simpletrace_stap.py
    M scripts/tracetool/format/stap.py
    M scripts/tracetool/format/ust_events_c.py
    M scripts/tracetool/format/ust_events_h.py

  Log Message:
  -----------
  tracetool: "import annotations"

In preparations for adding type annotations, make Python process them lazily.

This avoids the need to express some annotations as strings.

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 0a0206dee5f8bceac50cdd1184ac6386ec0042be
      
https://github.com/qemu/qemu/commit/0a0206dee5f8bceac50cdd1184ac6386ec0042be
  Author: Paolo Bonzini <[email protected]>
  Date:   2026-01-19 (Mon, 19 Jan 2026)

  Changed paths:
    M scripts/tracetool.py
    M scripts/tracetool/__init__.py
    M scripts/tracetool/backend/__init__.py
    M scripts/tracetool/backend/dtrace.py
    M scripts/tracetool/backend/ftrace.py
    M scripts/tracetool/backend/log.py
    M scripts/tracetool/backend/simple.py
    M scripts/tracetool/backend/syslog.py
    M scripts/tracetool/backend/ust.py
    M scripts/tracetool/format/__init__.py
    M scripts/tracetool/format/c.py
    M scripts/tracetool/format/d.py
    M scripts/tracetool/format/h.py
    M scripts/tracetool/format/log_stap.py
    M scripts/tracetool/format/rs.py
    M scripts/tracetool/format/simpletrace_stap.py
    M scripts/tracetool/format/stap.py
    M scripts/tracetool/format/ust_events_c.py
    M scripts/tracetool/format/ust_events_h.py

  Log Message:
  -----------
  tracetool: add type annotations

Created with a profiling-based tool, righttyper.  I used this script:

  python -m righttyper --generate-stubs --no-sampling --overwrite  -- 
./tracetool.py --help
  find . -name "*.pyi" | while read fname; do
    merge-pyi --in-place -b bak.$fmt ${fname%i} $fname
  done

  for fmt in c h rs d log-stap simpletrace-stap stap ust-events-c ust-events-h; 
do
    find . -name '*.pyi*' | xargs rm
    python -m righttyper --generate-stubs --no-sampling --overwrite 
./tracetool.py \
      --format=$fmt --backends=ust,simple,syslog,ftrace,dtrace,log 
--group=testsuite \
      --binary=qemu --probe-prefix=qemu ../tests/tracetool/trace-events 
outfile.$fmt
    find . -name "*.pyi" | while read fname; do
      merge-pyi --in-place -b bak.$fmt ${fname%i} $fname
    done
  done

  python -m isort $(find tracetool -name "*.py")

Running the script took about 5 minutes.  The errors were mostly
due to misunderstanding the "try_import" function:

  tracetool/backend/__init__.py:83: error: Incompatible types in assignment 
(expression has type Module, variable has type "tuple[bool, Module]")  
[assignment]
  tracetool/backend/__init__.py:117: error: Incompatible types in assignment 
(expression has type Module, variable has type "str")  [assignment]
  tracetool/__init__.py:543: error: Incompatible return value type (got 
"tuple[bool, None]", expected "tuple[bool, Module]")  [return-value]
  tracetool/format/__init__.py:60: error: Incompatible types in assignment 
(expression has type Module, variable has type "tuple[bool, Module]")  
[assignment]
  tracetool/format/__init__.py:85: error: Argument 2 to "try_import" has 
incompatible type "str"; expected "None"  [arg-type]
  tracetool/format/__init__.py:88: error: Module not callable  [operator]

On top of this I fixed a little weirdness, while leaving the unannotated
functions unchanged.  Being profiling-based, righttyper did not annotate
anything not covered by the check-tracetool testsuite:
- error cases
- PRIxxx macros

It also reported list[Never] for always-empty lists, which is incorrect.
Righttyper also has a few limitations: it does not annotate nested functions
(there were only four of them), or "*args" argument lists.  These are fixed
in the next patch.

Signed-off-by: Paolo Bonzini <[email protected]>
Acked-by: Stefan Hajnoczi <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: ebb7e1bef8c6e452975c692b01a5bd278abdea33
      
https://github.com/qemu/qemu/commit/ebb7e1bef8c6e452975c692b01a5bd278abdea33
  Author: Paolo Bonzini <[email protected]>
  Date:   2026-01-19 (Mon, 19 Jan 2026)

  Changed paths:
    M scripts/tracetool/__init__.py
    M scripts/tracetool/backend/__init__.py
    M scripts/tracetool/format/log_stap.py

  Log Message:
  -----------
  tracetool: complete typing annotations

Add more annotations so that "mypy --strict".  These have to be done
manually due to limitations of RightTyper.

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 9b0ec472c60369be109b4eb75c6ad0bb3f47c33f
      
https://github.com/qemu/qemu/commit/9b0ec472c60369be109b4eb75c6ad0bb3f47c33f
  Author: Paolo Bonzini <[email protected]>
  Date:   2026-01-19 (Mon, 19 Jan 2026)

  Changed paths:
    A python/tests/tracetool-mypy.sh

  Log Message:
  -----------
  tracetool: add typing checks to "make -C python check"

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 5263d940b5031cc6c720985a68a819f4cfcf8547
      
https://github.com/qemu/qemu/commit/5263d940b5031cc6c720985a68a819f4cfcf8547
  Author: Stefan Hajnoczi <[email protected]>
  Date:   2026-01-19 (Mon, 19 Jan 2026)

  Changed paths:
    M tests/tracetool/tracetool-test.py

  Log Message:
  -----------
  tracetool-test: add QEMU_TEST_KEEP_SCRATCH=1 support

It can be useful to preserve the temporary files generated by the test
for manual inspection or diffing against expected output.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 0527c4fdd28ae8b13ecc34f80b91e42ce42b917f
      
https://github.com/qemu/qemu/commit/0527c4fdd28ae8b13ecc34f80b91e42ce42b917f
  Author: Thomas Huth <[email protected]>
  Date:   2026-01-19 (Mon, 19 Jan 2026)

  Changed paths:
    M tests/tracetool/tracetool-test.py

  Log Message:
  -----------
  tests/tracetool: Honor the Python interpreter that "configure" detected

The tracetool tests currently fail if the host installation does not
have a "python3" binary (and you compiled QEMU by selecting a different
one during the "configure" step). This happens because tracetool-test.py
executes scripts/tracetool.py directly, so that this script is run via
its shebang line. To fix the issue, use the same Python interpreter to
run scripts/tracetool.py as we are using to run the tracetool-test.py
script.

Suggested-by: Paolo Bonzini <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 2386a53b4f6cb2f2923ec2059d9de880acdf5154
      
https://github.com/qemu/qemu/commit/2386a53b4f6cb2f2923ec2059d9de880acdf5154
  Author: Richard Henderson <[email protected]>
  Date:   2026-01-20 (Tue, 20 Jan 2026)

  Changed paths:
    A python/tests/tracetool-isort.sh
    A python/tests/tracetool-mypy.sh
    M scripts/tracetool.py
    M scripts/tracetool/__init__.py
    M scripts/tracetool/backend/__init__.py
    M scripts/tracetool/backend/dtrace.py
    M scripts/tracetool/backend/ftrace.py
    M scripts/tracetool/backend/log.py
    M scripts/tracetool/backend/simple.py
    M scripts/tracetool/backend/syslog.py
    M scripts/tracetool/backend/ust.py
    M scripts/tracetool/format/__init__.py
    M scripts/tracetool/format/c.py
    M scripts/tracetool/format/d.py
    M scripts/tracetool/format/h.py
    M scripts/tracetool/format/log_stap.py
    M scripts/tracetool/format/rs.py
    M scripts/tracetool/format/simpletrace_stap.py
    M scripts/tracetool/format/stap.py
    M scripts/tracetool/format/ust_events_c.py
    M scripts/tracetool/format/ust_events_h.py
    M tests/tracetool/tracetool-test.py

  Log Message:
  -----------
  Merge tag 'tracing-pull-request' of https://gitlab.com/stefanha/qemu into 
staging

Pull request

- Thomas Huth's Python interpreter fix
- Paolo Bonzini's tracetool cleanups
- Stefan Hajnoczi's tracetool test QEMU_TEST_KEEP_SCRATCH=1 support

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmlugCUACgkQnKSrs4Gr
# c8gmJAf6AlEaaXCQyjoT9IKWDHahB/sZRhQTDxZYCuYl2Ufi4HsI+VMPbCjyKac4
# HfD9ImV1MEE4AgD4pRIcagdVWlF1VCmRP8FyhNiYm0c3QUlzDlvxYmN38bxOwmyQ
# HA5E9SH7UkMUEZAaLxfskLWd5jEa4hx7R27oXjxyzlB830M288Ucz+GzNArewmq6
# wxdZMcAWLUOsN/q/DyoURCFaXfGZBJgJsGxZd/CIsslVgU0hrAK0Ayh1pcCVHMuk
# 6GpeMUAdCT3VNnHHB4YeS37R2lJaGkeDuoYGKN8loQPDJ3M7IjTfQrQWlAFMJuKB
# fo63TbyTbFc9dTmefrFrDjEhO4gU+Q==
# =a3tY
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 20 Jan 2026 06:04:05 AM AEDT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <[email protected]>" [unknown]
# gpg:                 aka "Stefan Hajnoczi <[email protected]>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'tracing-pull-request' of https://gitlab.com/stefanha/qemu:
  tests/tracetool: Honor the Python interpreter that "configure" detected
  tracetool-test: add QEMU_TEST_KEEP_SCRATCH=1 support
  tracetool: add typing checks to "make -C python check"
  tracetool: complete typing annotations
  tracetool: add type annotations
  tracetool: "import annotations"
  tracetool: apply isort and add check
  tracetool: rename variable with conflicting types

Signed-off-by: Richard Henderson <[email protected]>


Compare: https://github.com/qemu/qemu/compare/38879a667fbb...2386a53b4f6c

To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications

Reply via email to