mbox series

[0/5] hw/arm: Remove printf() calls

Message ID 20250227170117.1726895-1-peter.maydell@linaro.org (mailing list archive)
Headers show
Series hw/arm: Remove printf() calls | expand

Message

Peter Maydell Feb. 27, 2025, 5:01 p.m. UTC
I noticed while looking at the sx1 functional tests that
the omap1 device emulation code prints to stdout
"omap_clkm_write: clocking scheme set to synchronous scalable"
which the test dutifully captures to its default.log.

Printing this kind of debug or information message to stdout
is definitely not something we do any more; so seeing it
prompted me to clean this up for hw/arm:
 * printf()s for guest errors or unimplemented functionality
   should be qemu_log_mask()
 * printf()s for minor informational things should be
   tracepoints
 * printf() for debug that have been ifdeffed out forever
   could in theory be tracepoints, but I didn't feel it
   worth the effort of conversion in this case: I doubt that
   anybody will be trying to debug this code or that the
   specific handful of debug ifdefs would be what they'll want
   anyway. If anybody ever does need to do debug here, they can
   add the tracepoints that are actually useful to them.

thanks
-- PMM

Peter Maydell (5):
  hw/arm/omap1: Convert raw printfs to qemu_log_mask()
  hw/arm/omap1: Drop ALMDEBUG ifdeffed out code
  hw/arm/omap1: Convert information printfs to tracepoints
  hw/arm/omap_sx1.c: Remove ifdeffed out debug printf
  hw/arm/versatilepb: Convert printfs to LOG_GUEST_ERROR

 hw/arm/omap1.c       | 126 ++++++++++++++++---------------------------
 hw/arm/omap_sx1.c    |   4 --
 hw/arm/versatilepb.c |   7 ++-
 hw/arm/trace-events  |   7 +++
 4 files changed, 57 insertions(+), 87 deletions(-)

Comments

Richard Henderson Feb. 27, 2025, 5:49 p.m. UTC | #1
On 2/27/25 09:01, Peter Maydell wrote:
> Peter Maydell (5):
>    hw/arm/omap1: Convert raw printfs to qemu_log_mask()
>    hw/arm/omap1: Drop ALMDEBUG ifdeffed out code
>    hw/arm/omap1: Convert information printfs to tracepoints
>    hw/arm/omap_sx1.c: Remove ifdeffed out debug printf
>    hw/arm/versatilepb: Convert printfs to LOG_GUEST_ERROR

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~