From: Peter Maydell <peter.maydell@linaro.org>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Alexander Graf <agraf@suse.de>, Blue Swirl <blauwirbel@gmail.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
Guan Xuetao <gxt@mprc.pku.edu.cn>,
Aurelien Jarno <aurelien@aurel32.net>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v2] qemu-log: add log category for MMU info
Date: Fri, 10 Oct 2014 15:47:46 +0100 [thread overview]
Message-ID: <CAFEAcA_Dd3tkpF-prM8AGgxFLAnq92yFx56UDPjzaWwVZ6YLDw@mail.gmail.com> (raw)
In-Reply-To: <1412938761-24283-1-git-send-email-antonynpavlov@gmail.com>
On 10 October 2014 11:59, Antony Pavlov <antonynpavlov@gmail.com> wrote:
> Running barebox on qemu-system-mips* with '-d unimp' overloads
> stderr by very very many mips_cpu_handle_mmu_fault() messages:
>
> mips_cpu_handle_mmu_fault address=b80003fd ret 0 physical 00000000180003fd prot 3
> mips_cpu_handle_mmu_fault address=a0800884 ret 0 physical 0000000000800884 prot 3
> mips_cpu_handle_mmu_fault pc a080cd80 ad b80003fd rw 0 mmu_idx 0
>
> So it's very difficult to find LOG_UNIMP message.
>
> The mips_cpu_handle_mmu_fault() messages appears on enabling ANY
> logging! It's not very handy.
>
> Adding separate log category for *_cpu_handle_mmu_fault()
> logging fixes the problem.
>
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
This mostly looks good, thanks!
I should also note that I'm happy for us to just implement
the common-code (ie the log flag) and fix those targets
which are particularly obnoxious about logging and/or
easy to fix. We can always leave the other targets to
update their code later (or you could update other targets
in separate patches once the main one has gone in).
A minor tweak:
> --- a/target-cris/helper.c
> +++ b/target-cris/helper.c
> @@ -30,9 +30,11 @@
> #ifdef CRIS_HELPER_DEBUG
> #define D(x) x
> #define D_LOG(...) qemu_log(__VA_ARGS__)
> +#define LOG_MMU(...) qemu_log_mask(CPU_LOG_MMU, __VA_ARGS__)
> #else
> #define D(x)
> #define D_LOG(...) do { } while (0)
> +#define LOG_MMU(...) do { } while (0)
> #endif
Now this logging is configurably enablable at runtime,
we should just call qemu_log_mask() directly, rather
than wrapping it in a LOG_MMU macro which might be compiled
out.
> --- a/target-i386/helper.c
> +++ b/target-i386/helper.c
> @@ -27,6 +27,12 @@
>
> //#define DEBUG_MMU
>
> +#ifdef DEBUG_MMU
> +# define LOG_MMU(...) qemu_log_mask(CPU_LOG_MMU, __VA_ARGS__)
> +#else
> +# define LOG_MMU(...) do { } while (0)
> +#endif
Similarly here.
> --- a/target-microblaze/helper.c
> +++ b/target-microblaze/helper.c
> @@ -22,7 +22,14 @@
> #include "qemu/host-utils.h"
>
> #define D(x)
> -#define DMMU(x)
> +
> +#undef DEBUG_MMU
> +
> +#ifdef DEBUG_MMU
> +# define LOG_MMU(...) qemu_log_mask(CPU_LOG_MMU, __VA_ARGS__)
> +#else
> +# define LOG_MMU(...) do { } while (0)
> +#endif
and here.
> --- a/target-ppc/mmu-hash32.c
> +++ b/target-ppc/mmu-hash32.c
There are other PPC files which also do MMU logging;
we should either fix them all or none of them.
thanks
-- PMM
next prev parent reply other threads:[~2014-10-10 14:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-10 10:59 [Qemu-devel] [PATCH v2] qemu-log: add log category for MMU info Antony Pavlov
2014-10-10 14:47 ` Peter Maydell [this message]
2014-10-13 14:50 ` Alexander Graf
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=CAFEAcA_Dd3tkpF-prM8AGgxFLAnq92yFx56UDPjzaWwVZ6YLDw@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=agraf@suse.de \
--cc=antonynpavlov@gmail.com \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=gxt@mprc.pku.edu.cn \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).