qemu-cr16/docs/devel
Daniel P. Berrangé da949d495d tracetool: add test suite for tracetool with reference output
When reviewing tracetool patches it is often very unclear what the
expected output will be for the generated backends. Compounding
this is that a default build will only enable the 'log' trace
backend, so developers won't see generated code for other backends
without making a special effort. Some backends are also platform
specific, so can't be enabled in QEMU builds, even though tracetool
could generate the code.

To address this, introduce a test suite for tracetool which is
conceptually similar to the qapi-schema test. It is a simple
python program that runs tracetool and compares the actual output
to historical reference output kept in git. The test directly
emits TAP format logs for ease of integration with meson.

This can be run with

  make check-tracetool

to make it easier for developers changing generated output, the
sample expected content can be auto-recreated

  QEMU_TEST_REGENERATE=1 make check-tracetool

and the changes reviewed and added to the commit. This will also
assist reviewers interpreting the change.

Developers are reminded of this in the test output on failure:

  $ make check-tracetool
  1/6 qemu:tracetool / dtrace        OK              0.14s
  2/6 qemu:tracetool / ftrace        FAIL            0.06s   exit status 1
  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
  1..2
  ok 1 - ftrace.c
  #
  not ok 1 - ftrace.h (set QEMU_TEST_REGENERATE=1 to recreate reference output if tracetool generator was intentionally changed)
  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

  3/6 qemu:tracetool / log           OK              0.06s
  4/6 qemu:tracetool / simple        OK              0.06s
  5/6 qemu:tracetool / syslog        OK              0.06s
  6/6 qemu:tracetool / ust           OK              0.11s

  Summary of Failures:

  2/6 qemu:tracetool / ftrace FAIL            0.06s   exit status 1

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20250916081638.764020-6-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-09-16 13:31:40 -04:00
..
migration vfio/migration: Max in-flight VFIO device state buffers size limit 2025-07-15 17:11:12 +02:00
testing tracetool: add test suite for tracetool with reference output 2025-09-16 13:31:40 -04:00
atomics.rst docs: use consistent markup for footnotes 2024-10-11 13:48:42 +02:00
bitops.rst docs: Create bitops.rst as example of kernel-docs 2019-12-17 19:36:57 +01:00
block-coroutine-wrapper.rst block-coroutine-wrapper.py: introduce co_wrapper 2022-12-15 16:07:43 +01:00
build-environment.rst docs/devel/build-environment: enhance MSYS2 instructions 2025-04-30 20:44:20 +02:00
build-system.rst docs: build-system: fix typo 2025-05-06 16:02:04 +02:00
clocks.rst hw/clock: Expose 'qtest-clock-period' QOM property for QTests 2024-10-15 11:29:45 +01:00
code-of-conduct.rst docs/devel: add a maintainers section to development process 2022-11-22 09:49:07 +00:00
code-provenance.rst docs: define policy forbidding use of AI code generators 2025-06-24 10:37:56 -04:00
codebase.rst docs: Don't define duplicate label in qemu-block-drivers.rst.inc 2025-05-06 15:02:34 +01:00
conflict-resolution.rst docs: Add a QEMU Code of Conduct and Conflict Resolution Policy document 2021-04-01 13:21:02 +02:00
control-flow-integrity.rst docs: add a glossary 2025-01-17 10:45:54 +00:00
crypto.rst docs/devel: Add introduction to LUKS volume with detached header 2024-07-24 10:39:10 +01:00
decodetree.rst docs/devel: add a codebase section 2025-01-17 10:45:49 +00:00
docs.rst docs: correct typos 2024-02-20 22:20:48 +03:00
ebpf_rss.rst docs/devel: add a codebase section 2025-01-17 10:45:49 +00:00
index-api.rst docs/devel/lockcnt: Convert to rST format 2024-10-15 15:16:17 +01:00
index-build.rst docs: add qapi-domain syntax documentation 2025-03-11 10:26:52 +01:00
index-internals.rst docs: add uefi variable service documentation 2025-03-04 12:07:05 +01:00
index-process.rst docs: introduce dedicated page about code provenance / sign-off 2025-06-24 10:37:56 -04:00
index-tcg.rst docs/devel: add some front matter to the devel index 2023-07-03 12:52:08 +01:00
index.rst docs/devel: add a codebase section 2025-01-17 10:45:49 +00:00
kconfig.rst vfio: Remove 'vfio-calxeda-xgmac' device 2025-09-08 16:46:31 +02:00
loads-stores.rst docs: use consistent markup for footnotes 2024-10-11 13:48:42 +02:00
lockcnt.rst docs/devel/lockcnt: Include kernel-doc API documentation 2024-10-15 15:16:17 +01:00
luks-detached-header.rst docs/devel: Add introduction to LUKS volume with detached header 2024-07-24 10:39:10 +01:00
maintainers.rst docs: use consistent markup for footnotes 2024-10-11 13:48:42 +02:00
memory.rst include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
modules.rst docs: Spell QEMU all caps 2021-11-19 10:16:58 +01:00
multi-process.rst docs: Don't mention "-mem-path" in multi-process.rst 2023-09-19 10:23:21 +02:00
multi-thread-tcg.rst tcg: Convert TARGET_SUPPORTS_MTTCG to TCGCPUOps::mttcg_supported field 2025-04-23 15:07:32 -07:00
multiple-iothreads.rst docs/devel/multiple-iothreads: Convert to rST format 2024-10-15 15:16:17 +01:00
pci.rst hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps 2023-11-03 09:20:31 +01:00
qapi-code-gen.rst docs/devel/qapi-code-gen: Update cross-reference syntax 2025-08-09 07:20:24 +02:00
qapi-domain.rst docs/devel/qapi-code-gen: Update cross-reference syntax 2025-08-09 07:20:24 +02:00
qdev-api.rst docs/devel: split qom-api reference into new file 2023-07-03 12:52:22 +01:00
qom-api.rst docs/devel: split qom-api reference into new file 2023-07-03 12:52:22 +01:00
qom.rst qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
rcu.rst docs/devel/rcu: Convert to rST format 2024-10-15 15:16:17 +01:00
replay.rst docs/devel: Mention post_load hook restrictions where we document the hook 2024-10-04 18:54:55 +03:00
reset.rst qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
rust.rst rust/qemu-api-macros: use syn::Error directly 2025-07-10 18:33:51 +02:00
s390-cpu-topology.rst docs/s390: Fix wrong command example in s390-cpu-topology.rst 2023-11-28 14:27:18 +01:00
s390-dasd-ipl.rst docs: rstfy s390 dasd ipl documentation 2020-02-26 18:57:07 +01:00
secure-coding-practices.rst docs/secure-coding-practices: Describe how to use 'null-co' block driver 2021-06-02 14:29:14 +02:00
stable-process.rst docs: Fix botched rST conversion of 'submitting-a-patch.rst' 2021-11-22 15:02:38 +01:00
style.rst docs/devel/style: Mention alloca() family API is forbidden 2025-09-02 17:57:01 +02:00
submitting-a-patch.rst docs/devel/submitting-a-patch.rst: add b4 section 2025-08-04 09:46:26 +01:00
submitting-a-pull-request.rst docs/devel: add a maintainers section to development process 2022-11-22 09:49:07 +00:00
tcg-icount.rst accel/tcg: Remove CF_LAST_IO 2023-11-14 10:40:54 -08:00
tcg-ops.rst tcg: Remove INDEX_op_qemu_st8_* 2025-04-28 13:40:17 -07:00
tcg-plugins.rst docs/devel: update tcg-plugins page 2024-08-16 14:13:07 +01:00
tcg.rst docs/devel: add some front matter to the devel index 2023-07-03 12:52:08 +01:00
tracing.rst docs/devel/tracing: Update trace.h creation rune to include SPDX 2025-07-13 12:08:07 +03:00
trivial-patches.rst docs: Fix botched rST conversion of 'submitting-a-patch.rst' 2021-11-22 15:02:38 +01:00
uefi-vars.rst docs: add uefi variable service documentation 2025-03-04 12:07:05 +01:00
ui.rst docs: Spell QEMU all caps 2021-11-19 10:16:58 +01:00
vfio-iommufd.rst docs/devel: Add VFIO iommufd backend documentation 2023-12-19 19:03:38 +01:00
virtio-backends.rst qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
writing-monitor-commands.rst docs/devel/writing-monitor-commands: Minor improvements 2024-03-04 07:12:40 +01:00
zoned-storage.rst docs/zoned-storage:add zoned emulation use case 2023-05-15 08:19:04 -04:00