From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
Anton Johansson <anjo@rev.ng>
Subject: Re: [PATCH for-8.1] accel/tcg: Zero-pad PC in TCG CPU exec trace lines
Date: Tue, 11 Jul 2023 19:19:59 +0200 [thread overview]
Message-ID: <98d88af5-aa0d-0497-a038-f473e92bc3b1@linaro.org> (raw)
In-Reply-To: <20230711165434.4123674-1-peter.maydell@linaro.org>
On 11/7/23 18:54, Peter Maydell wrote:
> In commit f0a08b0913befbd we changed the type of the PC from
> target_ulong to vaddr. In doing so we inadvertently dropped the
> zero-padding on the PC in trace lines (the second item inside the []
> in these lines). They used to look like this on AArch64, for
> instance:
>
> Trace 0: 0x7f2260000100 [00000000/0000000040000000/00000061/ff200000]
>
> and now they look like this:
> Trace 0: 0x7f4f50000100 [00000000/40000000/00000061/ff200000]
>
> and if the PC happens to be somewhere low like 0x5000
> then the field is shown as /5000/.
>
> This is because TARGET_FMT_lx is a "%08x" or "%016x" specifier,
> depending on TARGET_LONG_SIZE, whereas VADDR_PRIx is just PRIx64
> with no width specifier.
>
> Restore the zero-padding by adding an 016 width specifier to
> this tracing and a couple of others that were similarly recently
> changed to use VADDR_PRIx without a width specifier.
>
> We can't unfortunately restore the "32-bit guests are padded to
> 8 hex digits and 64-bit guests to 16 hex digits" behaviour so
> easily.
>
> Fixes: f0a08b0913befbd ("accel/tcg/cpu-exec.c: Widen pc to vaddr")
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> I have a workflow that parses log files to get the executed
> PC values; I don't suppose I'm the only one doing that...
> ---
> accel/tcg/cpu-exec.c | 4 ++--
> accel/tcg/translate-all.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
next prev parent reply other threads:[~2023-07-11 17:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 16:54 [PATCH for-8.1] accel/tcg: Zero-pad PC in TCG CPU exec trace lines Peter Maydell
2023-07-11 17:19 ` Philippe Mathieu-Daudé [this message]
2023-07-11 17:21 ` Anton Johansson via
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=98d88af5-aa0d-0497-a038-f473e92bc3b1@linaro.org \
--to=philmd@linaro.org \
--cc=anjo@rev.ng \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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).