diff options
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/builtin-trace.c | 5 | ||||
| -rw-r--r-- | tools/perf/trace/beauty/Build | 1 | ||||
| -rw-r--r-- | tools/perf/trace/beauty/arch_prctl.c | 33 | ||||
| -rw-r--r-- | tools/perf/trace/beauty/beauty.h | 3 |
4 files changed, 41 insertions, 1 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 6d9be952e3a7..2cc62ca75b2e 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
| @@ -664,6 +664,9 @@ static struct syscall_fmt { | |||
| 664 | } syscall_fmts[] = { | 664 | } syscall_fmts[] = { |
| 665 | { .name = "access", | 665 | { .name = "access", |
| 666 | .arg = { [1] = { .scnprintf = SCA_ACCMODE, /* mode */ }, }, }, | 666 | .arg = { [1] = { .scnprintf = SCA_ACCMODE, /* mode */ }, }, }, |
| 667 | { .name = "arch_prctl", | ||
| 668 | .arg = { [0] = { .scnprintf = SCA_X86_ARCH_PRCTL_CODE, /* code */ }, | ||
| 669 | [1] = { .scnprintf = SCA_PTR, /* arg2 */ }, }, }, | ||
| 667 | { .name = "bind", | 670 | { .name = "bind", |
| 668 | .arg = { [1] = { .scnprintf = SCA_SOCKADDR, /* umyaddr */ }, }, }, | 671 | .arg = { [1] = { .scnprintf = SCA_SOCKADDR, /* umyaddr */ }, }, }, |
| 669 | { .name = "bpf", | 672 | { .name = "bpf", |
| @@ -793,7 +796,7 @@ static struct syscall_fmt { | |||
| 793 | [3] = { .scnprintf = SCA_INT, /* pkey */ }, }, }, | 796 | [3] = { .scnprintf = SCA_INT, /* pkey */ }, }, }, |
| 794 | { .name = "poll", .timeout = true, }, | 797 | { .name = "poll", .timeout = true, }, |
| 795 | { .name = "ppoll", .timeout = true, }, | 798 | { .name = "ppoll", .timeout = true, }, |
| 796 | { .name = "prctl", .alias = "arch_prctl", | 799 | { .name = "prctl", |
| 797 | .arg = { [0] = { .scnprintf = SCA_PRCTL_OPTION, /* option */ }, | 800 | .arg = { [0] = { .scnprintf = SCA_PRCTL_OPTION, /* option */ }, |
| 798 | [1] = { .scnprintf = SCA_PRCTL_ARG2, /* arg2 */ }, | 801 | [1] = { .scnprintf = SCA_PRCTL_ARG2, /* arg2 */ }, |
| 799 | [2] = { .scnprintf = SCA_PRCTL_ARG3, /* arg3 */ }, }, }, | 802 | [2] = { .scnprintf = SCA_PRCTL_ARG3, /* arg3 */ }, }, }, |
diff --git a/tools/perf/trace/beauty/Build b/tools/perf/trace/beauty/Build index 10c85cd3eb4f..637365099b7d 100644 --- a/tools/perf/trace/beauty/Build +++ b/tools/perf/trace/beauty/Build | |||
| @@ -7,6 +7,7 @@ endif | |||
| 7 | libperf-y += kcmp.o | 7 | libperf-y += kcmp.o |
| 8 | libperf-y += mount_flags.o | 8 | libperf-y += mount_flags.o |
| 9 | libperf-y += pkey_alloc.o | 9 | libperf-y += pkey_alloc.o |
| 10 | libperf-y += arch_prctl.o | ||
| 10 | libperf-y += prctl.o | 11 | libperf-y += prctl.o |
| 11 | libperf-y += renameat.o | 12 | libperf-y += renameat.o |
| 12 | libperf-y += sockaddr.o | 13 | libperf-y += sockaddr.o |
diff --git a/tools/perf/trace/beauty/arch_prctl.c b/tools/perf/trace/beauty/arch_prctl.c new file mode 100644 index 000000000000..fe022ca67e60 --- /dev/null +++ b/tools/perf/trace/beauty/arch_prctl.c | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | // SPDX-License-Identifier: LGPL-2.1 | ||
| 2 | /* | ||
| 3 | * trace/beauty/arch_prctl.c | ||
| 4 | * | ||
| 5 | * Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include "trace/beauty/beauty.h" | ||
| 9 | #include <linux/kernel.h> | ||
| 10 | |||
| 11 | #include "trace/beauty/generated/x86_arch_prctl_code_array.c" | ||
| 12 | |||
| 13 | static DEFINE_STRARRAY_OFFSET(x86_arch_prctl_codes_1, "ARCH_", x86_arch_prctl_codes_1_offset); | ||
| 14 | static DEFINE_STRARRAY_OFFSET(x86_arch_prctl_codes_2, "ARCH_", x86_arch_prctl_codes_2_offset); | ||
| 15 | |||
| 16 | static struct strarray *x86_arch_prctl_codes[] = { | ||
| 17 | &strarray__x86_arch_prctl_codes_1, | ||
| 18 | &strarray__x86_arch_prctl_codes_2, | ||
| 19 | }; | ||
| 20 | |||
| 21 | static DEFINE_STRARRAYS(x86_arch_prctl_codes); | ||
| 22 | |||
| 23 | static size_t x86_arch_prctl__scnprintf_code(int option, char *bf, size_t size, bool show_prefix) | ||
| 24 | { | ||
| 25 | return strarrays__scnprintf(&strarrays__x86_arch_prctl_codes, bf, size, "%#x", show_prefix, option); | ||
| 26 | } | ||
| 27 | |||
| 28 | size_t syscall_arg__scnprintf_x86_arch_prctl_code(char *bf, size_t size, struct syscall_arg *arg) | ||
| 29 | { | ||
| 30 | unsigned long code = arg->val; | ||
| 31 | |||
| 32 | return x86_arch_prctl__scnprintf_code(code, bf, size, arg->show_string_prefix); | ||
| 33 | } | ||
diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h index 58e734b27958..83c5b202e00e 100644 --- a/tools/perf/trace/beauty/beauty.h +++ b/tools/perf/trace/beauty/beauty.h | |||
| @@ -155,6 +155,9 @@ size_t syscall_arg__scnprintf_pkey_alloc_access_rights(char *bf, size_t size, st | |||
| 155 | size_t syscall_arg__scnprintf_open_flags(char *bf, size_t size, struct syscall_arg *arg); | 155 | size_t syscall_arg__scnprintf_open_flags(char *bf, size_t size, struct syscall_arg *arg); |
| 156 | #define SCA_OPEN_FLAGS syscall_arg__scnprintf_open_flags | 156 | #define SCA_OPEN_FLAGS syscall_arg__scnprintf_open_flags |
| 157 | 157 | ||
| 158 | size_t syscall_arg__scnprintf_x86_arch_prctl_code(char *bf, size_t size, struct syscall_arg *arg); | ||
| 159 | #define SCA_X86_ARCH_PRCTL_CODE syscall_arg__scnprintf_x86_arch_prctl_code | ||
| 160 | |||
| 158 | size_t syscall_arg__scnprintf_prctl_option(char *bf, size_t size, struct syscall_arg *arg); | 161 | size_t syscall_arg__scnprintf_prctl_option(char *bf, size_t size, struct syscall_arg *arg); |
| 159 | #define SCA_PRCTL_OPTION syscall_arg__scnprintf_prctl_option | 162 | #define SCA_PRCTL_OPTION syscall_arg__scnprintf_prctl_option |
| 160 | 163 | ||
