From: David Gibson <david@gibson.dropbear.id.au>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: qemu-trivial@nongnu.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/nvram/mac_nvram: Convert debug printf()s to trace events
Date: Mon, 25 May 2020 15:07:47 +1000 [thread overview]
Message-ID: <20200525050747.GD23110@umbus.fritz.box> (raw)
In-Reply-To: <20200524165126.13920-1-f4bug@amsat.org>
[-- Attachment #1: Type: text/plain, Size: 2859 bytes --]
On Sun, May 24, 2020 at 06:51:26PM +0200, Philippe Mathieu-Daudé wrote:
> Convert NVR_DPRINTF() to trace events and remove ifdef'ry.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Applied to ppc-for-5.1, thanks.
> ---
> hw/nvram/mac_nvram.c | 17 +++--------------
> hw/nvram/trace-events | 4 ++++
> 2 files changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/hw/nvram/mac_nvram.c b/hw/nvram/mac_nvram.c
> index ff5db03e6b..beec1c4e4d 100644
> --- a/hw/nvram/mac_nvram.c
> +++ b/hw/nvram/mac_nvram.c
> @@ -30,18 +30,9 @@
> #include "migration/vmstate.h"
> #include "qemu/cutils.h"
> #include "qemu/module.h"
> +#include "trace.h"
> #include <zlib.h>
>
> -/* debug NVR */
> -//#define DEBUG_NVR
> -
> -#ifdef DEBUG_NVR
> -#define NVR_DPRINTF(fmt, ...) \
> - do { printf("NVR: " fmt , ## __VA_ARGS__); } while (0)
> -#else
> -#define NVR_DPRINTF(fmt, ...)
> -#endif
> -
> #define DEF_SYSTEM_SIZE 0xc10
>
> /* macio style NVRAM device */
> @@ -51,9 +42,8 @@ static void macio_nvram_writeb(void *opaque, hwaddr addr,
> MacIONVRAMState *s = opaque;
>
> addr = (addr >> s->it_shift) & (s->size - 1);
> + trace_macio_nvram_write(addr, value);
> s->data[addr] = value;
> - NVR_DPRINTF("writeb addr %04" HWADDR_PRIx " val %" PRIx64 "\n",
> - addr, value);
> }
>
> static uint64_t macio_nvram_readb(void *opaque, hwaddr addr,
> @@ -64,8 +54,7 @@ static uint64_t macio_nvram_readb(void *opaque, hwaddr addr,
>
> addr = (addr >> s->it_shift) & (s->size - 1);
> value = s->data[addr];
> - NVR_DPRINTF("readb addr %04" HWADDR_PRIx " val %" PRIx32 "\n",
> - addr, value);
> + trace_macio_nvram_read(addr, value);
>
> return value;
> }
> diff --git a/hw/nvram/trace-events b/hw/nvram/trace-events
> index 0dea9260ce..e023193295 100644
> --- a/hw/nvram/trace-events
> +++ b/hw/nvram/trace-events
> @@ -13,3 +13,7 @@ fw_cfg_add_string(uint16_t key_value, const char *key_name, const char *value) "
> fw_cfg_add_i16(uint16_t key_value, const char *key_name, uint16_t value) "key 0x%04" PRIx16 " '%s', value 0x%" PRIx16
> fw_cfg_add_i32(uint16_t key_value, const char *key_name, uint32_t value) "key 0x%04" PRIx16 " '%s', value 0x%" PRIx32
> fw_cfg_add_i64(uint16_t key_value, const char *key_name, uint64_t value) "key 0x%04" PRIx16 " '%s', value 0x%" PRIx64
> +
> +# mac_nvram.c
> +macio_nvram_read(uint32_t addr, uint8_t val) "read addr=0x%04"PRIx32" val=0x%02x"
> +macio_nvram_write(uint32_t addr, uint8_t val) "write addr=0x%04"PRIx32" val=0x%02x"
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-05-25 5:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-24 16:51 [PATCH] hw/nvram/mac_nvram: Convert debug printf()s to trace events Philippe Mathieu-Daudé
2020-05-25 5:07 ` David Gibson [this message]
2020-05-25 9:16 ` Mark Cave-Ayland
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=20200525050747.GD23110@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=f4bug@amsat.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-trivial@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 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).