From: Guenter Roeck <linux@roeck-us.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-arm <qemu-arm@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH 1/6] dma/pl330: Convert to support tracing
Date: Fri, 17 Jan 2020 08:46:25 -0800 [thread overview]
Message-ID: <20200117164625.GA27197@roeck-us.net> (raw)
In-Reply-To: <CAFEAcA_k8xdzmsgMK+m6wSgnBN53UjCNU4nTBx=hnHnHz+Su6g@mail.gmail.com>
On Fri, Jan 17, 2020 at 01:23:46PM +0000, Peter Maydell wrote:
> On Fri, 10 Jan 2020 at 20:39, Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > Replace debug logging code with tracing.
> >
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> > hw/dma/pl330.c | 88 +++++++++++++++++++++++----------------------
> > hw/dma/trace-events | 24 +++++++++++++
>
> > +static void pl330_hexdump(uint8_t *buf, size_t size)
> > +{
> > + unsigned int b, i, len;
> > + char tmpbuf[80];
> > +
> > + for (b = 0; b < size; b += 16) {
> > + len = size - b;
> > + if (len > 16) {
> > + len = 16;
> > + }
> > + tmpbuf[0] = '\0';
> > + for (i = 0; i < len; i++) {
> > + if ((i % 4) == 0) {
> > + strcat(tmpbuf, " ");
> > + }
> > + sprintf(tmpbuf + strlen(tmpbuf), " %02x", buf[b + i]);
> > + }
> > + trace_pl330_hexdump(b, tmpbuf);
> > + }
> > +}
> >
>
> > @@ -1175,11 +1186,8 @@ static int pl330_exec_cycle(PL330Chan *channel)
> > int len = q->len - (q->addr & (q->len - 1));
> >
> > dma_memory_read(&address_space_memory, q->addr, buf, len);
> > - if (PL330_ERR_DEBUG > 1) {
> > - DB_PRINT("PL330 read from memory @%08" PRIx32 " (size = %08x):\n",
> > - q->addr, len);
> > - qemu_hexdump((char *)buf, stderr, "", len);
> > - }
> > + trace_pl330_exec_cycle(q->addr, len);
> > + pl330_hexdump(buf, len);
>
> Won't this now do all the work of constructing the hexdump strings,
> even if tracing is disabled ?
>
That is correct. Can I check
if (trace_event_get_state(TRACE_PL330_HEXDUMP) &&
qemu_loglevel_mask(LOG_TRACE)) {
directly in pl330_hexdump(), or is there some other means to handle
this kind of situation ?
Thanks,
Guenter
next prev parent reply other threads:[~2020-01-17 16:49 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 20:39 [PATCH 0/6] Fix Exynos4210 DMA support Guenter Roeck
2020-01-10 20:39 ` [PATCH 1/6] dma/pl330: Convert to support tracing Guenter Roeck
2020-01-17 13:23 ` Peter Maydell
2020-01-17 16:46 ` Guenter Roeck [this message]
2020-01-17 17:05 ` Peter Maydell
2020-01-17 17:41 ` Guenter Roeck
2020-01-10 20:39 ` [PATCH 2/6] hw/arm/exynos4210: Fix DMA initialization Guenter Roeck
2020-01-17 13:30 ` Peter Maydell
2020-01-17 18:07 ` Guenter Roeck
2020-01-17 18:34 ` Peter Maydell
2020-01-10 20:39 ` [PATCH 3/6] hw/char/exynos4210_uart: Convert to support tracing Guenter Roeck
2020-01-17 13:31 ` Peter Maydell
2020-01-10 20:39 ` [PATCH 4/6] hw/char/exynos4210_uart: Implement receive FIFO Guenter Roeck
2020-01-17 13:42 ` Peter Maydell
2020-01-17 18:21 ` Guenter Roeck
2020-01-17 18:36 ` Peter Maydell
2020-01-10 20:39 ` [PATCH 5/6] hw/char/exynos4210_uart: Add receive DMA support Guenter Roeck
2020-01-17 13:44 ` Peter Maydell
2020-01-10 20:39 ` [PATCH 6/6] hw/arm/exynos4210: Connect serial port DMA busy signals with pl330 Guenter Roeck
2020-01-17 13:48 ` Peter Maydell
2020-01-17 18:29 ` Guenter Roeck
2020-01-17 18:44 ` Peter Maydell
2020-01-18 15:08 ` Guenter Roeck
2020-01-18 20:02 ` Peter Maydell
2020-01-19 1:52 ` Guenter Roeck
2020-01-19 19:01 ` Peter Maydell
2020-01-19 19:09 ` Guenter Roeck
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=20200117164625.GA27197@roeck-us.net \
--to=linux@roeck-us.net \
--cc=i.mitsyanko@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--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 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).