Skip to content

RFC tcg: add tcg_gen_print helper

Chao Liu qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tcg: add tcg_gen_print helperaccel/tcg/tcg-runtime.c accel/tcg/tcg-runtime.h include/tcg/tcg-op-common.h +2 more+324 -00 replies
2/3scripts: warn on tcg_gen_print usage to the checkpatch.plscripts/checkpatch.pl+5 -00 replies
3/3docs: add documentation for the tcg_gen_print helper to tcg-opsdocs/devel/tcg-ops.rst+33 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH v1 0/3] tcg: add tcg_gen_print helper

Hi,

This series adds a printf-style helper for TCG to simplify debugging TB translations.

The first patch implements tcg_gen_print plus the runtime support code that formats the arguments when the helper is invoked.

The second patch updates scripts/checkpatch.pl to warn if a patch still contains tcg_gen_print() so that developers do not accidentally merge debug prints.

The final patch documents the helper in docs/devel/tcg-ops.rst.

Usage:

```
    tcg_gen_print("const value = 0x%lx\n"
                  TCG_PRINT_ARG_I64, tcg_constant_i64(0xdead),
                  TCG_PRINT_ARG_END);
```

P.S. I think this debugging feature will be well-received. :)

Finally, happy new year to all ~

Thank,
Chao

Chao Liu (3):
tcg: add tcg_gen_print helper
scripts: warn on tcg_gen_print usage to the checkpatch.pl
docs: add documentation for the tcg_gen_print helper to tcg-ops

 accel/tcg/tcg-runtime.c     | 187 ++++++++++++++++++++++++++++++++++++
 accel/tcg/tcg-runtime.h     |   1 +
 docs/devel/tcg-ops.rst      |  33 +++++++
 include/tcg/tcg-op-common.h |   2 +
 include/tcg/tcg-print.h     |  45 +++++++++
 scripts/checkpatch.pl       |   5 +
 tcg/tcg-op.c                |  89 +++++++++++++++++
 7 files changed, 362 insertions(+)
 create mode 100644 include/tcg/tcg-print.h

--
2.52.0