netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@linaro.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	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
Cc: Leo Yan <leo.yan@linaro.org>
Subject: [PATCH v1 3/4] perf augmented_raw_syscalls: Support arm64 raw syscalls
Date: Thu,  6 Jun 2019 15:56:16 +0800	[thread overview]
Message-ID: <20190606075617.14327-4-leo.yan@linaro.org> (raw)
In-Reply-To: <20190606075617.14327-1-leo.yan@linaro.org>

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.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 .../examples/bpf/augmented_raw_syscalls.c     | 82 +++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/tools/perf/examples/bpf/augmented_raw_syscalls.c b/tools/perf/examples/bpf/augmented_raw_syscalls.c
index 5c4a4e715ae6..f4ed101b697d 100644
--- a/tools/perf/examples/bpf/augmented_raw_syscalls.c
+++ b/tools/perf/examples/bpf/augmented_raw_syscalls.c
@@ -45,6 +45,84 @@ 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_EXECVE             221
+#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 +197,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


  parent reply	other threads:[~2019-06-06  7:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06  7:56 [PATCH v1 0/4] perf augmented_raw_syscalls: Support for arm64 Leo Yan
2019-06-06  7:56 ` [PATCH v1 1/4] perf trace: Exit when build eBPF program failure Leo Yan
2019-06-06  7:56 ` [PATCH v1 2/4] perf augmented_raw_syscalls: Remove duplicate macros Leo Yan
2019-06-06  7:56 ` Leo Yan [this message]
2019-06-06  7:56 ` [PATCH v1 4/4] perf augmented_raw_syscalls: Document clang configuration Leo Yan
2019-06-06  9:52 ` [PATCH v1 0/4] perf augmented_raw_syscalls: Support for arm64 Leo Yan

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=20190606075617.14327-4-leo.yan@linaro.org \
    --to=leo.yan@linaro.org \
    --cc=acme@kernel.org \
    --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=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 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).