From patchwork Thu Jun 6 07:56:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 165955 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8440682ili; Thu, 6 Jun 2019 00:57:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8UWCfd59xOA4RXh0q0mV1LH5M/jFZYv2whyipywm+RQ/o2N2bOgvlJg9Xx442ZKVrpd4Y X-Received: by 2002:a17:90a:aa0a:: with SMTP id k10mr37068194pjq.43.1559807822047; Thu, 06 Jun 2019 00:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559807822; cv=none; d=google.com; s=arc-20160816; b=mw1BcfMvV5tIFNkgL3/LKYt1OkG/x1KJ2rcp+5CSiiOFgF1lsR8YHpOcUWpjCmgWhJ eO1gNVAIq8r6lpXo6OxzhOF0KTSFQUFg9ODz3OMv4j9F9AYQ0xquiQkCwehaeXmh1SlK 3BTcEBFQWrzweFPo19T79jDlSuBcnNvd8XwK/CT5RjRX7QC0sfiDh6wES8+phyaoOjNN pMLNDFjimAaa4otpTLFKAHTOEbxg1SWf8H0RhvZhr3rUiK3EYpmlx/R8AfZLJWD8zO6S OiP2okraaHBmeuw09OtTMo174t0DPGRxlOPtHN88DSgfFKRX4/dHNSlV9AkQe1MsuWhC IgEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=e2oYBhfvK7ZPiWOEwi/H0aRHGINCuJ9bdzg0oB3t3I8=; b=x3TzGniosi1lzc10crdHjLj7Yk704LO8O5dHHVK//8m2k4Sgd68YgfPo05TdmKOV8k UZzipSagSBkYQz+R2+Nk5He00FQtSaVSTt5Y35CJpriiqA4bLRW/kyo3nsbWRaqaIBxl EBryle8+2GhK1ORBweVgEZkBfRBJeyGsfaQ+8Tkx+7wTNM5OJp6zSWSungtm7i6Ct9GS niY41UBHWaQlTot6NEGMzoCHBiL2HqnYSNsgG2NvZUt+zj+yptYTc7c5jADUFv2XLCEt IirCLjUHlZudTgVDQzVSqyO4aKIwiV6tiEBSIcovGaZbbJRsjk9i4AjdmM4eQ3Xdwn/N 76Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zh8eNxLV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si1115797pls.52.2019.06.06.00.57.01; Thu, 06 Jun 2019 00:57:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zh8eNxLV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726961AbfFFH5B (ORCPT + 30 others); Thu, 6 Jun 2019 03:57:01 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:37108 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbfFFH5A (ORCPT ); Thu, 6 Jun 2019 03:57:00 -0400 Received: by mail-yb1-f196.google.com with SMTP id l66so608018ybf.4 for ; Thu, 06 Jun 2019 00:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e2oYBhfvK7ZPiWOEwi/H0aRHGINCuJ9bdzg0oB3t3I8=; b=Zh8eNxLVnPty5J/NWX1zW05wsPNNZWyvKzHuwuWPy86z2xqivWNWZM/j/ppvwdeVuj LHr3pH8+MHJhMqFcaGS+NbuJHQfZhcdzRIJCurDHb7q8kRkGuflNOqzxt/vecFg++PSn lku9coxsyZK+/Fad+hdtdoqKRjenEj9owObNe43aldBYv5qDQacIrU6AIUWtlSgcxm1V ToLzsFz2muoT5Z8TnjBEvend61T5l9DlsUVI8H9NrDbweLlHWqtnAyJxCmrfOjsiWSuB gSsZIDeK80kz4W7cPKSQ3KXiza/hZnKz8+xW0p6i4AWH65z/VmBKL08y5YaV/tPZXqkQ nQ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e2oYBhfvK7ZPiWOEwi/H0aRHGINCuJ9bdzg0oB3t3I8=; b=VsbpNsrWpKamMENHl/5C2XOV5XEdO+t1asnJTC0F5VGqiNIa+yawz6UaWxK3HG6mtv 5Lz9qFxF1b66G6OTi4hFnaY7Mn3AuTsw7jOUQCPtTN4gNe5BqQcvl3ldEPZ7a4lPFujO U2oI15VlmZuTpgA96kpKaqX8qGqBooE0+w7uHlvE7joyOOBbvBNltB/+lVBZqzI5C82+ lOkRBodwl5N8mO2JIOfD5uq3yNtFQt0FPF3R5IR+X+iTEqW3ihI0/VDLv6K0UCLfcP8z PXu+68XxQzs0SuMMcokhJP0cwveIFKEsUGBZ0CO+3kmad7XAcx/ULIvn9N08MU1HgA4R 3bnw== X-Gm-Message-State: APjAAAXbu8JMhZojyIq54KTs4QTHueN0CNyOkakBjAvZTiiv2opUNJjU 0q3Ytv94UbOqaoiceklhJpyqaQ== X-Received: by 2002:a25:6b46:: with SMTP id o6mr14097845ybm.392.1559807819058; Thu, 06 Jun 2019 00:56:59 -0700 (PDT) Received: from localhost.localdomain (li1322-146.members.linode.com. [45.79.223.146]) by smtp.gmail.com with ESMTPSA id 14sm316343yws.16.2019.06.06.00.56.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jun 2019 00:56:58 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Adrian Hunter , Mathieu Poirier , Mike Leach , Suzuki K Poulose , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 3/4] perf augmented_raw_syscalls: Support arm64 raw syscalls Date: Thu, 6 Jun 2019 15:56:16 +0800 Message-Id: <20190606075617.14327-4-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190606075617.14327-1-leo.yan@linaro.org> References: <20190606075617.14327-1-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- .../examples/bpf/augmented_raw_syscalls.c | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) -- 2.17.1 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 {