From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Laurent Vivier <laurent@vivier.eu>,
"Michael S. Tsirkin" <mst@redhat.com>,
Eduardo Habkost <eduardo@habkost.net>,
Zhao Liu <zhao1.liu@intel.com>,
kvm@vger.kernel.org, Michael Tokarev <mjt@tls.msk.ru>,
Cameron Esfahani <dirty@apple.com>,
qemu-block@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
qemu-trivial@nongnu.org, Laurent Vivier <lvivier@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Roman Bolshakov <rbolshakov@ddn.com>,
Phil Dennis-Jordan <phil@philjordan.eu>,
John Snow <jsnow@redhat.com>, Fabiano Rosas <farosas@suse.de>,
Gerd Hoffmann <kraxel@redhat.com>,
Sunil Muthuswamy <sunilmut@microsoft.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH v3 03/10] hw/rtc/mc146818rtc: Convert CMOS_DPRINTF() into trace events
Date: Sun, 19 Oct 2025 23:02:56 +0200 [thread overview]
Message-ID: <20251019210303.104718-4-shentey@gmail.com> (raw)
In-Reply-To: <20251019210303.104718-1-shentey@gmail.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/rtc/mc146818rtc.c | 14 +++-----------
hw/rtc/trace-events | 4 ++++
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index f9f5cf396f..61e9c0bf99 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -43,16 +43,10 @@
#include "qapi/error.h"
#include "qapi/qapi-events-misc.h"
#include "qapi/visitor.h"
+#include "trace.h"
-//#define DEBUG_CMOS
//#define DEBUG_COALESCED
-#ifdef DEBUG_CMOS
-# define CMOS_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
-#else
-# define CMOS_DPRINTF(format, ...) do { } while (0)
-#endif
-
#ifdef DEBUG_COALESCED
# define DPRINTF_C(format, ...) printf(format, ## __VA_ARGS__)
#else
@@ -439,8 +433,7 @@ static void cmos_ioport_write(void *opaque, hwaddr addr,
if ((addr & 1) == 0) {
s->cmos_index = data & 0x7f;
} else {
- CMOS_DPRINTF("cmos: write index=0x%02x val=0x%02" PRIx64 "\n",
- s->cmos_index, data);
+ trace_mc146818_rtc_ioport_write(s->cmos_index, data);
switch(s->cmos_index) {
case RTC_SECONDS_ALARM:
case RTC_MINUTES_ALARM:
@@ -726,8 +719,7 @@ static uint64_t cmos_ioport_read(void *opaque, hwaddr addr,
ret = s->cmos_data[s->cmos_index];
break;
}
- CMOS_DPRINTF("cmos: read index=0x%02x val=0x%02x\n",
- s->cmos_index, ret);
+ trace_mc146818_rtc_ioport_read(s->cmos_index, ret);
return ret;
}
}
diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events
index b9f2852d35..d2f36217cb 100644
--- a/hw/rtc/trace-events
+++ b/hw/rtc/trace-events
@@ -32,6 +32,10 @@ m48txx_nvram_io_write(uint64_t addr, uint64_t value) "io write addr:0x%04" PRIx6
m48txx_nvram_mem_read(uint32_t addr, uint32_t value) "mem read addr:0x%04x value:0x%02x"
m48txx_nvram_mem_write(uint32_t addr, uint32_t value) "mem write addr:0x%04x value:0x%02x"
+# mc146818rtc.c
+mc146818_rtc_ioport_read(uint8_t addr, uint8_t value) "[0x%02" PRIx8 "] -> 0x%02" PRIx8
+mc146818_rtc_ioport_write(uint8_t addr, uint8_t value) "[0x%02" PRIx8 "] <- 0x%02" PRIx8
+
# goldfish_rtc.c
goldfish_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
goldfish_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64
--
2.51.1.dirty
next prev parent reply other threads:[~2025-10-19 21:05 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-19 21:02 [PATCH v3 00/10] Cleanup patches, mostly PC-related Bernhard Beschow
2025-10-19 21:02 ` [PATCH v3 01/10] hw/timer/i8254: Add I/O trace events Bernhard Beschow
2025-10-20 8:31 ` Philippe Mathieu-Daudé
2025-10-19 21:02 ` [PATCH v3 02/10] hw/audio/pcspk: " Bernhard Beschow
2025-10-20 8:29 ` Philippe Mathieu-Daudé
2025-10-19 21:02 ` Bernhard Beschow [this message]
2025-10-20 8:34 ` [PATCH v3 03/10] hw/rtc/mc146818rtc: Convert CMOS_DPRINTF() into " Philippe Mathieu-Daudé
2025-10-19 21:02 ` [PATCH v3 04/10] hw/rtc/mc146818rtc: Use ARRAY_SIZE macro Bernhard Beschow
2025-10-20 6:06 ` Philippe Mathieu-Daudé
2025-10-19 21:02 ` [PATCH v3 05/10] hw/rtc/mc146818rtc: Assert correct usage of mc146818rtc_set_cmos_data() Bernhard Beschow
2025-10-21 15:53 ` Philippe Mathieu-Daudé
2025-10-19 21:02 ` [PATCH v3 06/10] hw/ide/ide-internal: Move dma_buf_commit() into ide "namespace" Bernhard Beschow
2025-10-20 6:08 ` Philippe Mathieu-Daudé
2025-10-19 21:03 ` [PATCH v3 07/10] hw/i386/apic: Prefer APICCommonState over DeviceState Bernhard Beschow
2025-10-21 15:57 ` Philippe Mathieu-Daudé
2025-10-19 21:03 ` [PATCH v3 08/10] hw/i386/apic: Ensure own APIC use in apic_msr_{read, write} Bernhard Beschow
2025-10-20 6:09 ` Philippe Mathieu-Daudé
2025-10-20 17:22 ` Bernhard Beschow
2025-10-19 21:03 ` [PATCH v3 09/10] hw/intc/apic: Pass APICCommonState to apic_register_{read, write} Bernhard Beschow
2025-10-21 16:01 ` Philippe Mathieu-Daudé
2025-10-21 20:31 ` Philippe Mathieu-Daudé
2025-10-19 21:03 ` [PATCH v3 10/10] tests/qtest/ds1338-test: Reuse from_bcd() Bernhard Beschow
2025-10-20 6:11 ` Philippe Mathieu-Daudé
2025-10-21 16:07 ` [PATCH v3 00/10] Cleanup patches, mostly PC-related Philippe Mathieu-Daudé
2025-10-21 20:32 ` 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=20251019210303.104718-4-shentey@gmail.com \
--to=shentey@gmail.com \
--cc=dirty@apple.com \
--cc=eduardo@habkost.net \
--cc=farosas@suse.de \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=laurent@vivier.eu \
--cc=lvivier@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mjt@tls.msk.ru \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=phil@philjordan.eu \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rbolshakov@ddn.com \
--cc=richard.henderson@linaro.org \
--cc=sunilmut@microsoft.com \
--cc=zhao1.liu@intel.com \
/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).