qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 35/41] hw/arm/omap1: Convert information printfs to tracepoints
Date: Wed,  5 Mar 2025 02:21:50 +0100	[thread overview]
Message-ID: <20250305012157.96463-36-philmd@linaro.org> (raw)
In-Reply-To: <20250305012157.96463-1-philmd@linaro.org>

From: Peter Maydell <peter.maydell@linaro.org>

The omap1 code uses raw printf() statements to print information
about some events; convert these to tracepoints.

In particular, this will stop the functional test for the sx1
from printing the not-very-helpful note
 "omap_clkm_write: clocking scheme set to synchronous scalable"
to the test's default.log.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250227170117.1726895-4-peter.maydell@linaro.org>
[PMD: Include component name (pwl/pwt/lpg) in trace events]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/omap1.c      | 26 ++++++++++++++------------
 hw/arm/trace-events |  7 +++++++
 2 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index 8f5bb81c96a..3ee10b47770 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -42,6 +42,7 @@
 #include "qemu/cutils.h"
 #include "qemu/bcd.h"
 #include "target/arm/cpu-qom.h"
+#include "trace.h"
 
 static inline void omap_log_badwidth(const char *funcname, hwaddr addr, int sz)
 {
@@ -1731,7 +1732,7 @@ static void omap_clkm_write(void *opaque, hwaddr addr,
     case 0x18:	/* ARM_SYSST */
         if ((s->clkm.clocking_scheme ^ (value >> 11)) & 7) {
             s->clkm.clocking_scheme = (value >> 11) & 7;
-            printf("%s: clocking scheme set to %s\n", __func__,
+            trace_omap1_pwl_clocking_scheme(
                    clkschemename[s->clkm.clocking_scheme]);
         }
         s->clkm.cold_start &= value & 0x3f;
@@ -2335,7 +2336,7 @@ static void omap_pwl_update(struct omap_pwl_s *s)
 
     if (output != s->output) {
         s->output = output;
-        printf("%s: Backlight now at %i/256\n", __func__, output);
+        trace_omap1_pwl_backlight(output);
     }
 }
 
@@ -2470,8 +2471,8 @@ static void omap_pwt_write(void *opaque, hwaddr addr,
         break;
     case 0x04:	/* VRC */
         if ((value ^ s->vrc) & 1) {
-            if (value & 1)
-                printf("%s: %iHz buzz on\n", __func__, (int)
+            if (value & 1) {
+                trace_omap1_pwt_buzz(
                                 /* 1.5 MHz from a 12-MHz or 13-MHz PWT_CLK */
                                 ((omap_clk_getrate(s->clk) >> 3) /
                                  /* Pre-multiplexer divider */
@@ -2487,8 +2488,9 @@ static void omap_pwt_write(void *opaque, hwaddr addr,
                                  /*  80/127 divider */
                                  ((value & (1 << 5)) ?  80 : 127) /
                                  (107 * 55 * 63 * 127)));
-            else
-                printf("%s: silence!\n", __func__);
+            } else {
+                trace_omap1_pwt_silence();
+            }
         }
         s->vrc = value & 0x7f;
         break;
@@ -3494,7 +3496,7 @@ static void omap_lpg_tick(void *opaque)
         timer_mod(s->tm, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + s->on);
 
     s->cycle = !s->cycle;
-    printf("%s: LED is %s\n", __func__, s->cycle ? "on" : "off");
+    trace_omap1_lpg_led(s->cycle ? "on" : "off");
 }
 
 static void omap_lpg_update(struct omap_lpg_s *s)
@@ -3514,11 +3516,11 @@ static void omap_lpg_update(struct omap_lpg_s *s)
     }
 
     timer_del(s->tm);
-    if (on == period && s->on < s->period)
-        printf("%s: LED is on\n", __func__);
-    else if (on == 0 && s->on)
-        printf("%s: LED is off\n", __func__);
-    else if (on && (on != s->on || period != s->period)) {
+    if (on == period && s->on < s->period) {
+        trace_omap1_lpg_led("on");
+    } else if (on == 0 && s->on) {
+        trace_omap1_lpg_led("off");
+    } else if (on && (on != s->on || period != s->period)) {
         s->cycle = 0;
         s->on = on;
         s->period = period;
diff --git a/hw/arm/trace-events b/hw/arm/trace-events
index 7790db780e0..f49cae1656e 100644
--- a/hw/arm/trace-events
+++ b/hw/arm/trace-events
@@ -1,5 +1,12 @@
 # See docs/devel/tracing.rst for syntax documentation.
 
+# omap1.c
+omap1_pwl_clocking_scheme(const char *scheme) "omap1 CLKM: clocking scheme set to %s"
+omap1_pwl_backlight(int output) "omap1 PWL: backlight now at %d/256"
+omap1_pwt_buzz(int freq) "omap1 PWT: %dHz buzz on"
+omap1_pwt_silence(void) "omap1 PWT: buzzer silenced"
+omap1_lpg_led(const char *onoff) "omap1 LPG: LED is %s"
+
 # virt-acpi-build.c
 virt_acpi_setup(void) "No fw cfg or ACPI disabled. Bailing out."
 
-- 
2.47.1



  parent reply	other threads:[~2025-03-05  1:29 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05  1:21 [PULL 00/41] Misc HW patches for 2025-03-05 Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 01/41] hw/intc: Remove TCG dependency on ARM_GICV3 Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 02/41] hw/misc/pvpanic: Add MMIO interface Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 03/41] hw: Add vmapple subdir Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 04/41] hw/vmapple/aes: Introduce aes engine Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 05/41] hw/vmapple/bdif: Introduce vmapple backdoor interface Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 06/41] hw/vmapple/cfg: Introduce vmapple cfg region Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 07/41] hw/vmapple/virtio-blk: Add support for apple virtio-blk Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 08/41] hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 09/41] hw/vmapple/vmapple: Add vmapple machine type Philippe Mathieu-Daudé
2025-03-10  1:22   ` Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 10/41] hw/ppc/spapr: Restrict part of PAGE_INIT hypercall to TCG Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 11/41] hw/acpi/ghes: Make ghes_record_cper_errors() static Philippe Mathieu-Daudé
2025-03-06 22:36   ` Mauro Carvalho Chehab
2025-03-07 12:41     ` Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 12/41] hw/arm: Do not expose the virt machine on Xen-only binary Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 13/41] hw/xen: Link XenPVH with GPEX PCIe bridge Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 14/41] hw/xen/xen-pvh: Reduce included headers Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 15/41] hw/xen/xen-hvm: " Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 16/41] hw/xen/xen-bus: " Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 17/41] hw/xen/xen-legacy-backend: Remove unused 'net/net.h' header Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 18/41] hw/net/fsl_etsec: Set eTSEC device description and category Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 19/41] hw/char/pl011: Warn when using disabled receiver Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 20/41] hw/char/pl011: Simplify a bit pl011_can_receive() Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 21/41] hw/char/pl011: Improve RX flow tracing events Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 22/41] hw/char/pl011: Really use RX FIFO depth Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 23/41] hw/char/bcm2835_aux: " Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 24/41] hw/char/imx_serial: " Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 25/41] hw/char/mcf_uart: Use FIFO_DEPTH definition instead of magic values Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 26/41] hw/char/mcf_uart: Really use RX FIFO depth Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 27/41] hw/char/sh_serial: Return correct number of empty RX FIFO elements Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 28/41] hw/char/sifive_uart: Free fifo on unrealize Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 29/41] hw/misc/macio: Improve trace logs Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 30/41] hw/misc/macio/gpio: Add constants for register bits Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 31/41] hw/ufs: Add temperature event notification support Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 32/41] tests/qtest/ufs-test: Add test code for the temperature feature Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 33/41] hw/arm/omap1: Convert raw printfs to qemu_log_mask() Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 34/41] hw/arm/omap1: Drop ALMDEBUG ifdeffed out code Philippe Mathieu-Daudé
2025-03-05  1:21 ` Philippe Mathieu-Daudé [this message]
2025-03-05  1:21 ` [PULL 36/41] hw/arm/omap_sx1: Remove ifdeffed out debug printf Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 37/41] hw/arm/versatilepb: Convert printfs to LOG_GUEST_ERROR Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 38/41] hw/nvram/eeprom_at24c: Use OBJECT_DECLARE_SIMPLE_TYPE Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 39/41] hw/nvram/eeprom_at24c: Remove ERR macro that calls fprintf to stderr Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 40/41] hw/nvram/eeprom_at24c: Remove memset after g_malloc0 Philippe Mathieu-Daudé
2025-03-05  1:21 ` [PULL 41/41] hw/nvram/eeprom_at24c: Reorganise init to avoid overwriting values Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250305012157.96463-36-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).