Re: [PATCH 4/4] perf trace beauty: Always show mprotect prot even though PROT_NONE
From: Arnaldo Carvalho de Melo
Date: Thu Apr 18 2024 - 10:34:56 EST
On Thu, Apr 18, 2024 at 09:13:04PM +0800, Changbin Du wrote:
> Do not omit the flags even though it is PROT_NONE.
>
> Signed-off-by: Changbin Du <changbin.du@xxxxxxxxxx>
> ---
> tools/perf/builtin-trace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> index 349550b02f79..7f936f1b5519 100644
> --- a/tools/perf/builtin-trace.c
> +++ b/tools/perf/builtin-trace.c
> @@ -1042,7 +1042,7 @@ static const struct syscall_fmt syscall_fmts[] = {
> [4] = { .scnprintf = SCA_MOVE_MOUNT_FLAGS, /* flags */ }, }, },
> { .name = "mprotect",
> .arg = { [0] = { .scnprintf = SCA_HEX, /* start */ },
> - [2] = { .scnprintf = SCA_MMAP_PROT, /* prot */ }, }, },
> + [2] = { .scnprintf = SCA_MMAP_PROT, .show_zero = true, /* prot */ }, }, },
So since syscall_arg__scnprintf_mmap_prot() special cases 0 to print
NONE for prot... Ok, I'll expand a bit the commit log message _and_ the
syscall_fmts entry for mprotect.
- Arnaldo
> { .name = "mq_unlink",
> .arg = { [0] = { .scnprintf = SCA_FILENAME, /* u_name */ }, }, },
> { .name = "mremap", .hexret = true,
> --
> 2.34.1