Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf trace beauty: Always show mmap prot even though PROT_NONE

PROT_NONE is also useful information, so do not omit the mmap prot even
though it is 0. syscall_arg__scnprintf_mmap_prot() could print PROT_NONE
for prot 0.

Before: PROT_NONE is not shown.
$ sudo perf trace -e syscalls:sys_enter_mmap --filter prot==0 -- ls
0.000 ls/2979231 syscalls:sys_enter_mmap(len: 4220888, flags: PRIVATE|ANONYMOUS)

After: PROT_NONE is displayed.
$ sudo perf trace -e syscalls:sys_enter_mmap --filter prot==0 -- ls
0.000 ls/2975708 syscalls:sys_enter_mmap(len: 4220888, prot: NONE, flags: PRIVATE|ANONYMOUS)

Signed-off-by: Changbin Du <changbin.du@huawei.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240522033542.1359421-3-changbin.du@huawei.com

authored by

Changbin Du and committed by
Namhyung Kim
f975c13d 92968dcc

+3 -3
+3 -3
tools/perf/builtin-trace.c
··· 1033 1033 #if defined(__s390x__) 1034 1034 .alias = "old_mmap", 1035 1035 #endif 1036 - .arg = { [2] = { .scnprintf = SCA_MMAP_PROT, /* prot */ }, 1036 + .arg = { [2] = { .scnprintf = SCA_MMAP_PROT, .show_zero = true, /* prot */ }, 1037 1037 [3] = { .scnprintf = SCA_MMAP_FLAGS, /* flags */ 1038 1038 .strtoul = STUL_STRARRAY_FLAGS, 1039 1039 .parm = &strarray__mmap_flags, }, ··· 1050 1050 [4] = { .scnprintf = SCA_MOVE_MOUNT_FLAGS, /* flags */ }, }, }, 1051 1051 { .name = "mprotect", 1052 1052 .arg = { [0] = { .scnprintf = SCA_HEX, /* start */ }, 1053 - [2] = { .scnprintf = SCA_MMAP_PROT, /* prot */ }, }, }, 1053 + [2] = { .scnprintf = SCA_MMAP_PROT, .show_zero = true, /* prot */ }, }, }, 1054 1054 { .name = "mq_unlink", 1055 1055 .arg = { [0] = { .scnprintf = SCA_FILENAME, /* u_name */ }, }, }, 1056 1056 { .name = "mremap", .hexret = true, ··· 1084 1084 .arg = { [0] = { .scnprintf = SCA_INT, /* key */ }, }, }, 1085 1085 { .name = "pkey_mprotect", 1086 1086 .arg = { [0] = { .scnprintf = SCA_HEX, /* start */ }, 1087 - [2] = { .scnprintf = SCA_MMAP_PROT, /* prot */ }, 1087 + [2] = { .scnprintf = SCA_MMAP_PROT, .show_zero = true, /* prot */ }, 1088 1088 [3] = { .scnprintf = SCA_INT, /* pkey */ }, }, }, 1089 1089 { .name = "poll", .timeout = true, }, 1090 1090 { .name = "ppoll", .timeout = true, },