From: Alistair Francis <alistair23@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
QEMU Trivial <qemu-trivial@nongnu.org>,
Alistair Francis <alistair@alistair23.me>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
qemu-arm <qemu-arm@nongnu.org>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: Re: [PATCH 3/4] hw/display/dpcd: Convert debug printf()s to trace events
Date: Tue, 26 May 2020 09:39:30 -0700 [thread overview]
Message-ID: <CAKmqyKM=i6jp6y023ExLztqTeg6dc+O5Rv05_tYcCYi48E1-pA@mail.gmail.com> (raw)
In-Reply-To: <20200525034459.28535-4-f4bug@amsat.org>
On Sun, May 24, 2020 at 8:46 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Convert DPRINTF() to trace events and remove ifdef'ry.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> hw/display/dpcd.c | 16 +++-------------
> hw/display/trace-events | 4 ++++
> 2 files changed, 7 insertions(+), 13 deletions(-)
>
> diff --git a/hw/display/dpcd.c b/hw/display/dpcd.c
> index 0c1b7b35fb..64463654a1 100644
> --- a/hw/display/dpcd.c
> +++ b/hw/display/dpcd.c
> @@ -32,16 +32,7 @@
> #include "hw/misc/auxbus.h"
> #include "migration/vmstate.h"
> #include "hw/display/dpcd.h"
> -
> -#ifndef DEBUG_DPCD
> -#define DEBUG_DPCD 0
> -#endif
> -
> -#define DPRINTF(fmt, ...) do { \
> - if (DEBUG_DPCD) { \
> - qemu_log("dpcd: " fmt, ## __VA_ARGS__); \
> - } \
> -} while (0)
> +#include "trace.h"
>
> #define DPCD_READABLE_AREA 0x600
>
> @@ -70,8 +61,8 @@ static uint64_t dpcd_read(void *opaque, hwaddr offset, unsigned size)
> offset);
> ret = 0;
> }
> + trace_dpcd_read(offset, ret);
>
> - DPRINTF("read 0x%" PRIX8 " @0x%" HWADDR_PRIX "\n", ret, offset);
> return ret;
> }
>
> @@ -80,8 +71,7 @@ static void dpcd_write(void *opaque, hwaddr offset, uint64_t value,
> {
> DPCDState *e = DPCD(opaque);
>
> - DPRINTF("write 0x%" PRIX8 " @0x%" HWADDR_PRIX "\n", (uint8_t)value, offset);
> -
> + trace_dpcd_write(offset, value);
> if (offset < DPCD_READABLE_AREA) {
> e->dpcd_info[offset] = value;
> } else {
> diff --git a/hw/display/trace-events b/hw/display/trace-events
> index e6e22bef88..00543f1601 100644
> --- a/hw/display/trace-events
> +++ b/hw/display/trace-events
> @@ -151,3 +151,7 @@ artist_vram_write(unsigned int size, uint64_t addr, uint64_t val) "%u 0x%"PRIx64
> artist_fill_window(unsigned int start_x, unsigned int start_y, unsigned int width, unsigned int height, uint32_t op, uint32_t ctlpln) "start=%ux%u length=%ux%u op=0x%08x ctlpln=0x%08x"
> artist_block_move(unsigned int start_x, unsigned int start_y, unsigned int dest_x, unsigned int dest_y, unsigned int width, unsigned int height) "source %ux%u -> dest %ux%u size %ux%u"
> artist_draw_line(unsigned int start_x, unsigned int start_y, unsigned int end_x, unsigned int end_y) "%ux%u %ux%u"
> +
> +# dpcd.c
> +dpcd_read(uint32_t addr, uint8_t val) "read addr:0x%"PRIx32" val:0x%02x"
> +dpcd_write(uint32_t addr, uint8_t val) "write addr:0x%"PRIx32" val:0x%02x"
> --
> 2.21.3
>
>
next prev parent reply other threads:[~2020-05-26 16:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-25 3:44 [PATCH 0/4] hw/display/xlnx_dp: Fix memory region size, improve logging Philippe Mathieu-Daudé
2020-05-25 3:44 ` [PATCH 1/4] hw/misc/auxbus: Use qemu_log_mask(UNIMP) instead of debug printf Philippe Mathieu-Daudé
2020-05-26 16:17 ` Alistair Francis
2020-05-25 3:44 ` [PATCH 2/4] hw/display/dpcd: Fix memory region size Philippe Mathieu-Daudé
2020-05-26 16:38 ` Alistair Francis
2020-05-25 3:44 ` [PATCH 3/4] hw/display/dpcd: Convert debug printf()s to trace events Philippe Mathieu-Daudé
2020-05-26 16:39 ` Alistair Francis [this message]
2020-05-25 3:44 ` [PATCH 4/4] hw/display/xlnx_dp: Replace disabled DPRINTF() by error_report() Philippe Mathieu-Daudé
2020-05-26 16:40 ` Alistair Francis
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='CAKmqyKM=i6jp6y023ExLztqTeg6dc+O5Rv05_tYcCYi48E1-pA@mail.gmail.com' \
--to=alistair23@gmail.com \
--cc=alistair@alistair23.me \
--cc=edgar.iglesias@gmail.com \
--cc=f4bug@amsat.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@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).