arm: add tracing events to sbsa_gwdt
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Ani Sinha <anisinha@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <20260702145856.1539572-3-imammedo@redhat.com>
Igor Mammedov committed
Jul 2, 2026 at 16:58 UTC
88e1d327fdb73e22479c97139fb237dabf6788ff
2 files changed
+17
hw/watchdog/sbsa_gwdt.c
+8
@@ -24,6 +24,7 @@
24
#include "migration/vmstate.h"
25
#include "qemu/log.h"
26
#include "qemu/module.h"
27
+#include "trace.h"
28
29
static const VMStateDescription vmstate_sbsa_gwdt = {
30
.name = "sbsa-gwdt",
@@ -62,6 +63,7 @@ static uint64_t sbsa_gwdt_rread(void *opaque, hwaddr addr, unsigned int size)
63
qemu_log_mask(LOG_GUEST_ERROR, "bad address in refresh frame read :"
64
" 0x%x\n", (int)addr);
65
}
66
+ trace_sbsa_gwdt_refresh_read(addr, ret);
67
return ret;
68
}
69
@@ -93,6 +95,7 @@ static uint64_t sbsa_gwdt_read(void *opaque, hwaddr addr, unsigned int size)
95
qemu_log_mask(LOG_GUEST_ERROR, "bad address in control frame read :"
96
" 0x%x\n", (int)addr);
97
}
98
+ trace_sbsa_gwdt_control_read(addr, ret);
99
return ret;
100
}
101
@@ -127,6 +130,7 @@ static void sbsa_gwdt_rwrite(void *opaque, hwaddr offset, uint64_t data,
130
unsigned size) {
131
SBSA_GWDTState *s = SBSA_GWDT(opaque);
132
133
+ trace_sbsa_gwdt_refresh_write(offset, data);
134
if (offset == SBSA_GWDT_WRR) {
135
s->wcs &= ~(SBSA_GWDT_WCS_WS0 | SBSA_GWDT_WCS_WS1);
136
@@ -141,6 +145,7 @@ static void sbsa_gwdt_write(void *opaque, hwaddr offset, uint64_t data,
145
unsigned size) {
146
SBSA_GWDTState *s = SBSA_GWDT(opaque);
147
148
+ trace_sbsa_gwdt_control_write(offset, data);
149
switch (offset) {
150
case SBSA_GWDT_WCS:
151
s->wcs = data & SBSA_GWDT_WCS_EN;
@@ -180,6 +185,7 @@ static void wdt_sbsa_gwdt_reset(DeviceState *dev)
185
{
186
SBSA_GWDTState *s = SBSA_GWDT(dev);
187
188
+ trace_sbsa_gwdt_reset();
189
timer_del(s->timer);
190
191
s->wcs = 0;
@@ -196,10 +202,12 @@ static void sbsa_gwdt_timer_sysinterrupt(void *opaque)
202
203
if (!(s->wcs & SBSA_GWDT_WCS_WS0)) {
204
s->wcs |= SBSA_GWDT_WCS_WS0;
205
+ trace_sbsa_gwdt_ws0_asserted();
206
sbsa_gwdt_update_timer(s, TIMEOUT_REFRESH);
207
qemu_set_irq(s->irq, 1);
208
} else {
209
s->wcs |= SBSA_GWDT_WCS_WS1;
210
+ trace_sbsa_gwdt_ws1_asserted();
211
qemu_log_mask(CPU_LOG_RESET, "Watchdog timer expired.\n");
212
/*
213
* Reset the watchdog only if the guest gets notified about
hw/watchdog/trace-events
+9
@@ -42,3 +42,12 @@ k230_wdt_interrupt(void) "K230 WDT interrupt"
42
k230_wdt_reset(void) "K230 WDT system reset"
43
k230_wdt_restart(void) "K230 WDT restart"
44
k230_wdt_reset_device(void) "K230 WDT device reset"
45
+
46
+#sbsa_gwdt.c
47
+sbsa_gwdt_refresh_read(uint64_t addr, uint32_t value) "[0x%" PRIx64 "] -> 0x%" PRIx32
48
+sbsa_gwdt_refresh_write(uint64_t addr, uint64_t value) "[0x%" PRIx64 "] <- 0x%" PRIx64
49
+sbsa_gwdt_control_read(uint64_t addr, uint32_t value) "[0x%" PRIx64 "] -> 0x%" PRIx32
50
+sbsa_gwdt_control_write(uint64_t addr, uint64_t value) "[0x%" PRIx64 "] <- 0x%" PRIx64
51
+sbsa_gwdt_ws0_asserted(void) "WS0 signal is asserted"
52
+sbsa_gwdt_ws1_asserted(void) "WS1 signal is asserted"
53
+sbsa_gwdt_reset(void) "reset watchdog to default state"