From: Richard Henderson <richard.henderson@linaro.org>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: Riku Voipio <riku.voipio@iki.fi>, Laurent Vivier <laurent@vivier.eu>
Subject: Re: [PATCH v1 2/5] linux-user: convert target_mmap debug to tracepoint
Date: Sun, 1 Dec 2019 17:11:44 -0800 [thread overview]
Message-ID: <44a30f10-a215-daa7-a8a4-0b0a1564a65e@linaro.org> (raw)
In-Reply-To: <20191128194603.24818-3-alex.bennee@linaro.org>
On 11/28/19 7:46 PM, Alex Bennée wrote:
> + if (TRACE_TARGET_MMAP_ENABLED) {
> + char prot_str[4];
> + g_autoptr(GString) flag_str = g_string_new(NULL);
> +
> + pp_prot(&prot_str, prot);
> +
> + if (flags & MAP_FIXED) {
> + g_string_append(flag_str, "MAP_FIXED ");
> + }
> + if (flags & MAP_ANONYMOUS) {
> + g_string_append(flag_str, "MAP_ANON ");
> + }
> +
> + switch (flags & MAP_TYPE) {
> case MAP_PRIVATE:
> - printf("MAP_PRIVATE ");
> + g_string_append(flag_str, "MAP_PRIVATE ");
> break;
> case MAP_SHARED:
> - printf("MAP_SHARED ");
> + g_string_append(flag_str, "MAP_SHARED ");
> break;
> default:
> - printf("[MAP_TYPE=0x%x] ", flags & MAP_TYPE);
> + g_string_append_printf(flag_str, "[MAP_TYPE=0x%x] ",
> + flags & MAP_TYPE);
> break;
> }
> - printf("fd=%d offset=" TARGET_ABI_FMT_lx "\n", fd, offset);
> + trace_target_mmap(start, len, prot_str, flag_str->str, fd, offset);
> }
I don't think that you need to re-create -strace output.
There are also quite a lot of MAP_* flags that are not
being printed, without any indication that they are left out.
Again, I think we should just print the hex value.
r~
next prev parent reply other threads:[~2019-12-02 1:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-28 19:45 [PATCH v1 0/5] linux-user mmap debug cleanup Alex Bennée
2019-11-28 19:45 ` [PATCH v1 1/5] linux-user: convert target_mprotect debug to tracepoint Alex Bennée
2019-12-02 1:04 ` Richard Henderson
2019-11-28 19:46 ` [PATCH v1 2/5] linux-user: convert target_mmap " Alex Bennée
2019-12-02 1:11 ` Richard Henderson [this message]
2019-11-28 19:46 ` [PATCH v1 3/5] linux-user: add target_mmap_complete tracepoint Alex Bennée
2019-12-02 1:12 ` Richard Henderson
2019-11-28 19:46 ` [PATCH v1 4/5] linux-user: log page table changes under -d page Alex Bennée
2019-12-02 1:26 ` Richard Henderson
2019-12-02 18:20 ` Richard Henderson
2019-11-28 19:46 ` [PATCH v1 5/5] linux-user: convert target_munmap debug to a tracepoint Alex Bennée
2019-12-02 1:28 ` Richard Henderson
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=44a30f10-a215-daa7-a8a4-0b0a1564a65e@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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).