All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: laurent@vivier.eu, qemu-devel@nongnu.org
Subject: [PATCH v2 07/12] mos6522: add register names to register read/write trace events
Date: Thu, 24 Feb 2022 11:59:51 +0000	[thread overview]
Message-ID: <20220224115956.29997-8-mark.cave-ayland@ilande.co.uk> (raw)
In-Reply-To: <20220224115956.29997-1-mark.cave-ayland@ilande.co.uk>

This helps to follow how the guest is programming the mos6522 when debugging.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/misc/mos6522.c    | 10 ++++++++--
 hw/misc/trace-events |  4 ++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c
index 093cc83dcf..aaae195d63 100644
--- a/hw/misc/mos6522.c
+++ b/hw/misc/mos6522.c
@@ -36,6 +36,12 @@
 #include "qemu/module.h"
 #include "trace.h"
 
+
+static const char *mos6522_reg_names[16] = {
+    "ORB", "ORA", "DDRB", "DDRA", "T1CL", "T1CH", "T1LL", "T1LH",
+    "T2CL", "T2CH", "SR", "ACR", "PCR", "IFR", "IER", "ANH"
+};
+
 /* XXX: implement all timer modes */
 
 static void mos6522_timer1_update(MOS6522State *s, MOS6522Timer *ti,
@@ -310,7 +316,7 @@ uint64_t mos6522_read(void *opaque, hwaddr addr, unsigned size)
     }
 
     if (addr != VIA_REG_IFR || val != 0) {
-        trace_mos6522_read(addr, val);
+        trace_mos6522_read(addr, mos6522_reg_names[addr], val);
     }
 
     return val;
@@ -321,7 +327,7 @@ void mos6522_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
     MOS6522State *s = opaque;
     MOS6522DeviceClass *mdc = MOS6522_GET_CLASS(s);
 
-    trace_mos6522_write(addr, val);
+    trace_mos6522_write(addr, mos6522_reg_names[addr], val);
 
     switch (addr) {
     case VIA_REG_B:
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
index 1c373dd0a4..c1ea57de31 100644
--- a/hw/misc/trace-events
+++ b/hw/misc/trace-events
@@ -95,8 +95,8 @@ imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" PRIx64 "value 0x%08
 mos6522_set_counter(int index, unsigned int val) "T%d.counter=%d"
 mos6522_get_next_irq_time(uint16_t latch, int64_t d, int64_t delta) "latch=%d counter=0x%"PRId64 " delta_next=0x%"PRId64
 mos6522_set_sr_int(void) "set sr_int"
-mos6522_write(uint64_t addr, uint64_t val) "reg=0x%"PRIx64 " val=0x%"PRIx64
-mos6522_read(uint64_t addr, unsigned val) "reg=0x%"PRIx64 " val=0x%x"
+mos6522_write(uint64_t addr, const char *name, uint64_t val) "reg=0x%"PRIx64 " [%s] val=0x%"PRIx64
+mos6522_read(uint64_t addr, const char *name, unsigned val) "reg=0x%"PRIx64 " [%s] val=0x%x"
 
 # npcm7xx_clk.c
 npcm7xx_clk_read(uint64_t offset, uint32_t value) " offset: 0x%04" PRIx64 " value: 0x%08" PRIx32
-- 
2.20.1



  parent reply	other threads:[~2022-02-24 12:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 11:59 [PATCH v2 00/12] mos6522: switch to gpios, add control line edge-triggering and extra debugging Mark Cave-Ayland
2022-02-24 11:59 ` [PATCH v2 01/12] mos6522: add defines for IFR bit flags Mark Cave-Ayland
2022-02-24 13:57   ` Philippe Mathieu-Daudé
2022-03-03 17:38   ` Laurent Vivier
2022-02-24 11:59 ` [PATCH v2 02/12] mac_via: use IFR bit flag constants for VIA1 IRQs Mark Cave-Ayland
2022-03-03 17:39   ` Laurent Vivier
2022-02-24 11:59 ` [PATCH v2 03/12] mac_via: use IFR bit flag constants for VIA2 IRQs Mark Cave-Ayland
2022-02-24 13:57   ` Philippe Mathieu-Daudé
2022-03-03 17:40   ` Laurent Vivier
2022-02-24 11:59 ` [PATCH v2 04/12] mos6522: switch over to use qdev gpios for IRQs Mark Cave-Ayland
2022-03-03 17:47   ` Laurent Vivier
2022-02-24 11:59 ` [PATCH v2 05/12] mos6522: remove update_irq() and set_sr_int() methods from MOS6522DeviceClass Mark Cave-Ayland
2022-03-03 17:47   ` Laurent Vivier
2022-02-24 11:59 ` [PATCH v2 06/12] mos6522: use device_class_set_parent_reset() to propagate reset to parent Mark Cave-Ayland
2022-03-03 19:52   ` Laurent Vivier
2022-02-24 11:59 ` Mark Cave-Ayland [this message]
2022-02-24 14:04   ` [PATCH v2 07/12] mos6522: add register names to register read/write trace events Philippe Mathieu-Daudé
2022-03-05 14:17     ` Mark Cave-Ayland
2022-03-05 14:32       ` Philippe Mathieu-Daudé
2022-03-03 19:54   ` Laurent Vivier
2022-02-24 11:59 ` [PATCH v2 08/12] mos6522: add "info via" HMP command for debugging Mark Cave-Ayland
2022-03-03 19:55   ` Laurent Vivier
2022-02-24 11:59 ` [PATCH v2 09/12] mos6522: record last_irq_levels in mos6522_set_irq() Mark Cave-Ayland
2022-03-03 19:56   ` Laurent Vivier
2022-02-24 11:59 ` [PATCH v2 10/12] mac_via: make SCSI_DATA (DRQ) bit live rather than latched Mark Cave-Ayland
2022-02-24 14:00   ` Philippe Mathieu-Daudé
2022-03-03 19:57   ` Laurent Vivier
2022-02-24 11:59 ` [PATCH v2 11/12] mos6522: implement edge-triggering for CA1/2 and CB1/2 control line IRQs Mark Cave-Ayland
2022-03-03 20:01   ` Laurent Vivier
2022-02-24 11:59 ` [PATCH v2 12/12] macio/pmu.c: remove redundant code Mark Cave-Ayland
2022-03-03 20:02   ` Laurent Vivier

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=20220224115956.29997-8-mark.cave-ayland@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.