From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Leo Yan <leo.yan@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Mike Leach <mike.leach@linaro.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH v2 3/4] perf augmented_raw_syscalls: Support arm64 raw syscalls
Date: Thu, 6 Jun 2019 10:38:38 -0300 [thread overview]
Message-ID: <20190606133838.GC30166@kernel.org> (raw)
In-Reply-To: <20190606094845.4800-4-leo.yan@linaro.org>
Em Thu, Jun 06, 2019 at 05:48:44PM +0800, Leo Yan escreveu:
> This patch adds support for arm64 raw syscall numbers so that we can use
> it on arm64 platform.
>
> After applied this patch, we need to specify macro -D__aarch64__ or
> -D__x86_64__ in compilation option so Clang can use the corresponding
> syscall numbers for arm64 or x86_64 respectively, other architectures
> will report failure when compilation.
So, please check what I have in my perf/core branch, I've completely
removed arch specific stuff from augmented_raw_syscalls.c.
What is done now is use a map to specify what to copy, that same map
that is used to state which syscalls should be traced.
It uses that tools/perf/arch/arm64/entry/syscalls/mksyscalltbl to figure
out the mapping of syscall names to ids, just like is done for x86_64
and other arches, falling back to audit-libs when that syscalltbl thing
is not present.
- Arnaldo
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
> .../examples/bpf/augmented_raw_syscalls.c | 81 +++++++++++++++++++
> 1 file changed, 81 insertions(+)
>
> diff --git a/tools/perf/examples/bpf/augmented_raw_syscalls.c b/tools/perf/examples/bpf/augmented_raw_syscalls.c
> index 5c4a4e715ae6..a3701a4daf2e 100644
> --- a/tools/perf/examples/bpf/augmented_raw_syscalls.c
> +++ b/tools/perf/examples/bpf/augmented_raw_syscalls.c
> @@ -45,6 +45,83 @@ struct augmented_filename {
> char value[PATH_MAX];
> };
>
> +#if defined(__aarch64__)
> +
> +/* syscalls where the first arg is a string */
> +#define SYS_OPEN 1024
> +#define SYS_STAT 1038
> +#define SYS_LSTAT 1039
> +#define SYS_ACCESS 1033
> +#define SYS_EXECVE 221
> +#define SYS_TRUNCATE 45
> +#define SYS_CHDIR 49
> +#define SYS_RENAME 1034
> +#define SYS_MKDIR 1030
> +#define SYS_RMDIR 1031
> +#define SYS_CREAT 1064
> +#define SYS_LINK 1025
> +#define SYS_UNLINK 1026
> +#define SYS_SYMLINK 1036
> +#define SYS_READLINK 1035
> +#define SYS_CHMOD 1028
> +#define SYS_CHOWN 1029
> +#define SYS_LCHOWN 1032
> +#define SYS_MKNOD 1027
> +#define SYS_STATFS 1056
> +#define SYS_PIVOT_ROOT 41
> +#define SYS_CHROOT 51
> +#define SYS_ACCT 89
> +#define SYS_SWAPON 224
> +#define SYS_SWAPOFF 225
> +#define SYS_DELETE_MODULE 106
> +#define SYS_SETXATTR 5
> +#define SYS_LSETXATTR 6
> +#define SYS_GETXATTR 8
> +#define SYS_LGETXATTR 9
> +#define SYS_LISTXATTR 11
> +#define SYS_LLISTXATTR 12
> +#define SYS_REMOVEXATTR 14
> +#define SYS_LREMOVEXATTR 15
> +#define SYS_MQ_OPEN 180
> +#define SYS_MQ_UNLINK 181
> +#define SYS_ADD_KEY 217
> +#define SYS_REQUEST_KEY 218
> +#define SYS_SYMLINKAT 36
> +#define SYS_MEMFD_CREATE 279
> +
> +/* syscalls where the second arg is a string */
> +#define SYS_PWRITE64 68
> +#define SYS_RENAME 1034
> +#define SYS_QUOTACTL 60
> +#define SYS_FSETXATTR 7
> +#define SYS_FGETXATTR 10
> +#define SYS_FREMOVEXATTR 16
> +#define SYS_MQ_TIMEDSEND 182
> +#define SYS_REQUEST_KEY 218
> +#define SYS_INOTIFY_ADD_WATCH 27
> +#define SYS_OPENAT 56
> +#define SYS_MKDIRAT 34
> +#define SYS_MKNODAT 33
> +#define SYS_FCHOWNAT 54
> +#define SYS_FUTIMESAT 1066
> +#define SYS_NEWFSTATAT 1054
> +#define SYS_UNLINKAT 35
> +#define SYS_RENAMEAT 38
> +#define SYS_LINKAT 37
> +#define SYS_READLINKAT 78
> +#define SYS_FCHMODAT 53
> +#define SYS_FACCESSAT 48
> +#define SYS_UTIMENSAT 88
> +#define SYS_NAME_TO_HANDLE_AT 264
> +#define SYS_FINIT_MODULE 273
> +#define SYS_RENAMEAT2 276
> +#define SYS_EXECVEAT 281
> +#define SYS_STATX 291
> +#define SYS_MOVE_MOUNT 429
> +#define SYS_FSPICK 433
> +
> +#elif defined(__x86_64__)
> +
> /* syscalls where the first arg is a string */
> #define SYS_OPEN 2
> #define SYS_STAT 4
> @@ -119,6 +196,10 @@ struct augmented_filename {
> #define SYS_MOVE_MOUNT 429
> #define SYS_FSPICK 433
>
> +#else
> +#error "unsupported architecture"
> +#endif
> +
> pid_filter(pids_filtered);
>
> struct augmented_args_filename {
> --
> 2.17.1
--
- Arnaldo
next prev parent reply other threads:[~2019-06-06 13:38 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-06 9:48 [PATCH v2 0/4] perf augmented_raw_syscalls: Support for arm64 Leo Yan
2019-06-06 9:48 ` [PATCH v2 1/4] perf trace: Exit when build eBPF program failure Leo Yan
2019-06-06 13:30 ` Arnaldo Carvalho de Melo
2019-06-06 13:34 ` Arnaldo Carvalho de Melo
2019-06-10 7:38 ` Leo Yan
2019-06-06 13:56 ` Leo Yan
2019-06-06 9:48 ` [PATCH v2 2/4] perf augmented_raw_syscalls: Remove duplicate macros Leo Yan
2019-06-06 9:48 ` [PATCH v2 3/4] perf augmented_raw_syscalls: Support arm64 raw syscalls Leo Yan
2019-06-06 13:38 ` Arnaldo Carvalho de Melo [this message]
2019-06-06 13:46 ` Arnaldo Carvalho de Melo
2019-06-06 14:05 ` Arnaldo Carvalho de Melo
2019-06-06 14:12 ` Leo Yan
2019-06-06 14:44 ` Arnaldo Carvalho de Melo
2019-06-07 9:58 ` Leo Yan
2019-06-09 13:18 ` Leo Yan
2019-06-10 18:47 ` Arnaldo Carvalho de Melo
2019-06-11 4:18 ` Leo Yan
2019-06-12 2:49 ` Arnaldo Carvalho de Melo
2019-06-13 18:15 ` Arnaldo Carvalho de Melo
2019-06-15 5:52 ` Leo Yan
2019-06-22 6:44 ` [tip:perf/core] perf trace: Fix exclusion of not available syscall names from selector list tip-bot for Arnaldo Carvalho de Melo
2019-06-17 19:53 ` [tip:perf/core] perf trace: Skip unknown syscalls when expanding strace like syscall groups tip-bot for Arnaldo Carvalho de Melo
2019-06-06 9:48 ` [PATCH v2 4/4] perf augmented_raw_syscalls: Document clang configuration Leo Yan
2019-06-06 14:08 ` Arnaldo Carvalho de Melo
2019-06-06 14:35 ` Leo Yan
2019-06-06 18:29 ` Arnaldo Carvalho de Melo
2019-06-07 14:38 ` Leo Yan
2019-06-07 18:33 ` Arnaldo Carvalho de Melo
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=20190606133838.GC30166@kernel.org \
--to=arnaldo.melo@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=jolsa@redhat.com \
--cc=kafai@fb.com \
--cc=leo.yan@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=namhyung@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=suzuki.poulose@arm.com \
--cc=yhs@fb.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.