From patchwork Fri Dec 13 00:32:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D140CE7717F for ; Fri, 13 Dec 2024 00:34:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=t3MOgs3m5guykLpyFtWboAXDYEOBZnKmQZ09+bDmuWc=; b=uUB9L9la1laqtm U+CACGZsFeSB6U9xbmP03qQlwD/awKh9dztFELba1wn6/eBbCzKz73gQ0/3ge+6XYutZHk2VTcHQt MpTAul8kX6ubKLtvn0pWoF6oqRQIlNXkFpLx2cIHv1ORjGxRmAmqjoF/HdEM539R+aTHXRtcBrqbh L2pORwrhJf0MIpTRXUcG3SsRPQqePeGCB+8N6OQigUKwYX5/M1kcEThBkCPQ/3a1wxT93zjrg0qt3 FWMpWd7kkzTf5jwoNFvhB9aeDcPezKVEzi/7XhGYDtwbzMofMrF3NAhk3zMykJsZuwpUgDNADQX7f Y+aDdgfqr2iJQdqJXW7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLtdL-00000002IUo-17yY; Fri, 13 Dec 2024 00:34:19 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcF-00000002HwB-3EIb for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:13 +0000 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2ef748105deso866968a91.1 for ; Thu, 12 Dec 2024 16:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734049991; x=1734654791; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2egzSokOcwKn4s7iB/6jvY+hyl8kMzAVttZarBZLacw=; b=rgB/Kax5N8hKwT/p17jMNwHwTRuXhFckT+Kebc2ZGdn597mGbHfvdRRxqGkIS6uTcf B7xeth5UzteVpUk7XX3vcbH7xy/UGo42iBMzG76P2ShiV56RvWjfoIaJDHj7v3KGQkfl x3mEKNLxACRIJYoXc8PbY/yCKYNmPLSft6FZAGMOcxvj3N4frc39nElGmn/jsgkP/r62 GZkvTRCn/9WFMcblNOFMUXTj54uEKtpBdektPHQ5SxFSWGpYMTdjh4H88AiW1MM1D6O6 gZHxZzOO3oz2k0THShquybvZWL1YRZkBCN6iuvzj7umX+hhPYSb++WuOTim8bzA9rFv+ c8Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734049991; x=1734654791; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2egzSokOcwKn4s7iB/6jvY+hyl8kMzAVttZarBZLacw=; b=CkOvDQXbVygvWIODlCe39e2Va7iaU1x48sfmbl8kP7iR65Pah1TdKKjBB+wugz1Q+G 8+DEmsP9XWXomUSLQe7ox2NOooRAbgE/65NQErGlrDwofw0WlYhh1u1wqp5eA9OEvd8b EW+bckaa9B/26DsQVcObjZ4WTHlouducEH9FhV3cdVGa+0e+2wrV2D8wopTCLhRpil6I LKTANm8YTT7n/MVHbxo0m1Xe9NFif0derwEvx2AjBQlD/tFv93m3eWKTIR8cT4+7SgBt ysOJGAEvxwTYGHGKcXn+HsD0sRlafru/QshFlkZslSAhlEd0+uSV2KqMb7m1CTRHrdyW 44Yw== X-Forwarded-Encrypted: i=1; AJvYcCV0BebAKXU6nxJXlN03Ul/ebirkc780cvJ6z41y6AMWk+N2lj7e9iIMGa25EVuPvqqHevGCzhx+M+HX1Q==@lists.infradead.org X-Gm-Message-State: AOJu0YzwmYgrNXQpjuEClgU12BN+NsSDd6Bfzz2BBaxAtn/1w2EQfsp8 lwzQZc1rZVzfxVx2TbHmZUM2lYS+cgrtUdE7erf3xftMjoNDzHGnB+I4fIUb2HY= X-Gm-Gg: ASbGncspTctKHK4BpDr1t5SYzB8ShtUkjvV3LcXWLO9TepoF6rSUJkCPhSok7yWthYA FpBcI5ppWtUsGszTM/73oZUYxpkdEiZrE9AK8+ICu40BajCIRVG+qwgWli5k1Rr5Hqs9V/elnSV gzhEbctbwmpQlOUpgXUHHWyYPJk3LXBNxiOV4gWLF/p8FT59ySzafqHUds04H0sDpoaux/evYA1 jhBMy2FLC3aiemjtuI1Y8zXikmaK2NDuG8FU2ldH2+EpM7zK1/7xtLhvljypykNlJXqn/+S X-Google-Smtp-Source: AGHT+IF6yeoAj7ludMDxoSKdcS7ReuS+hZDtCZG0n/m3EMB7ewsO2H4kEuzJY0Q/obA9Bj3yLBnANA== X-Received: by 2002:a17:90b:53c6:b0:2ee:cded:9ac7 with SMTP id 98e67ed59e1d1-2f28fd7017cmr1172262a91.20.1734049990764; Thu, 12 Dec 2024 16:33:10 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:09 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:32:51 -0800 Subject: [PATCH v2 01/16] perf tools: Create generic syscall table support MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-1-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=30579; i=charlie@rivosinc.com; h=from:subject:message-id; bh=TyKnVvihLcwQXP+GQYLGzSOF3MmtntFSmQpxfnwzRhk=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w95Dyidcy8RNJnl5eusxNTMV+TVGLLmZdPOO1g/DL f5LX87oKGVhEONgkBVTZOG51sDceke/7Kho2QSYOaxMIEMYuDgFYCJORxj+Wb590ftlycZ5kjou 1j5MCarOyx9lZR73kbuaxxX9q3t9DSPDhp6zX2+cuG6fGpvle2orq1qT3asJygbyv6fI/PS/KjK dDwA= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163311_825061_A218B8D7 X-CRM114-Status: GOOD ( 22.02 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Currently each architecture in perf independently generates syscall headers. Adapt the work that has gone into unifying syscall header implementations in the kernel to work with perf tools. Introduce this framework with riscv at first. riscv previously relied on libaudit, but with this change, perf tools for riscv no longer needs this external dependency. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 11 +- tools/perf/Makefile.perf | 4 + tools/perf/arch/riscv/Makefile | 22 -- tools/perf/arch/riscv/entry/syscalls/Kbuild | 2 + .../arch/riscv/entry/syscalls/Makefile.syscalls | 4 + tools/perf/arch/riscv/entry/syscalls/mksyscalltbl | 47 --- tools/perf/arch/riscv/include/syscall_table.h | 8 + tools/perf/check-headers.sh | 1 + tools/perf/scripts/Makefile.syscalls | 60 +++ tools/perf/scripts/syscalltbl.sh | 86 +++++ tools/perf/util/syscalltbl.c | 8 +- tools/scripts/syscall.tbl | 409 +++++++++++++++++++++ 12 files changed, 585 insertions(+), 77 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 2916d59c88cd08b299202a48ddb42fa32aac04a6..a72f25162714f0117a88d94474da336814d4f030 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -35,6 +35,13 @@ ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE := 0 endif + # architectures that use the generic syscall table scripts + ifeq ($(SRCARCH),riscv) + NO_SYSCALL_TABLE := 0 + CFLAGS += -DGENERIC_SYSCALL_TABLE + CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated + endif + ifneq ($(NO_SYSCALL_TABLE),1) CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT endif @@ -83,10 +90,6 @@ ifeq ($(ARCH),mips) LIBUNWIND_LIBS = -lunwind -lunwind-mips endif -ifeq ($(ARCH),riscv) - CFLAGS += -I$(OUTPUT)arch/riscv/include/generated -endif - # So far there's only x86 and arm libdw unwind support merged in perf. # Disable it on all other architectures in case libdw unwind # support is detected in system. Add supported architectures diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index d74241a151313bd09101aabb5d765a5a0a6efc84..f5278ed9f778f928436693a14e016c5c3c5171c1 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -310,6 +310,10 @@ ifeq ($(filter feature-dump,$(MAKECMDGOALS)),feature-dump) FEATURE_TESTS := all endif endif +# architectures that use the generic syscall table +ifeq ($(SRCARCH),riscv) +include $(srctree)/tools/perf/scripts/Makefile.syscalls +endif include Makefile.config endif diff --git a/tools/perf/arch/riscv/Makefile b/tools/perf/arch/riscv/Makefile index 18ad078000e2bba595f92efc5d97a63fdb83ef45..087e099fb453a9236db34878077a51f711881ce0 100644 --- a/tools/perf/arch/riscv/Makefile +++ b/tools/perf/arch/riscv/Makefile @@ -1,25 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 PERF_HAVE_JITDUMP := 1 HAVE_KVM_STAT_SUPPORT := 1 - -# -# Syscall table generation for perf -# - -out := $(OUTPUT)arch/riscv/include/generated/asm -header := $(out)/syscalls.c -incpath := $(srctree)/tools -sysdef := $(srctree)/tools/arch/riscv/include/uapi/asm/unistd.h -sysprf := $(srctree)/tools/perf/arch/riscv/entry/syscalls/ -systbl := $(sysprf)/mksyscalltbl - -# Create output directory if not already present -$(shell [ -d '$(out)' ] || mkdir -p '$(out)') - -$(header): $(sysdef) $(systbl) - $(Q)$(SHELL) '$(systbl)' '$(CC)' '$(HOSTCC)' $(incpath) $(sysdef) > $@ - -clean:: - $(call QUIET_CLEAN, riscv) $(RM) $(header) - -archheaders: $(header) diff --git a/tools/perf/arch/riscv/entry/syscalls/Kbuild b/tools/perf/arch/riscv/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..9a41e3572c3afd4f202321fd9e492714540e8fd3 --- /dev/null +++ b/tools/perf/arch/riscv/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/riscv/entry/syscalls/Makefile.syscalls b/tools/perf/arch/riscv/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..9668fd1faf60e828ed2786c2ee84739ac1f153fc --- /dev/null +++ b/tools/perf/arch/riscv/entry/syscalls/Makefile.syscalls @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += riscv memfd_secret +syscall_abis_64 += riscv rlimit memfd_secret diff --git a/tools/perf/arch/riscv/entry/syscalls/mksyscalltbl b/tools/perf/arch/riscv/entry/syscalls/mksyscalltbl deleted file mode 100755 index c59f5e852b97712a9a879b89e6ef6999ed4b6cd7..0000000000000000000000000000000000000000 --- a/tools/perf/arch/riscv/entry/syscalls/mksyscalltbl +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# -# Generate system call table for perf. Derived from -# powerpc script. -# -# Copyright IBM Corp. 2017 -# Author(s): Hendrik Brueckner -# Changed by: Ravi Bangoria -# Changed by: Kim Phillips -# Changed by: Björn Töpel - -gcc=$1 -hostcc=$2 -incpath=$3 -input=$4 - -if ! test -r $input; then - echo "Could not read input file" >&2 - exit 1 -fi - -create_sc_table() -{ - local sc nr max_nr - - while read sc nr; do - printf "%s\n" " [$nr] = \"$sc\"," - max_nr=$nr - done - - echo "#define SYSCALLTBL_RISCV_MAX_ID $max_nr" -} - -create_table() -{ - echo "#include \"$input\"" - echo "static const char *const syscalltbl_riscv[] = {" - create_sc_table - echo "};" -} - -$gcc -E -dM -x c -I $incpath/include/uapi $input \ - |awk '$2 ~ "__NR" && $3 !~ "__NR3264_" { - sub("^#define __NR(3264)?_", ""); - print | "sort -k2 -n"}' \ - |create_table diff --git a/tools/perf/arch/riscv/include/syscall_table.h b/tools/perf/arch/riscv/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..7ff51b783000d727ec48be960730b81ecdb05575 --- /dev/null +++ b/tools/perf/arch/riscv/include/syscall_table.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include + +#if __BITS_PER_LONG == 64 +#include +#else +#include +#endif diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index a05c1c105c51bf1bd18a59195220894598eb7461..692f48db810ccbef229e240db29261f0c60db632 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -71,6 +71,7 @@ FILES=( "include/uapi/asm-generic/ioctls.h" "include/uapi/asm-generic/mman-common.h" "include/uapi/asm-generic/unistd.h" + "scripts/syscall.tbl" ) declare -a SYNC_CHECK_FILES diff --git a/tools/perf/scripts/Makefile.syscalls b/tools/perf/scripts/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..e2b0c4b513d5c42c8e9ac51a9ea774c34a1311b7 --- /dev/null +++ b/tools/perf/scripts/Makefile.syscalls @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: GPL-2.0 +# This Makefile generates tools/perf/arch/$(SRCARCH)/include/generated/asm from +# the generic syscall table if that is supported by the architecture, otherwise +# from the architecture's defined syscall table. + +PHONY := all +all: + +obj := $(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated/asm + +syscall_abis_32 += common,32 +syscall_abis_64 += common,64 +syscalltbl := $(srctree)/tools/scripts/syscall.tbl + +# let architectures override $(syscall_abis_%) and $(syscalltbl) +-include $(srctree)/tools/perf/arch/$(SRCARCH)/entry/syscalls/Makefile.syscalls +include $(srctree)/scripts/Kbuild.include +-include $(srctree)/tools/perf/arch/$(SRCARCH)/entry/syscalls/Kbuild + +systbl := $(srctree)/tools/perf/scripts/syscalltbl.sh + +syscall-y := $(addprefix $(obj)/, $(syscall-y)) + +# Remove stale wrappers when the corresponding files are removed from generic-y +old-headers := $(wildcard $(obj)/*.c) +unwanted := $(filter-out $(syscall-y),$(old-headers)) + +quiet_cmd_remove = REMOVE $(unwanted) + cmd_remove = rm -f $(unwanted) + +quiet_cmd_systbl = SYSTBL $@ + cmd_systbl = $(CONFIG_SHELL) $(systbl) \ + $(if $(systbl-args-$*),$(systbl-args-$*),$(systbl-args)) \ + --abis $(subst $(space),$(comma),$(strip $(syscall_abis_$*))) \ + $< $@ + +all: $(syscall-y) + $(if $(unwanted),$(call cmd,remove)) + @: + +$(obj)/syscalls_%.h: $(syscalltbl) $(systbl) FORCE + $(call if_changed,systbl) + +targets := $(syscall-y) + +# Create output directory. Skip it if at least one old header exists +# since we know the output directory already exists. +ifeq ($(old-headers),) +$(shell mkdir -p $(obj)) +endif + +PHONY += FORCE + +FORCE: + +existing-targets := $(wildcard $(sort $(targets))) + +-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) + +.PHONY: $(PHONY) diff --git a/tools/perf/scripts/syscalltbl.sh b/tools/perf/scripts/syscalltbl.sh new file mode 100755 index 0000000000000000000000000000000000000000..1ce0d5aa8b506427a66be50f0f441cf6e9705b33 --- /dev/null +++ b/tools/perf/scripts/syscalltbl.sh @@ -0,0 +1,86 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# Generate a syscall table header. +# +# Each line of the syscall table should have the following format: +# +# NR ABI NAME [NATIVE] [COMPAT] +# +# NR syscall number +# ABI ABI name +# NAME syscall name +# NATIVE native entry point (optional) +# COMPAT compat entry point (optional) + +set -e + +usage() { + echo >&2 "usage: $0 [--abis ABIS] INFILE OUTFILE" >&2 + echo >&2 + echo >&2 " INFILE input syscall table" + echo >&2 " OUTFILE output header file" + echo >&2 + echo >&2 "options:" + echo >&2 " --abis ABIS ABI(s) to handle (By default, all lines are handled)" + exit 1 +} + +# default unless specified by options +abis= + +while [ $# -gt 0 ] +do + case $1 in + --abis) + abis=$(echo "($2)" | tr ',' '|') + shift 2;; + -*) + echo "$1: unknown option" >&2 + usage;; + *) + break;; + esac +done + +if [ $# -ne 2 ]; then + usage +fi + +infile="$1" +outfile="$2" + +nxt=0 + +syscall_macro() { + nr="$1" + name="$2" + + echo " [$nr] = \"$name\"," +} + +emit() { + nr="$1" + entry="$2" + + syscall_macro "$nr" "$entry" +} + +echo "static const char *const syscalltbl[] = {" > $outfile + +sorted_table=$(mktemp /tmp/syscalltbl.XXXXXX) +grep -E "^[0-9]+[[:space:]]+$abis" "$infile" | sort -n > $sorted_table + +max_nr=0 +# the params are: nr abi name entry compat +# use _ for intentionally unused variables according to SC2034 +while read nr _ name _ _; do + emit "$nr" "$name" >> $outfile + max_nr=$nr +done < $sorted_table + +rm -f $sorted_table + +echo "};" >> $outfile + +echo "#define SYSCALLTBL_MAX_ID ${max_nr}" >> $outfile diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 69d8dcf5cf28c4e8a0e403153c92bd6436e2a0b2..ccf234a54366f9921c3b9a02ffb0a365d17244bc 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -46,10 +46,10 @@ static const char *const *syscalltbl_native = syscalltbl_mips_n64; #include const int syscalltbl_native_max_id = SYSCALLTBL_LOONGARCH_MAX_ID; static const char *const *syscalltbl_native = syscalltbl_loongarch; -#elif defined(__riscv) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_RISCV_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_riscv; +#elif defined(GENERIC_SYSCALL_TABLE) +#include +const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID; +static const char *const *syscalltbl_native = syscalltbl; #else const int syscalltbl_native_max_id = 0; static const char *const syscalltbl_native[] = { diff --git a/tools/scripts/syscall.tbl b/tools/scripts/syscall.tbl new file mode 100644 index 0000000000000000000000000000000000000000..ebbdb3c42e9f74613b003014c0baf44c842bb756 --- /dev/null +++ b/tools/scripts/syscall.tbl @@ -0,0 +1,409 @@ +# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note +# +# This file contains the system call numbers for all of the +# more recently added architectures. +# +# As a basic principle, no duplication of functionality +# should be added, e.g. we don't use lseek when llseek +# is present. New architectures should use this file +# and implement the less feature-full calls in user space. +# +0 common io_setup sys_io_setup compat_sys_io_setup +1 common io_destroy sys_io_destroy +2 common io_submit sys_io_submit compat_sys_io_submit +3 common io_cancel sys_io_cancel +4 time32 io_getevents sys_io_getevents_time32 +4 64 io_getevents sys_io_getevents +5 common setxattr sys_setxattr +6 common lsetxattr sys_lsetxattr +7 common fsetxattr sys_fsetxattr +8 common getxattr sys_getxattr +9 common lgetxattr sys_lgetxattr +10 common fgetxattr sys_fgetxattr +11 common listxattr sys_listxattr +12 common llistxattr sys_llistxattr +13 common flistxattr sys_flistxattr +14 common removexattr sys_removexattr +15 common lremovexattr sys_lremovexattr +16 common fremovexattr sys_fremovexattr +17 common getcwd sys_getcwd +18 common lookup_dcookie sys_ni_syscall +19 common eventfd2 sys_eventfd2 +20 common epoll_create1 sys_epoll_create1 +21 common epoll_ctl sys_epoll_ctl +22 common epoll_pwait sys_epoll_pwait compat_sys_epoll_pwait +23 common dup sys_dup +24 common dup3 sys_dup3 +25 32 fcntl64 sys_fcntl64 compat_sys_fcntl64 +25 64 fcntl sys_fcntl +26 common inotify_init1 sys_inotify_init1 +27 common inotify_add_watch sys_inotify_add_watch +28 common inotify_rm_watch sys_inotify_rm_watch +29 common ioctl sys_ioctl compat_sys_ioctl +30 common ioprio_set sys_ioprio_set +31 common ioprio_get sys_ioprio_get +32 common flock sys_flock +33 common mknodat sys_mknodat +34 common mkdirat sys_mkdirat +35 common unlinkat sys_unlinkat +36 common symlinkat sys_symlinkat +37 common linkat sys_linkat +# renameat is superseded with flags by renameat2 +38 renameat renameat sys_renameat +39 common umount2 sys_umount +40 common mount sys_mount +41 common pivot_root sys_pivot_root +42 common nfsservctl sys_ni_syscall +43 32 statfs64 sys_statfs64 compat_sys_statfs64 +43 64 statfs sys_statfs +44 32 fstatfs64 sys_fstatfs64 compat_sys_fstatfs64 +44 64 fstatfs sys_fstatfs +45 32 truncate64 sys_truncate64 compat_sys_truncate64 +45 64 truncate sys_truncate +46 32 ftruncate64 sys_ftruncate64 compat_sys_ftruncate64 +46 64 ftruncate sys_ftruncate +47 common fallocate sys_fallocate compat_sys_fallocate +48 common faccessat sys_faccessat +49 common chdir sys_chdir +50 common fchdir sys_fchdir +51 common chroot sys_chroot +52 common fchmod sys_fchmod +53 common fchmodat sys_fchmodat +54 common fchownat sys_fchownat +55 common fchown sys_fchown +56 common openat sys_openat +57 common close sys_close +58 common vhangup sys_vhangup +59 common pipe2 sys_pipe2 +60 common quotactl sys_quotactl +61 common getdents64 sys_getdents64 +62 32 llseek sys_llseek +62 64 lseek sys_lseek +63 common read sys_read +64 common write sys_write +65 common readv sys_readv sys_readv +66 common writev sys_writev sys_writev +67 common pread64 sys_pread64 compat_sys_pread64 +68 common pwrite64 sys_pwrite64 compat_sys_pwrite64 +69 common preadv sys_preadv compat_sys_preadv +70 common pwritev sys_pwritev compat_sys_pwritev +71 32 sendfile64 sys_sendfile64 +71 64 sendfile sys_sendfile64 +72 time32 pselect6 sys_pselect6_time32 compat_sys_pselect6_time32 +72 64 pselect6 sys_pselect6 +73 time32 ppoll sys_ppoll_time32 compat_sys_ppoll_time32 +73 64 ppoll sys_ppoll +74 common signalfd4 sys_signalfd4 compat_sys_signalfd4 +75 common vmsplice sys_vmsplice +76 common splice sys_splice +77 common tee sys_tee +78 common readlinkat sys_readlinkat +79 stat64 fstatat64 sys_fstatat64 +79 64 newfstatat sys_newfstatat +80 stat64 fstat64 sys_fstat64 +80 64 fstat sys_newfstat +81 common sync sys_sync +82 common fsync sys_fsync +83 common fdatasync sys_fdatasync +84 common sync_file_range sys_sync_file_range compat_sys_sync_file_range +85 common timerfd_create sys_timerfd_create +86 time32 timerfd_settime sys_timerfd_settime32 +86 64 timerfd_settime sys_timerfd_settime +87 time32 timerfd_gettime sys_timerfd_gettime32 +87 64 timerfd_gettime sys_timerfd_gettime +88 time32 utimensat sys_utimensat_time32 +88 64 utimensat sys_utimensat +89 common acct sys_acct +90 common capget sys_capget +91 common capset sys_capset +92 common personality sys_personality +93 common exit sys_exit +94 common exit_group sys_exit_group +95 common waitid sys_waitid compat_sys_waitid +96 common set_tid_address sys_set_tid_address +97 common unshare sys_unshare +98 time32 futex sys_futex_time32 +98 64 futex sys_futex +99 common set_robust_list sys_set_robust_list compat_sys_set_robust_list +100 common get_robust_list sys_get_robust_list compat_sys_get_robust_list +101 time32 nanosleep sys_nanosleep_time32 +101 64 nanosleep sys_nanosleep +102 common getitimer sys_getitimer compat_sys_getitimer +103 common setitimer sys_setitimer compat_sys_setitimer +104 common kexec_load sys_kexec_load compat_sys_kexec_load +105 common init_module sys_init_module +106 common delete_module sys_delete_module +107 common timer_create sys_timer_create compat_sys_timer_create +108 time32 timer_gettime sys_timer_gettime32 +108 64 timer_gettime sys_timer_gettime +109 common timer_getoverrun sys_timer_getoverrun +110 time32 timer_settime sys_timer_settime32 +110 64 timer_settime sys_timer_settime +111 common timer_delete sys_timer_delete +112 time32 clock_settime sys_clock_settime32 +112 64 clock_settime sys_clock_settime +113 time32 clock_gettime sys_clock_gettime32 +113 64 clock_gettime sys_clock_gettime +114 time32 clock_getres sys_clock_getres_time32 +114 64 clock_getres sys_clock_getres +115 time32 clock_nanosleep sys_clock_nanosleep_time32 +115 64 clock_nanosleep sys_clock_nanosleep +116 common syslog sys_syslog +117 common ptrace sys_ptrace compat_sys_ptrace +118 common sched_setparam sys_sched_setparam +119 common sched_setscheduler sys_sched_setscheduler +120 common sched_getscheduler sys_sched_getscheduler +121 common sched_getparam sys_sched_getparam +122 common sched_setaffinity sys_sched_setaffinity compat_sys_sched_setaffinity +123 common sched_getaffinity sys_sched_getaffinity compat_sys_sched_getaffinity +124 common sched_yield sys_sched_yield +125 common sched_get_priority_max sys_sched_get_priority_max +126 common sched_get_priority_min sys_sched_get_priority_min +127 time32 sched_rr_get_interval sys_sched_rr_get_interval_time32 +127 64 sched_rr_get_interval sys_sched_rr_get_interval +128 common restart_syscall sys_restart_syscall +129 common kill sys_kill +130 common tkill sys_tkill +131 common tgkill sys_tgkill +132 common sigaltstack sys_sigaltstack compat_sys_sigaltstack +133 common rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend +134 common rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction +135 common rt_sigprocmask sys_rt_sigprocmask compat_sys_rt_sigprocmask +136 common rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending +137 time32 rt_sigtimedwait sys_rt_sigtimedwait_time32 compat_sys_rt_sigtimedwait_time32 +137 64 rt_sigtimedwait sys_rt_sigtimedwait +138 common rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo +139 common rt_sigreturn sys_rt_sigreturn compat_sys_rt_sigreturn +140 common setpriority sys_setpriority +141 common getpriority sys_getpriority +142 common reboot sys_reboot +143 common setregid sys_setregid +144 common setgid sys_setgid +145 common setreuid sys_setreuid +146 common setuid sys_setuid +147 common setresuid sys_setresuid +148 common getresuid sys_getresuid +149 common setresgid sys_setresgid +150 common getresgid sys_getresgid +151 common setfsuid sys_setfsuid +152 common setfsgid sys_setfsgid +153 common times sys_times compat_sys_times +154 common setpgid sys_setpgid +155 common getpgid sys_getpgid +156 common getsid sys_getsid +157 common setsid sys_setsid +158 common getgroups sys_getgroups +159 common setgroups sys_setgroups +160 common uname sys_newuname +161 common sethostname sys_sethostname +162 common setdomainname sys_setdomainname +# getrlimit and setrlimit are superseded with prlimit64 +163 rlimit getrlimit sys_getrlimit compat_sys_getrlimit +164 rlimit setrlimit sys_setrlimit compat_sys_setrlimit +165 common getrusage sys_getrusage compat_sys_getrusage +166 common umask sys_umask +167 common prctl sys_prctl +168 common getcpu sys_getcpu +169 time32 gettimeofday sys_gettimeofday compat_sys_gettimeofday +169 64 gettimeofday sys_gettimeofday +170 time32 settimeofday sys_settimeofday compat_sys_settimeofday +170 64 settimeofday sys_settimeofday +171 time32 adjtimex sys_adjtimex_time32 +171 64 adjtimex sys_adjtimex +172 common getpid sys_getpid +173 common getppid sys_getppid +174 common getuid sys_getuid +175 common geteuid sys_geteuid +176 common getgid sys_getgid +177 common getegid sys_getegid +178 common gettid sys_gettid +179 common sysinfo sys_sysinfo compat_sys_sysinfo +180 common mq_open sys_mq_open compat_sys_mq_open +181 common mq_unlink sys_mq_unlink +182 time32 mq_timedsend sys_mq_timedsend_time32 +182 64 mq_timedsend sys_mq_timedsend +183 time32 mq_timedreceive sys_mq_timedreceive_time32 +183 64 mq_timedreceive sys_mq_timedreceive +184 common mq_notify sys_mq_notify compat_sys_mq_notify +185 common mq_getsetattr sys_mq_getsetattr compat_sys_mq_getsetattr +186 common msgget sys_msgget +187 common msgctl sys_msgctl compat_sys_msgctl +188 common msgrcv sys_msgrcv compat_sys_msgrcv +189 common msgsnd sys_msgsnd compat_sys_msgsnd +190 common semget sys_semget +191 common semctl sys_semctl compat_sys_semctl +192 time32 semtimedop sys_semtimedop_time32 +192 64 semtimedop sys_semtimedop +193 common semop sys_semop +194 common shmget sys_shmget +195 common shmctl sys_shmctl compat_sys_shmctl +196 common shmat sys_shmat compat_sys_shmat +197 common shmdt sys_shmdt +198 common socket sys_socket +199 common socketpair sys_socketpair +200 common bind sys_bind +201 common listen sys_listen +202 common accept sys_accept +203 common connect sys_connect +204 common getsockname sys_getsockname +205 common getpeername sys_getpeername +206 common sendto sys_sendto +207 common recvfrom sys_recvfrom compat_sys_recvfrom +208 common setsockopt sys_setsockopt sys_setsockopt +209 common getsockopt sys_getsockopt sys_getsockopt +210 common shutdown sys_shutdown +211 common sendmsg sys_sendmsg compat_sys_sendmsg +212 common recvmsg sys_recvmsg compat_sys_recvmsg +213 common readahead sys_readahead compat_sys_readahead +214 common brk sys_brk +215 common munmap sys_munmap +216 common mremap sys_mremap +217 common add_key sys_add_key +218 common request_key sys_request_key +219 common keyctl sys_keyctl compat_sys_keyctl +220 common clone sys_clone +221 common execve sys_execve compat_sys_execve +222 32 mmap2 sys_mmap2 +222 64 mmap sys_mmap +223 32 fadvise64_64 sys_fadvise64_64 compat_sys_fadvise64_64 +223 64 fadvise64 sys_fadvise64_64 +224 common swapon sys_swapon +225 common swapoff sys_swapoff +226 common mprotect sys_mprotect +227 common msync sys_msync +228 common mlock sys_mlock +229 common munlock sys_munlock +230 common mlockall sys_mlockall +231 common munlockall sys_munlockall +232 common mincore sys_mincore +233 common madvise sys_madvise +234 common remap_file_pages sys_remap_file_pages +235 common mbind sys_mbind +236 common get_mempolicy sys_get_mempolicy +237 common set_mempolicy sys_set_mempolicy +238 common migrate_pages sys_migrate_pages +239 common move_pages sys_move_pages +240 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo +241 common perf_event_open sys_perf_event_open +242 common accept4 sys_accept4 +243 time32 recvmmsg sys_recvmmsg_time32 compat_sys_recvmmsg_time32 +243 64 recvmmsg sys_recvmmsg +# Architectures may provide up to 16 syscalls of their own between 244 and 259 +244 arc cacheflush sys_cacheflush +245 arc arc_settls sys_arc_settls +246 arc arc_gettls sys_arc_gettls +247 arc sysfs sys_sysfs +248 arc arc_usr_cmpxchg sys_arc_usr_cmpxchg + +244 csky set_thread_area sys_set_thread_area +245 csky cacheflush sys_cacheflush + +244 nios2 cacheflush sys_cacheflush + +244 or1k or1k_atomic sys_or1k_atomic + +258 riscv riscv_hwprobe sys_riscv_hwprobe +259 riscv riscv_flush_icache sys_riscv_flush_icache + +260 time32 wait4 sys_wait4 compat_sys_wait4 +260 64 wait4 sys_wait4 +261 common prlimit64 sys_prlimit64 +262 common fanotify_init sys_fanotify_init +263 common fanotify_mark sys_fanotify_mark +264 common name_to_handle_at sys_name_to_handle_at +265 common open_by_handle_at sys_open_by_handle_at +266 time32 clock_adjtime sys_clock_adjtime32 +266 64 clock_adjtime sys_clock_adjtime +267 common syncfs sys_syncfs +268 common setns sys_setns +269 common sendmmsg sys_sendmmsg compat_sys_sendmmsg +270 common process_vm_readv sys_process_vm_readv +271 common process_vm_writev sys_process_vm_writev +272 common kcmp sys_kcmp +273 common finit_module sys_finit_module +274 common sched_setattr sys_sched_setattr +275 common sched_getattr sys_sched_getattr +276 common renameat2 sys_renameat2 +277 common seccomp sys_seccomp +278 common getrandom sys_getrandom +279 common memfd_create sys_memfd_create +280 common bpf sys_bpf +281 common execveat sys_execveat compat_sys_execveat +282 common userfaultfd sys_userfaultfd +283 common membarrier sys_membarrier +284 common mlock2 sys_mlock2 +285 common copy_file_range sys_copy_file_range +286 common preadv2 sys_preadv2 compat_sys_preadv2 +287 common pwritev2 sys_pwritev2 compat_sys_pwritev2 +288 common pkey_mprotect sys_pkey_mprotect +289 common pkey_alloc sys_pkey_alloc +290 common pkey_free sys_pkey_free +291 common statx sys_statx +292 time32 io_pgetevents sys_io_pgetevents_time32 compat_sys_io_pgetevents +292 64 io_pgetevents sys_io_pgetevents +293 common rseq sys_rseq +294 common kexec_file_load sys_kexec_file_load +# 295 through 402 are unassigned to sync up with generic numbers don't use +403 32 clock_gettime64 sys_clock_gettime +404 32 clock_settime64 sys_clock_settime +405 32 clock_adjtime64 sys_clock_adjtime +406 32 clock_getres_time64 sys_clock_getres +407 32 clock_nanosleep_time64 sys_clock_nanosleep +408 32 timer_gettime64 sys_timer_gettime +409 32 timer_settime64 sys_timer_settime +410 32 timerfd_gettime64 sys_timerfd_gettime +411 32 timerfd_settime64 sys_timerfd_settime +412 32 utimensat_time64 sys_utimensat +413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 +414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64 +416 32 io_pgetevents_time64 sys_io_pgetevents compat_sys_io_pgetevents_time64 +417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 +418 32 mq_timedsend_time64 sys_mq_timedsend +419 32 mq_timedreceive_time64 sys_mq_timedreceive +420 32 semtimedop_time64 sys_semtimedop +421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 +422 32 futex_time64 sys_futex +423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval +424 common pidfd_send_signal sys_pidfd_send_signal +425 common io_uring_setup sys_io_uring_setup +426 common io_uring_enter sys_io_uring_enter +427 common io_uring_register sys_io_uring_register +428 common open_tree sys_open_tree +429 common move_mount sys_move_mount +430 common fsopen sys_fsopen +431 common fsconfig sys_fsconfig +432 common fsmount sys_fsmount +433 common fspick sys_fspick +434 common pidfd_open sys_pidfd_open +435 common clone3 sys_clone3 +436 common close_range sys_close_range +437 common openat2 sys_openat2 +438 common pidfd_getfd sys_pidfd_getfd +439 common faccessat2 sys_faccessat2 +440 common process_madvise sys_process_madvise +441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 +442 common mount_setattr sys_mount_setattr +443 common quotactl_fd sys_quotactl_fd +444 common landlock_create_ruleset sys_landlock_create_ruleset +445 common landlock_add_rule sys_landlock_add_rule +446 common landlock_restrict_self sys_landlock_restrict_self +447 memfd_secret memfd_secret sys_memfd_secret +448 common process_mrelease sys_process_mrelease +449 common futex_waitv sys_futex_waitv +450 common set_mempolicy_home_node sys_set_mempolicy_home_node +451 common cachestat sys_cachestat +452 common fchmodat2 sys_fchmodat2 +453 common map_shadow_stack sys_map_shadow_stack +454 common futex_wake sys_futex_wake +455 common futex_wait sys_futex_wait +456 common futex_requeue sys_futex_requeue +457 common statmount sys_statmount +458 common listmount sys_listmount +459 common lsm_get_self_attr sys_lsm_get_self_attr +460 common lsm_set_self_attr sys_lsm_set_self_attr +461 common lsm_list_modules sys_lsm_list_modules +462 common mseal sys_mseal +463 common setxattrat sys_setxattrat +464 common getxattrat sys_getxattrat +465 common listxattrat sys_listxattrat +466 common removexattrat sys_removexattrat From patchwork Fri Dec 13 00:32:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4440DE7717F for ; Fri, 13 Dec 2024 00:35:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jc9Eto49TEIz8v9YInRZZWQzAkl50xZA58qjO67yxnc=; b=JryDe2OpfD2+6Y wNVm6M+NCYjT6JiQCOQYizcplO6fldxbvH2smBW3hp6Essu2zZCTNLfE+FeuxI85VIesijek6eNPV +y1emzHztzuhJh1LBWrQBd/NXSJEJ1pMnEV5RyT5NHQnCQEAVCZHS+jODq1HzGgDC+BzWfauzVLkj kBfxNqi5WplfqEdR9TKXehTvH4qvxyfNRJ9tbfelrcMAsC23fYWv4lBshkhPL7ergvoKMsbSGz5tY yUzDs0zKJSrPnIEAzFBg8U7kDYX8QchnPkiNAyWPKFUMiGpLNJQcj/2ng8jISAxIPoVt+wXL2OxJt +11zYZM/RpgG2X4pMXAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLteO-00000002IqA-21qw; Fri, 13 Dec 2024 00:35:24 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcI-00000002HxZ-0lMv for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:15 +0000 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-728eccf836bso1114480b3a.1 for ; Thu, 12 Dec 2024 16:33:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734049993; x=1734654793; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=x/t4tAnrXs8dbqT90IARLfldAs+rJPVA/lhEFBD44es=; b=blkcj+00jML6H7cEyPHzQDF4cbrMr5yIY4xruTPBewvUnhCLK/01g8sC9+GuBt8kuD GD6RvhSjwLT5NT1RXda7ZspcqWsnys9Sjng3z8zXYc76wqcMyzqrHTt2FuHSsp7bu4Pz t6g5hkpe4W0UlZzop2RaQZaRaVaAgDq4Qr4rLI70Tef3ySRLbNShFkbufO+uB68iKEp0 vshsIlK3mcpirZGNvXTi+VBn1i4+QqmKkQcBS4E14g980GL521XJnnPC8skOTcDQPCSg AuAHZKpfQEoTAOajbopN2ws1fy/p5F3TUuZLNTE1hULwwY3AuwuKt3kYW0Ulji0Kcay8 051w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734049993; x=1734654793; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x/t4tAnrXs8dbqT90IARLfldAs+rJPVA/lhEFBD44es=; b=kMbis61p4WUa+UVnVPe9oHyhsg3xu7XVRl7nzeRe5bnexFxjxWu3uQ2NHPLsbWiVek yVQRmcjv2TRBHsb0j3BIdcj0+nBQefpIj4v233iz4+ZeGzRcmILWaooG5D6TCtoPkQRU Y2spNP0qZxZN8EjrHVwmk3DVwTrw/Sh+5Hz7uUeXdTAuQ7qpoDVvl1DXEWc1BdGbXPpI gD1jKSr3WbrSuvUgMWlk0RCRUcNdOV5Yk+pw/mI2O425QpgkO1frnPinc+3qZkz9slKq /PMkXYt0WysAgsB3UhCL766NORcM3+rG4d7/pGtUVhJcEnUpSZ1E/Ec+kLkmRaExNLg+ 4MrA== X-Forwarded-Encrypted: i=1; AJvYcCXdRkfy/ZLEHgruKCqO1jpsRFWWZcNv3lSoWkyZeLqFik9sTysdbePDQM77zpeT6g3gBci8cob3LyCL9Q==@lists.infradead.org X-Gm-Message-State: AOJu0YzLKooEtH5KFBCnITL96rk0IeS5zzRt4tWAjIY8edVMt8jrjRwC zuRzYN6FDmVZd7I5/FqpbfVNYNgtxt4Su14/dZOGR/S3nyGzN2Xgs1s2KZBLzFM= X-Gm-Gg: ASbGncv7UEz3CiLGslZuito+1oAcvQuRMVZozCyMNqs79ng5rBjM63vzmfz/OzrRiDj 9TzpLYZOxRiYcTi1nhaL2C3xS1exPc9GsgSoAYELN208xSLkMlQmTCXyARBd/oIEZ+EAqnsI+NG REbtYSY1aPk/1w2hYOndJODdDsk85ZXLWaEsjq8eezdhW8mIZF+goddig2B/IIEGU/bESQ+WFJx a95sgTyXAmfM3ZL4qFNUZWgcIxJQ6BIYO9YlIiXuwQ37ieMREAyQP7PXPDRQEl32RZMqFFX X-Google-Smtp-Source: AGHT+IEd23eNeza65b/mFf2Ef1epXFx4Y/eggrgjqxpS7nxWsumxa7/TVE+fCJ8K+wC5TazJMd2/IA== X-Received: by 2002:a17:90b:54c7:b0:2ee:c9b6:c26a with SMTP id 98e67ed59e1d1-2f28fb68ef6mr1014242a91.11.1734049993490; Thu, 12 Dec 2024 16:33:13 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:12 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:32:52 -0800 Subject: [PATCH v2 02/16] perf tools: arc: Support generic syscall headers MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-2-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2767; i=charlie@rivosinc.com; h=from:subject:message-id; bh=IQtfuUT0+eGZ51OwwywtWIPS5QSw2EsnD9K86OE9bhw=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w97f96cdWBjf3P5j8qf/XPecPv058Sizvjb1nfH/N DZe06qojlIWBjEOBlkxRRaeaw3MrXf0y46Klk2AmcPKBDKEgYtTACby9R8jw6mSmU2bFY+3Lfy/ XOjNdrf3s3MDnGu57qrvuLzXbt28jB+MDKsnS+vzMHHtjLyR+cPn56XF7vwGb3eaLjRf//zjQ7t NKlwA X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163314_230477_741BDA35 X-CRM114-Status: GOOD ( 13.58 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Arc uses the generic syscall table, use that in perf instead of requiring libaudit. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 2 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/arc/entry/syscalls/Kbuild | 2 ++ tools/perf/arch/arc/entry/syscalls/Makefile.syscalls | 3 +++ tools/perf/arch/arc/include/syscall_table.h | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index a72f25162714f0117a88d94474da336814d4f030..3959a9c9972999f6d1bb85e8c1d7dc5dce92fd09 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -36,7 +36,7 @@ ifneq ($(NO_SYSCALL_TABLE),1) endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),riscv) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index f5278ed9f778f928436693a14e016c5c3c5171c1..3b463b42b0e3982e74056e672b2ee6adad5a3f0e 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),riscv) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/arc/entry/syscalls/Kbuild b/tools/perf/arch/arc/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..11707c481a24ecf4e220e51eb1aca890fe929a13 --- /dev/null +++ b/tools/perf/arch/arc/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_32.h diff --git a/tools/perf/arch/arc/entry/syscalls/Makefile.syscalls b/tools/perf/arch/arc/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..391d30ab7a831b72d2ed3f2e7966fdbf558a9ed7 --- /dev/null +++ b/tools/perf/arch/arc/entry/syscalls/Makefile.syscalls @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += arc time32 renameat stat64 rlimit diff --git a/tools/perf/arch/arc/include/syscall_table.h b/tools/perf/arch/arc/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..4c942821662d95216765b176a84d5fc7974e1064 --- /dev/null +++ b/tools/perf/arch/arc/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include From patchwork Fri Dec 13 00:32:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81993E77182 for ; Fri, 13 Dec 2024 01:45:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=437Cr1ACQ96sgJ8LdsDVxZglu2CUZFvh6tDoQZlalMA=; b=Pbs3E52kLT3xS5 OQWpvkTJiCtZ9a+797NZ1FHQi/4J+ZR9a1+lp2VT3WTg5QWvMITZR/4zEeasoWDzJAkEHoreg90c5 PKJLpDSUkBl0r8De/dWyWIlXiHNb4dueOKowZHF0heeL067G8CKlH+oc+n7LlJVUQsbR8P7nVILVb bixMbCk5E6Vtj3QIMBBSGBa2UWtygpQAOjS6xANxbCLbMPccA6VwrwI9ItDu7GyLiko7L2X0xD/UE QHG0xVbVI+TeV5qtq58/wsarPdNdewNunWa63id1QLsIvEIiw9/4IkYk/ImxBBELUVEbt5RSE2BeG aISgGSDbV+XvNwtbTxgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLukJ-00000002RAy-1pgz; Fri, 13 Dec 2024 01:45:35 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcK-00000002HzA-3Mnm for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:18 +0000 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2eed82ca5b4so1017223a91.2 for ; Thu, 12 Dec 2024 16:33:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734049996; x=1734654796; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rp8FO0OCSZ/qUCDzOjOMxVbbH2AtMi4o4J4InXgU+q8=; b=cZvD9q3j+ZDsjbqxc7kjoRRcfsWK4kAr9ickamG3DEJ7RpT0RYI2KyhlPpfqqhMhaI 8ippQHaVzwnGC/E10128A6A7dCmSeadIK6koEwW+GlNFz8gLeFgTPjsiMXpLk1EBiJHK WUJGjXiGg80mdv+ifqzNOHOZNVuU0lAFj5oY97W7ET4C8/OB5oEQ4a/20ai7J4KEiE6l awrbbUPg1mv2fyReYTDcPInltcA3dZWrKe772GD6teFCzZzzP5HABZdIdQnZ+5grdz9L k82dYx4OoIt66H5rOecwSeJH/Bxzm3rg0+fn/bYDAl9DhM2O9G79lpBvIryXUDJGnLVe ALGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734049996; x=1734654796; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rp8FO0OCSZ/qUCDzOjOMxVbbH2AtMi4o4J4InXgU+q8=; b=gDOKH4bnKpITL4B8eMsNbo/q24ICNTjMR7vNZ7PhQvrouJccyoHw+1h1L6aZBaXzYw LnpR4rFci1U7qBeVT/hizs3I7YrNqtpuBv7vtzHICZEItcK2Eo9T1GFOwF0J8RhTGmiN rIj/Ycn8szZPNM7da/3LMg7kdyKJoARi7L7XtWkZKdDVio1rtJFqFyyWN2pNNqN9RHeF /bcR34giZF1pffmgqDwx+qR0HgBsXD+97XDs6Tn8C9TXP2c/Yny7mUrw4ABC5RtJZTGZ Uq2fYznJhhkZI3+/VYKOWX+lAPQ7O4U4DfVYekwoL+6OxJJwlgxqAXXBYCP8j0eO3+jh 5RwA== X-Forwarded-Encrypted: i=1; AJvYcCXz9QVVY3NAL0/b/Krm2exfLLtvGNsPsjlmmOzaiWo2fa8qWmCEU6lTldsi+eMYpAvxO/gpJZryRtZ8dA==@lists.infradead.org X-Gm-Message-State: AOJu0Yxn0QFgeh8sRdjMu+MnJ20JN0RnKOxaYH6fMiy72C50JsKGZPvf R4/VsYP7SF75icHZjvgL1Zdk53Z6iNxTTlurjc1PDaQBllZfPusjDfSyjYT39iY= X-Gm-Gg: ASbGncuT/Y2arVM+N/RP0aY/jVFYI/cH+RlTaZtG/nQiHieI8BZT4UASh4zIqWjJRX4 LFqmHByFYr2Yb140r6uzMF8PQSL9W3ohZJ145ejmx0A2CGGrbDgCxnpya3VESwgbRzBZf0LoLCV fXzTiYx9h0x1zQrh07/RZ0VO6a/i0GBbIsVc8dcSlATp/3SGlp6R4TCIDJN/eE6f8QgjhGyBFwN MGTFFE3PYYB+jaP+JyUj3MgeY4jtNSvLv5543sBoDgYBWu4aVONO1zJjc/6pFwwPfzqCh8u X-Google-Smtp-Source: AGHT+IG4gRsZLG4Vx2a1/zZIKlGxZhkfrJbfitUgDX8Uz2b6ouZp8VypnAWgqiCZsMeD1Is8X9jPmw== X-Received: by 2002:a17:90b:4a04:b0:2ea:3d2e:a0d7 with SMTP id 98e67ed59e1d1-2f28fb67655mr1250703a91.15.1734049995974; Thu, 12 Dec 2024 16:33:15 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:15 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:32:53 -0800 Subject: [PATCH v2 03/16] perf tools: csky: Support generic syscall headers MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-3-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2834; i=charlie@rivosinc.com; h=from:subject:message-id; bh=s+YOevH5qJpXQeBMeav5HfEhx0qMLUBz1Ow99oWav84=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w967bHUGluV/JWs/VJgacMaueH7pVN/r1WWOmRVbW yJiw191lLIwiHEwyIopsvBca2BuvaNfdlS0bALMHFYmkCEMXJwCMBHFOkaG90lu90Vq035fnTjJ XfEzd/a/jKDIJxaK19sYPf9kMSjdYvifO7dMZILE251LdOYfVm4MklfMfhnaeM7s/SK92aqF0zK 5AQ== X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163316_839718_5639EC6E X-CRM114-Status: GOOD ( 13.45 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org csky uses the generic syscall table, use that in perf instead of requiring libaudit. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 2 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/csky/entry/syscalls/Kbuild | 2 ++ tools/perf/arch/csky/entry/syscalls/Makefile.syscalls | 3 +++ tools/perf/arch/csky/include/syscall_table.h | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 3959a9c9972999f6d1bb85e8c1d7dc5dce92fd09..6fcaa051a47621b818b4c9d967eeed050056e400 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -36,7 +36,7 @@ ifneq ($(NO_SYSCALL_TABLE),1) endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 3b463b42b0e3982e74056e672b2ee6adad5a3f0e..407f589046e032c4103c3b6b82c9d044560c5bac 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/csky/entry/syscalls/Kbuild b/tools/perf/arch/csky/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..11707c481a24ecf4e220e51eb1aca890fe929a13 --- /dev/null +++ b/tools/perf/arch/csky/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_32.h diff --git a/tools/perf/arch/csky/entry/syscalls/Makefile.syscalls b/tools/perf/arch/csky/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..ea2dd10d0571df464574a9c0232ada0ac1f79a3f --- /dev/null +++ b/tools/perf/arch/csky/entry/syscalls/Makefile.syscalls @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += csky time32 stat64 rlimit diff --git a/tools/perf/arch/csky/include/syscall_table.h b/tools/perf/arch/csky/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..4c942821662d95216765b176a84d5fc7974e1064 --- /dev/null +++ b/tools/perf/arch/csky/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include From patchwork Fri Dec 13 00:32:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 091E2E7717F for ; Fri, 13 Dec 2024 01:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Nc7fdOXuKA7y5H2wQElp4GK02EUFLe8pUriScE28spA=; b=siC02Vtk7vBkDG PrFLxmcjqv/mu7tu7eQ2uVOAeW2x5+7UCV9j7ZzI8oT2kqVNfJEkgbV+539A4afRCTwUqnX2Ypdix yA6IRELboPAaZvbE6uQP6F/t40PxmlmEmkttZtbsBCTykk6QoHEMOpt/CJPFBosHif5iuJTznATEh R1trYS1akckWznf3a5xgfSVL874AceVQWAWLVftFZn4DJAYm4kZDxa0joRLSMAU6a6nJHkMEaJ1pK DugIh+lULnYW9q35ut08TFRl5OL549XmJKmJUJWIxBUPRD8PUnWIEf1ebiRLge5O7YeqLSflZaS40 18i5vWyP74JvRRxzvkRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLukJ-00000002RB6-43h9; Fri, 13 Dec 2024 01:45:35 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcN-00000002I0i-2UVZ for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:21 +0000 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2ee709715d9so821474a91.3 for ; Thu, 12 Dec 2024 16:33:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734049998; x=1734654798; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jRqxhRwmWWf0Ee5Vxbkg4BeeHvBfjrfnc4D6BWUmq2Q=; b=VlCu7fH45ywPNpp/bj15uyQRjnNJqP7k5NLOa25RgdJ4Tx/6jA+lFKVJzAtxSVqM29 mKOH+Nq94ZZjH4fibruFtCbbwPxCANYpUpNQLv8ZsBa28wWY2+Pq17vsuDA7yH2Qurb8 EqAsfu5UEbk5TuLLJl5a88TlNTQaE84FWseQXQ3rOw1648jjQeamq0hcskxxWYk5EWAu Eg7ZHPzlo+1i42IfTH6yf2p0pnKocV0jREz8Kt3JYtW1iKDkbCC0s18Hn5RxEJzjUcpd RpqEUTZ0kMCiNBYVyIJJuTjzXrPmVSkyD7w4tSaIVE/Uefrp8pCKw7eywYvzNeHQ5ijT 2wSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734049998; x=1734654798; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jRqxhRwmWWf0Ee5Vxbkg4BeeHvBfjrfnc4D6BWUmq2Q=; b=qABJgwFPfwAMrexwW+PuoeaTMaKM9BSOy05CLCYlubhw7aWwE2BZJO05H34hwD3Cfe NaBTmE+iGKv9kJvKhSR6l8dOrZAVetBo4H1IS4BE9Bvr4l//MzeOKVOBH8vKzjsVj0+b FIwe+J35E45YBsrU4aZ4Re1mLjnYx88dfkDwcxcpAyQTAMOMxBVESbwpF7FYPeF1/WGz Bhhrjm2TT4TOPIyC3LCCaLhhlohiQUHcltG6+n/jMpT7gYWoXs5rKaap0z7TB3pI3/PK nCac4DMpr2wr/K5M4tERKvD3T/fut30PUx6ocZ/lSbPBTvmvJk3ottw0z2ozqAQP8Cr1 nrOw== X-Forwarded-Encrypted: i=1; AJvYcCWqACet4miRTEJTqibAXV4lQ6WDG0nEy1YfWefZi7slUH5mf8+xEIrKM5qRbMTKb9asyP+gwB275ipQkg==@lists.infradead.org X-Gm-Message-State: AOJu0YyvQALvSqwVYkXnnKMHcPcMH8b4pd/pCxMbzcIXIc5dCat1B5+s WPPx8TXGPHS7vp6L+GN3FKDzbaxSj7QlUumBlnsLie9a6EimPPQm71VQVzChKsM= X-Gm-Gg: ASbGncvnoQf5ltB+daJL+/AfSOPxKGjIFLjHw7tUd5gJ/i8MO9IQnaqyZSyLP7bAU+w 6YAIQ+eB6iQ0GRjpKFx/8A7UD9vLTNx9TwPehZgapkWeMLG2r5o1JMMUC2GfHkjymu0gxeXalFn NRrOXybC751X88Vq04jT+hUjZVRHldoklLu5Bscge20DkMzinMEK/tFjA52TbQ3FfLsaQpfhLFG kSIbtDU4tomGH9LT7AEDvMDm31D57j0xmf3AUJhU01ZbW9KJHTH6lAaSunoUTEnzcnoXMsa X-Google-Smtp-Source: AGHT+IEWCleVojuZhyaEqqU2Tzu8uPmJI8boLgzLP7kqNnI96XWthxj7tkqpwwX6CVJLeYzUV+sJHg== X-Received: by 2002:a17:90b:1810:b0:2ee:94d1:7a9d with SMTP id 98e67ed59e1d1-2f2901b3bb3mr988102a91.32.1734049998483; Thu, 12 Dec 2024 16:33:18 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:17 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:32:54 -0800 Subject: [PATCH v2 04/16] perf tools: arm: Support syscall headers MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-4-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=22736; i=charlie@rivosinc.com; h=from:subject:message-id; bh=LQ5Tvvmkf3mYO+1QxEo7nSakU3N71XdvNGJ51FJaLm8=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w74lbI/vzn2c9ffHjvZrP868lfrvyR6rwrvmyefIF zUzp0xo7ShlYRDjYJAVU2ThudbA3HpHv+yoaNkEmDmsTCBDGLg4BWAiEucYGbbtFO6ua1S+dV6H 5/G3NfIp526/V3J8n3tZSFpY/fP3V68ZGQ4us7ALt7PO0pP0/2q2/Jzwwl2ddvN894TxBOpW3Hp 4lRkA X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163319_649862_9ECD4449 X-CRM114-Status: GOOD ( 15.39 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org arm uses a syscall table, use that in perf instead of requiring libaudit. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 2 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/arm/entry/syscalls/Kbuild | 4 + .../perf/arch/arm/entry/syscalls/Makefile.syscalls | 2 + tools/perf/arch/arm/entry/syscalls/syscall.tbl | 483 +++++++++++++++++++++ tools/perf/arch/arm/include/syscall_table.h | 2 + tools/perf/check-headers.sh | 1 + 7 files changed, 494 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 6fcaa051a47621b818b4c9d967eeed050056e400..3093cf90e76d3627e9ef842ea1a24dbeb6f56422 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -36,7 +36,7 @@ ifneq ($(NO_SYSCALL_TABLE),1) endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 407f589046e032c4103c3b6b82c9d044560c5bac..01a6cd630396204c9119b12bb1fe26b6133fa5d2 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/arm/entry/syscalls/Kbuild b/tools/perf/arch/arm/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..9d777540f08987908a6532c5ece66553dffc52df --- /dev/null +++ b/tools/perf/arch/arm/entry/syscalls/Kbuild @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += oabi +syscalltbl = $(srctree)/tools/perf/arch/arm/entry/syscalls/syscall.tbl diff --git a/tools/perf/arch/arm/entry/syscalls/Makefile.syscalls b/tools/perf/arch/arm/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..11707c481a24ecf4e220e51eb1aca890fe929a13 --- /dev/null +++ b/tools/perf/arch/arm/entry/syscalls/Makefile.syscalls @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_32.h diff --git a/tools/perf/arch/arm/entry/syscalls/syscall.tbl b/tools/perf/arch/arm/entry/syscalls/syscall.tbl new file mode 100644 index 0000000000000000000000000000000000000000..49eeb2ad8dbd8e074c6240417693f23fb328afa8 --- /dev/null +++ b/tools/perf/arch/arm/entry/syscalls/syscall.tbl @@ -0,0 +1,483 @@ +# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note +# +# Linux system call numbers and entry vectors +# +# The format is: +# [ []] +# +# Where abi is: +# common - for system calls shared between oabi and eabi (may have compat) +# oabi - for oabi-only system calls (may have compat) +# eabi - for eabi-only system calls +# +# For each syscall number, "common" is mutually exclusive with oabi and eabi +# +0 common restart_syscall sys_restart_syscall +1 common exit sys_exit +2 common fork sys_fork +3 common read sys_read +4 common write sys_write +5 common open sys_open +6 common close sys_close +# 7 was sys_waitpid +8 common creat sys_creat +9 common link sys_link +10 common unlink sys_unlink +11 common execve sys_execve +12 common chdir sys_chdir +13 oabi time sys_time32 +14 common mknod sys_mknod +15 common chmod sys_chmod +16 common lchown sys_lchown16 +# 17 was sys_break +# 18 was sys_stat +19 common lseek sys_lseek +20 common getpid sys_getpid +21 common mount sys_mount +22 oabi umount sys_oldumount +23 common setuid sys_setuid16 +24 common getuid sys_getuid16 +25 oabi stime sys_stime32 +26 common ptrace sys_ptrace +27 oabi alarm sys_alarm +# 28 was sys_fstat +29 common pause sys_pause +30 oabi utime sys_utime32 +# 31 was sys_stty +# 32 was sys_gtty +33 common access sys_access +34 common nice sys_nice +# 35 was sys_ftime +36 common sync sys_sync +37 common kill sys_kill +38 common rename sys_rename +39 common mkdir sys_mkdir +40 common rmdir sys_rmdir +41 common dup sys_dup +42 common pipe sys_pipe +43 common times sys_times +# 44 was sys_prof +45 common brk sys_brk +46 common setgid sys_setgid16 +47 common getgid sys_getgid16 +# 48 was sys_signal +49 common geteuid sys_geteuid16 +50 common getegid sys_getegid16 +51 common acct sys_acct +52 common umount2 sys_umount +# 53 was sys_lock +54 common ioctl sys_ioctl +55 common fcntl sys_fcntl +# 56 was sys_mpx +57 common setpgid sys_setpgid +# 58 was sys_ulimit +# 59 was sys_olduname +60 common umask sys_umask +61 common chroot sys_chroot +62 common ustat sys_ustat +63 common dup2 sys_dup2 +64 common getppid sys_getppid +65 common getpgrp sys_getpgrp +66 common setsid sys_setsid +67 common sigaction sys_sigaction +# 68 was sys_sgetmask +# 69 was sys_ssetmask +70 common setreuid sys_setreuid16 +71 common setregid sys_setregid16 +72 common sigsuspend sys_sigsuspend +73 common sigpending sys_sigpending +74 common sethostname sys_sethostname +75 common setrlimit sys_setrlimit +# Back compat 2GB limited rlimit +76 oabi getrlimit sys_old_getrlimit +77 common getrusage sys_getrusage +78 common gettimeofday sys_gettimeofday +79 common settimeofday sys_settimeofday +80 common getgroups sys_getgroups16 +81 common setgroups sys_setgroups16 +82 oabi select sys_old_select +83 common symlink sys_symlink +# 84 was sys_lstat +85 common readlink sys_readlink +86 common uselib sys_uselib +87 common swapon sys_swapon +88 common reboot sys_reboot +89 oabi readdir sys_old_readdir +90 oabi mmap sys_old_mmap +91 common munmap sys_munmap +92 common truncate sys_truncate +93 common ftruncate sys_ftruncate +94 common fchmod sys_fchmod +95 common fchown sys_fchown16 +96 common getpriority sys_getpriority +97 common setpriority sys_setpriority +# 98 was sys_profil +99 common statfs sys_statfs +100 common fstatfs sys_fstatfs +# 101 was sys_ioperm +102 oabi socketcall sys_socketcall sys_oabi_socketcall +103 common syslog sys_syslog +104 common setitimer sys_setitimer +105 common getitimer sys_getitimer +106 common stat sys_newstat +107 common lstat sys_newlstat +108 common fstat sys_newfstat +# 109 was sys_uname +# 110 was sys_iopl +111 common vhangup sys_vhangup +# 112 was sys_idle +# syscall to call a syscall! +113 oabi syscall sys_syscall +114 common wait4 sys_wait4 +115 common swapoff sys_swapoff +116 common sysinfo sys_sysinfo +117 oabi ipc sys_ipc sys_oabi_ipc +118 common fsync sys_fsync +119 common sigreturn sys_sigreturn_wrapper +120 common clone sys_clone +121 common setdomainname sys_setdomainname +122 common uname sys_newuname +# 123 was sys_modify_ldt +124 common adjtimex sys_adjtimex_time32 +125 common mprotect sys_mprotect +126 common sigprocmask sys_sigprocmask +# 127 was sys_create_module +128 common init_module sys_init_module +129 common delete_module sys_delete_module +# 130 was sys_get_kernel_syms +131 common quotactl sys_quotactl +132 common getpgid sys_getpgid +133 common fchdir sys_fchdir +134 common bdflush sys_ni_syscall +135 common sysfs sys_sysfs +136 common personality sys_personality +# 137 was sys_afs_syscall +138 common setfsuid sys_setfsuid16 +139 common setfsgid sys_setfsgid16 +140 common _llseek sys_llseek +141 common getdents sys_getdents +142 common _newselect sys_select +143 common flock sys_flock +144 common msync sys_msync +145 common readv sys_readv +146 common writev sys_writev +147 common getsid sys_getsid +148 common fdatasync sys_fdatasync +149 common _sysctl sys_ni_syscall +150 common mlock sys_mlock +151 common munlock sys_munlock +152 common mlockall sys_mlockall +153 common munlockall sys_munlockall +154 common sched_setparam sys_sched_setparam +155 common sched_getparam sys_sched_getparam +156 common sched_setscheduler sys_sched_setscheduler +157 common sched_getscheduler sys_sched_getscheduler +158 common sched_yield sys_sched_yield +159 common sched_get_priority_max sys_sched_get_priority_max +160 common sched_get_priority_min sys_sched_get_priority_min +161 common sched_rr_get_interval sys_sched_rr_get_interval_time32 +162 common nanosleep sys_nanosleep_time32 +163 common mremap sys_mremap +164 common setresuid sys_setresuid16 +165 common getresuid sys_getresuid16 +# 166 was sys_vm86 +# 167 was sys_query_module +168 common poll sys_poll +169 common nfsservctl +170 common setresgid sys_setresgid16 +171 common getresgid sys_getresgid16 +172 common prctl sys_prctl +173 common rt_sigreturn sys_rt_sigreturn_wrapper +174 common rt_sigaction sys_rt_sigaction +175 common rt_sigprocmask sys_rt_sigprocmask +176 common rt_sigpending sys_rt_sigpending +177 common rt_sigtimedwait sys_rt_sigtimedwait_time32 +178 common rt_sigqueueinfo sys_rt_sigqueueinfo +179 common rt_sigsuspend sys_rt_sigsuspend +180 common pread64 sys_pread64 sys_oabi_pread64 +181 common pwrite64 sys_pwrite64 sys_oabi_pwrite64 +182 common chown sys_chown16 +183 common getcwd sys_getcwd +184 common capget sys_capget +185 common capset sys_capset +186 common sigaltstack sys_sigaltstack +187 common sendfile sys_sendfile +# 188 reserved +# 189 reserved +190 common vfork sys_vfork +# SuS compliant getrlimit +191 common ugetrlimit sys_getrlimit +192 common mmap2 sys_mmap2 +193 common truncate64 sys_truncate64 sys_oabi_truncate64 +194 common ftruncate64 sys_ftruncate64 sys_oabi_ftruncate64 +195 common stat64 sys_stat64 sys_oabi_stat64 +196 common lstat64 sys_lstat64 sys_oabi_lstat64 +197 common fstat64 sys_fstat64 sys_oabi_fstat64 +198 common lchown32 sys_lchown +199 common getuid32 sys_getuid +200 common getgid32 sys_getgid +201 common geteuid32 sys_geteuid +202 common getegid32 sys_getegid +203 common setreuid32 sys_setreuid +204 common setregid32 sys_setregid +205 common getgroups32 sys_getgroups +206 common setgroups32 sys_setgroups +207 common fchown32 sys_fchown +208 common setresuid32 sys_setresuid +209 common getresuid32 sys_getresuid +210 common setresgid32 sys_setresgid +211 common getresgid32 sys_getresgid +212 common chown32 sys_chown +213 common setuid32 sys_setuid +214 common setgid32 sys_setgid +215 common setfsuid32 sys_setfsuid +216 common setfsgid32 sys_setfsgid +217 common getdents64 sys_getdents64 +218 common pivot_root sys_pivot_root +219 common mincore sys_mincore +220 common madvise sys_madvise +221 common fcntl64 sys_fcntl64 sys_oabi_fcntl64 +# 222 for tux +# 223 is unused +224 common gettid sys_gettid +225 common readahead sys_readahead sys_oabi_readahead +226 common setxattr sys_setxattr +227 common lsetxattr sys_lsetxattr +228 common fsetxattr sys_fsetxattr +229 common getxattr sys_getxattr +230 common lgetxattr sys_lgetxattr +231 common fgetxattr sys_fgetxattr +232 common listxattr sys_listxattr +233 common llistxattr sys_llistxattr +234 common flistxattr sys_flistxattr +235 common removexattr sys_removexattr +236 common lremovexattr sys_lremovexattr +237 common fremovexattr sys_fremovexattr +238 common tkill sys_tkill +239 common sendfile64 sys_sendfile64 +240 common futex sys_futex_time32 +241 common sched_setaffinity sys_sched_setaffinity +242 common sched_getaffinity sys_sched_getaffinity +243 common io_setup sys_io_setup +244 common io_destroy sys_io_destroy +245 common io_getevents sys_io_getevents_time32 +246 common io_submit sys_io_submit +247 common io_cancel sys_io_cancel +248 common exit_group sys_exit_group +249 common lookup_dcookie sys_ni_syscall +250 common epoll_create sys_epoll_create +251 common epoll_ctl sys_epoll_ctl sys_oabi_epoll_ctl +252 common epoll_wait sys_epoll_wait +253 common remap_file_pages sys_remap_file_pages +# 254 for set_thread_area +# 255 for get_thread_area +256 common set_tid_address sys_set_tid_address +257 common timer_create sys_timer_create +258 common timer_settime sys_timer_settime32 +259 common timer_gettime sys_timer_gettime32 +260 common timer_getoverrun sys_timer_getoverrun +261 common timer_delete sys_timer_delete +262 common clock_settime sys_clock_settime32 +263 common clock_gettime sys_clock_gettime32 +264 common clock_getres sys_clock_getres_time32 +265 common clock_nanosleep sys_clock_nanosleep_time32 +266 common statfs64 sys_statfs64_wrapper +267 common fstatfs64 sys_fstatfs64_wrapper +268 common tgkill sys_tgkill +269 common utimes sys_utimes_time32 +270 common arm_fadvise64_64 sys_arm_fadvise64_64 +271 common pciconfig_iobase sys_pciconfig_iobase +272 common pciconfig_read sys_pciconfig_read +273 common pciconfig_write sys_pciconfig_write +274 common mq_open sys_mq_open +275 common mq_unlink sys_mq_unlink +276 common mq_timedsend sys_mq_timedsend_time32 +277 common mq_timedreceive sys_mq_timedreceive_time32 +278 common mq_notify sys_mq_notify +279 common mq_getsetattr sys_mq_getsetattr +280 common waitid sys_waitid +281 common socket sys_socket +282 common bind sys_bind sys_oabi_bind +283 common connect sys_connect sys_oabi_connect +284 common listen sys_listen +285 common accept sys_accept +286 common getsockname sys_getsockname +287 common getpeername sys_getpeername +288 common socketpair sys_socketpair +289 common send sys_send +290 common sendto sys_sendto sys_oabi_sendto +291 common recv sys_recv +292 common recvfrom sys_recvfrom +293 common shutdown sys_shutdown +294 common setsockopt sys_setsockopt +295 common getsockopt sys_getsockopt +296 common sendmsg sys_sendmsg sys_oabi_sendmsg +297 common recvmsg sys_recvmsg +298 common semop sys_semop sys_oabi_semop +299 common semget sys_semget +300 common semctl sys_old_semctl +301 common msgsnd sys_msgsnd +302 common msgrcv sys_msgrcv +303 common msgget sys_msgget +304 common msgctl sys_old_msgctl +305 common shmat sys_shmat +306 common shmdt sys_shmdt +307 common shmget sys_shmget +308 common shmctl sys_old_shmctl +309 common add_key sys_add_key +310 common request_key sys_request_key +311 common keyctl sys_keyctl +312 common semtimedop sys_semtimedop_time32 sys_oabi_semtimedop +313 common vserver +314 common ioprio_set sys_ioprio_set +315 common ioprio_get sys_ioprio_get +316 common inotify_init sys_inotify_init +317 common inotify_add_watch sys_inotify_add_watch +318 common inotify_rm_watch sys_inotify_rm_watch +319 common mbind sys_mbind +320 common get_mempolicy sys_get_mempolicy +321 common set_mempolicy sys_set_mempolicy +322 common openat sys_openat +323 common mkdirat sys_mkdirat +324 common mknodat sys_mknodat +325 common fchownat sys_fchownat +326 common futimesat sys_futimesat_time32 +327 common fstatat64 sys_fstatat64 sys_oabi_fstatat64 +328 common unlinkat sys_unlinkat +329 common renameat sys_renameat +330 common linkat sys_linkat +331 common symlinkat sys_symlinkat +332 common readlinkat sys_readlinkat +333 common fchmodat sys_fchmodat +334 common faccessat sys_faccessat +335 common pselect6 sys_pselect6_time32 +336 common ppoll sys_ppoll_time32 +337 common unshare sys_unshare +338 common set_robust_list sys_set_robust_list +339 common get_robust_list sys_get_robust_list +340 common splice sys_splice +341 common arm_sync_file_range sys_sync_file_range2 +342 common tee sys_tee +343 common vmsplice sys_vmsplice +344 common move_pages sys_move_pages +345 common getcpu sys_getcpu +346 common epoll_pwait sys_epoll_pwait +347 common kexec_load sys_kexec_load +348 common utimensat sys_utimensat_time32 +349 common signalfd sys_signalfd +350 common timerfd_create sys_timerfd_create +351 common eventfd sys_eventfd +352 common fallocate sys_fallocate +353 common timerfd_settime sys_timerfd_settime32 +354 common timerfd_gettime sys_timerfd_gettime32 +355 common signalfd4 sys_signalfd4 +356 common eventfd2 sys_eventfd2 +357 common epoll_create1 sys_epoll_create1 +358 common dup3 sys_dup3 +359 common pipe2 sys_pipe2 +360 common inotify_init1 sys_inotify_init1 +361 common preadv sys_preadv +362 common pwritev sys_pwritev +363 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo +364 common perf_event_open sys_perf_event_open +365 common recvmmsg sys_recvmmsg_time32 +366 common accept4 sys_accept4 +367 common fanotify_init sys_fanotify_init +368 common fanotify_mark sys_fanotify_mark +369 common prlimit64 sys_prlimit64 +370 common name_to_handle_at sys_name_to_handle_at +371 common open_by_handle_at sys_open_by_handle_at +372 common clock_adjtime sys_clock_adjtime32 +373 common syncfs sys_syncfs +374 common sendmmsg sys_sendmmsg +375 common setns sys_setns +376 common process_vm_readv sys_process_vm_readv +377 common process_vm_writev sys_process_vm_writev +378 common kcmp sys_kcmp +379 common finit_module sys_finit_module +380 common sched_setattr sys_sched_setattr +381 common sched_getattr sys_sched_getattr +382 common renameat2 sys_renameat2 +383 common seccomp sys_seccomp +384 common getrandom sys_getrandom +385 common memfd_create sys_memfd_create +386 common bpf sys_bpf +387 common execveat sys_execveat +388 common userfaultfd sys_userfaultfd +389 common membarrier sys_membarrier +390 common mlock2 sys_mlock2 +391 common copy_file_range sys_copy_file_range +392 common preadv2 sys_preadv2 +393 common pwritev2 sys_pwritev2 +394 common pkey_mprotect sys_pkey_mprotect +395 common pkey_alloc sys_pkey_alloc +396 common pkey_free sys_pkey_free +397 common statx sys_statx +398 common rseq sys_rseq +399 common io_pgetevents sys_io_pgetevents_time32 +400 common migrate_pages sys_migrate_pages +401 common kexec_file_load sys_kexec_file_load +# 402 is unused +403 common clock_gettime64 sys_clock_gettime +404 common clock_settime64 sys_clock_settime +405 common clock_adjtime64 sys_clock_adjtime +406 common clock_getres_time64 sys_clock_getres +407 common clock_nanosleep_time64 sys_clock_nanosleep +408 common timer_gettime64 sys_timer_gettime +409 common timer_settime64 sys_timer_settime +410 common timerfd_gettime64 sys_timerfd_gettime +411 common timerfd_settime64 sys_timerfd_settime +412 common utimensat_time64 sys_utimensat +413 common pselect6_time64 sys_pselect6 +414 common ppoll_time64 sys_ppoll +416 common io_pgetevents_time64 sys_io_pgetevents +417 common recvmmsg_time64 sys_recvmmsg +418 common mq_timedsend_time64 sys_mq_timedsend +419 common mq_timedreceive_time64 sys_mq_timedreceive +420 common semtimedop_time64 sys_semtimedop +421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait +422 common futex_time64 sys_futex +423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval +424 common pidfd_send_signal sys_pidfd_send_signal +425 common io_uring_setup sys_io_uring_setup +426 common io_uring_enter sys_io_uring_enter +427 common io_uring_register sys_io_uring_register +428 common open_tree sys_open_tree +429 common move_mount sys_move_mount +430 common fsopen sys_fsopen +431 common fsconfig sys_fsconfig +432 common fsmount sys_fsmount +433 common fspick sys_fspick +434 common pidfd_open sys_pidfd_open +435 common clone3 sys_clone3 +436 common close_range sys_close_range +437 common openat2 sys_openat2 +438 common pidfd_getfd sys_pidfd_getfd +439 common faccessat2 sys_faccessat2 +440 common process_madvise sys_process_madvise +441 common epoll_pwait2 sys_epoll_pwait2 +442 common mount_setattr sys_mount_setattr +443 common quotactl_fd sys_quotactl_fd +444 common landlock_create_ruleset sys_landlock_create_ruleset +445 common landlock_add_rule sys_landlock_add_rule +446 common landlock_restrict_self sys_landlock_restrict_self +# 447 reserved for memfd_secret +448 common process_mrelease sys_process_mrelease +449 common futex_waitv sys_futex_waitv +450 common set_mempolicy_home_node sys_set_mempolicy_home_node +451 common cachestat sys_cachestat +452 common fchmodat2 sys_fchmodat2 +453 common map_shadow_stack sys_map_shadow_stack +454 common futex_wake sys_futex_wake +455 common futex_wait sys_futex_wait +456 common futex_requeue sys_futex_requeue +457 common statmount sys_statmount +458 common listmount sys_listmount +459 common lsm_get_self_attr sys_lsm_get_self_attr +460 common lsm_set_self_attr sys_lsm_set_self_attr +461 common lsm_list_modules sys_lsm_list_modules +462 common mseal sys_mseal +463 common setxattrat sys_setxattrat +464 common getxattrat sys_getxattrat +465 common listxattrat sys_listxattrat +466 common removexattrat sys_removexattrat diff --git a/tools/perf/arch/arm/include/syscall_table.h b/tools/perf/arch/arm/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..4c942821662d95216765b176a84d5fc7974e1064 --- /dev/null +++ b/tools/perf/arch/arm/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index 692f48db810ccbef229e240db29261f0c60db632..542f3bee1501c751a831df460c4e585ab756c8fc 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -202,6 +202,7 @@ check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscall check_2 tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl check_2 tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl check_2 tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl +check_2 tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/arm/tools/syscall.tbl for i in "${BEAUTY_FILES[@]}" do From patchwork Fri Dec 13 00:32:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906174 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 728F2E77182 for ; Fri, 13 Dec 2024 00:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HBVCMk5oMBJVgbX8MM4ALgBsCsPCROIISLpSaVVIMiM=; b=HtPiP/rXCiPOV/ 6Cl3BK0G5yJF11PB0FqrR8Ncc3pYpOjL+23Yw6ZL86uCKU3FwtlrRheR/NPC138CJvp3jY+Tb3J82 s2rgF4kEeYT3i3d7lM02wemlSpkdnRHM6oXL/zy2lZSQO6aNeAc+4L4seJiLHcLlb+/EqxL3q6jD2 vDOm2aorbc/VewxPvX5gMWkm3jQNYX9PsxH8aElUd2tDInpl/yEOTqP1lyYbLkJLVAtL9Iwhc7ICC YH7aO18Shl+cdWxN4UmJkpnOqsZo7UOv9EyjUKi2qK/n7zlrkhDIdwz48reXMfHlNFak6bjLbJagm e2p8cnJN7SpiWsiOEhwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLtia-00000002Jmj-3Uxl; Fri, 13 Dec 2024 00:39:44 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcQ-00000002I2A-0PXY for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:23 +0000 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-801c7e6518eso81606a12.2 for ; Thu, 12 Dec 2024 16:33:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050001; x=1734654801; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=nB9xofuldxCbUh4nLn3ZCecsSIAgTWLMv78iNRAOfnQ=; b=OyDBaaPPz6RcwBw2b7yJtu794UmzKaECOsk8QqQP+R5IHq2pWXmYplrjhzsLVxpUuw 7OVXB5lBV6a2ktp0D71mj/BGdTRvmZUUow6CDxaT83hNholxtlFSKMwvMp3G7lN2UlPF chj8cZdTX0A2UTp7qIvxct4TwlP0Na5FO7flkQXRvuOyCo7dnctaDqCne+A6Nnqix2W8 iVoX7YK05kPhvknLJzSoitljWgfHSIF+pY9PnFiSrY38zEnwrr6H2m6oU81Md53nzTBV 6mbVY0JGMZdsO5OKF2OLLkWCcd0+YlQUCVAODCeyKLaJA5M3xy9HMJHpdm4NEih2dXNh hxZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050001; x=1734654801; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nB9xofuldxCbUh4nLn3ZCecsSIAgTWLMv78iNRAOfnQ=; b=kkVcaQKP8+qBL42xmnE6ScjbMM45MX35BvCVcF2Y99wxaFYbTd4q+9J1sXRWOTyH/J BUDZu4R3c/cHViBWPxXOz8moxh7E4n0uy58qnfghaAk8A8vYErnpQc9bw3nGtoezA1Ib MNAjqflWEYlYtTTVseRk6XTYk9KeKuf5AkHsa9UtWip19KffuEQx9Il5OEi4h1550CPP B1/33rStHqX02ILkXpi+O9/i3EXD2bx7PLcYrxtazKn2yj61qOyDPnxjt/jTg/jP6Wpj +Fl24QVIgQVNkriVQQ6jr+hK8KljV0G1AJ9AU5S4r5n28LPhGBQ8V5TGYa2lxPOdG15M Ie4Q== X-Forwarded-Encrypted: i=1; AJvYcCUQEB2saCiMmkZt+RrGeYiULgZP1Z9ocgxKeLf2aErBBM8qRsklGOn1FPjq7rXwRudRJMMftKWJFqVXug==@lists.infradead.org X-Gm-Message-State: AOJu0YwoQU6lkfqRiGa/JXA3h1IYKbZLP7mE219yS2qceu5CVdbTLONx LYUN30ASFKpQf4nq23jLrgC/lM3qk74jJhUlP9cuUyFrbPsNiyeL1uSP+XuqS3A= X-Gm-Gg: ASbGncs34TMQCDiyp+t+PFvT+9AdSKJI8c9NnqCR6sw5Gq/KDVNqX4Lp4OFvmVFtK3U JMgOyjVqcz5cvIuApz8TYN099A72NG2BmiQe9yWBtFtJfEax4JGQyBYqxEeC0yJHX+zcb3VlHKC +ScD11XLMb7In9SbfGkXMlrqxbHty8Rpoe5ASco7Gc3uT3n2i0Z/FIY7uJqdNYhqE8F+Pd8uZxm Q5wclG9TdDQ2rJA2uFz+wXghqQf5dyGu0tPqJnNKFgWXJ/ykMYK/zIscfoBLV+PebEUh9cz X-Google-Smtp-Source: AGHT+IG1zW3hxpy+Kq8fzCpMMISmTOtVjpuR2qAspJNCFZIP6cE7KfkwMAc+/KGwUH9auJvPqtRDrg== X-Received: by 2002:a17:90a:d445:b0:2ee:7538:be70 with SMTP id 98e67ed59e1d1-2f28fa5be8bmr1161470a91.5.1734050001033; Thu, 12 Dec 2024 16:33:21 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:20 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:32:55 -0800 Subject: [PATCH v2 05/16] perf tools: sh: Support syscall headers MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-5-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=22290; i=charlie@rivosinc.com; h=from:subject:message-id; bh=dxt1Frl4l2cRfXvgV6wL7iUfPb4qmarGOzoaFFe0WQ0=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w76THdWp6hUhauszbL33R0Q/fxFxfE3UvwUeGh3xG 9gPcM7qKGVhEONgkBVTZOG51sDceke/7Kho2QSYOaxMIEMYuDgFYCJnehgZ/r+v23n1sF9A/cXy xccmGbw9eeHRVva9N2ZG5SdOr796Sp/hr5x3hJHmr9tiOT8rH57YcfFlmKbSxd4E+8qAfxZ2Fw5 NZgMA X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163322_170015_E0C4C0C0 X-CRM114-Status: GOOD ( 14.54 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org sh uses a syscall table, use that in perf instead of requiring libaudit. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 2 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/sh/entry/syscalls/Kbuild | 2 + .../perf/arch/sh/entry/syscalls/Makefile.syscalls | 4 + tools/perf/arch/sh/entry/syscalls/syscall.tbl | 472 +++++++++++++++++++++ tools/perf/arch/sh/include/syscall_table.h | 2 + tools/perf/check-headers.sh | 1 + 7 files changed, 483 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 3093cf90e76d3627e9ef842ea1a24dbeb6f56422..e7b7257f014e2e58130edf5312bf89d5f7681eef 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -36,7 +36,7 @@ ifneq ($(NO_SYSCALL_TABLE),1) endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 01a6cd630396204c9119b12bb1fe26b6133fa5d2..9ea1d7284fa7a161352121e904b933e34e07dc7f 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/sh/entry/syscalls/Kbuild b/tools/perf/arch/sh/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..11707c481a24ecf4e220e51eb1aca890fe929a13 --- /dev/null +++ b/tools/perf/arch/sh/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_32.h diff --git a/tools/perf/arch/sh/entry/syscalls/Makefile.syscalls b/tools/perf/arch/sh/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..25080390e4ed49ae56f314ad712007e674a9168e --- /dev/null +++ b/tools/perf/arch/sh/entry/syscalls/Makefile.syscalls @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += +syscalltbl = $(srctree)/tools/perf/arch/sh/entry/syscalls/syscall.tbl diff --git a/tools/perf/arch/sh/entry/syscalls/syscall.tbl b/tools/perf/arch/sh/entry/syscalls/syscall.tbl new file mode 100644 index 0000000000000000000000000000000000000000..c8cad33bf250ea110de37bd1407f5a43ec5e38f2 --- /dev/null +++ b/tools/perf/arch/sh/entry/syscalls/syscall.tbl @@ -0,0 +1,472 @@ +# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note +# +# system call numbers and entry vectors for sh +# +# The format is: +# +# +# The is always "common" for this file +# +0 common restart_syscall sys_restart_syscall +1 common exit sys_exit +2 common fork sys_fork +3 common read sys_read +4 common write sys_write +5 common open sys_open +6 common close sys_close +7 common waitpid sys_waitpid +8 common creat sys_creat +9 common link sys_link +10 common unlink sys_unlink +11 common execve sys_execve +12 common chdir sys_chdir +13 common time sys_time32 +14 common mknod sys_mknod +15 common chmod sys_chmod +16 common lchown sys_lchown16 +# 17 was break +18 common oldstat sys_stat +19 common lseek sys_lseek +20 common getpid sys_getpid +21 common mount sys_mount +22 common umount sys_oldumount +23 common setuid sys_setuid16 +24 common getuid sys_getuid16 +25 common stime sys_stime32 +26 common ptrace sys_ptrace +27 common alarm sys_alarm +28 common oldfstat sys_fstat +29 common pause sys_pause +30 common utime sys_utime32 +# 31 was stty +# 32 was gtty +33 common access sys_access +34 common nice sys_nice +# 35 was ftime +36 common sync sys_sync +37 common kill sys_kill +38 common rename sys_rename +39 common mkdir sys_mkdir +40 common rmdir sys_rmdir +41 common dup sys_dup +42 common pipe sys_sh_pipe +43 common times sys_times +# 44 was prof +45 common brk sys_brk +46 common setgid sys_setgid16 +47 common getgid sys_getgid16 +48 common signal sys_signal +49 common geteuid sys_geteuid16 +50 common getegid sys_getegid16 +51 common acct sys_acct +52 common umount2 sys_umount +# 53 was lock +54 common ioctl sys_ioctl +55 common fcntl sys_fcntl +# 56 was mpx +57 common setpgid sys_setpgid +# 58 was ulimit +# 59 was olduname +60 common umask sys_umask +61 common chroot sys_chroot +62 common ustat sys_ustat +63 common dup2 sys_dup2 +64 common getppid sys_getppid +65 common getpgrp sys_getpgrp +66 common setsid sys_setsid +67 common sigaction sys_sigaction +68 common sgetmask sys_sgetmask +69 common ssetmask sys_ssetmask +70 common setreuid sys_setreuid16 +71 common setregid sys_setregid16 +72 common sigsuspend sys_sigsuspend +73 common sigpending sys_sigpending +74 common sethostname sys_sethostname +75 common setrlimit sys_setrlimit +76 common getrlimit sys_old_getrlimit +77 common getrusage sys_getrusage +78 common gettimeofday sys_gettimeofday +79 common settimeofday sys_settimeofday +80 common getgroups sys_getgroups16 +81 common setgroups sys_setgroups16 +# 82 was select +83 common symlink sys_symlink +84 common oldlstat sys_lstat +85 common readlink sys_readlink +86 common uselib sys_uselib +87 common swapon sys_swapon +88 common reboot sys_reboot +89 common readdir sys_old_readdir +90 common mmap old_mmap +91 common munmap sys_munmap +92 common truncate sys_truncate +93 common ftruncate sys_ftruncate +94 common fchmod sys_fchmod +95 common fchown sys_fchown16 +96 common getpriority sys_getpriority +97 common setpriority sys_setpriority +# 98 was profil +99 common statfs sys_statfs +100 common fstatfs sys_fstatfs +# 101 was ioperm +102 common socketcall sys_socketcall +103 common syslog sys_syslog +104 common setitimer sys_setitimer +105 common getitimer sys_getitimer +106 common stat sys_newstat +107 common lstat sys_newlstat +108 common fstat sys_newfstat +109 common olduname sys_uname +# 110 was iopl +111 common vhangup sys_vhangup +# 112 was idle +# 113 was vm86old +114 common wait4 sys_wait4 +115 common swapoff sys_swapoff +116 common sysinfo sys_sysinfo +117 common ipc sys_ipc +118 common fsync sys_fsync +119 common sigreturn sys_sigreturn +120 common clone sys_clone +121 common setdomainname sys_setdomainname +122 common uname sys_newuname +123 common cacheflush sys_cacheflush +124 common adjtimex sys_adjtimex_time32 +125 common mprotect sys_mprotect +126 common sigprocmask sys_sigprocmask +# 127 was create_module +128 common init_module sys_init_module +129 common delete_module sys_delete_module +# 130 was get_kernel_syms +131 common quotactl sys_quotactl +132 common getpgid sys_getpgid +133 common fchdir sys_fchdir +134 common bdflush sys_ni_syscall +135 common sysfs sys_sysfs +136 common personality sys_personality +# 137 was afs_syscall +138 common setfsuid sys_setfsuid16 +139 common setfsgid sys_setfsgid16 +140 common _llseek sys_llseek +141 common getdents sys_getdents +142 common _newselect sys_select +143 common flock sys_flock +144 common msync sys_msync +145 common readv sys_readv +146 common writev sys_writev +147 common getsid sys_getsid +148 common fdatasync sys_fdatasync +149 common _sysctl sys_ni_syscall +150 common mlock sys_mlock +151 common munlock sys_munlock +152 common mlockall sys_mlockall +153 common munlockall sys_munlockall +154 common sched_setparam sys_sched_setparam +155 common sched_getparam sys_sched_getparam +156 common sched_setscheduler sys_sched_setscheduler +157 common sched_getscheduler sys_sched_getscheduler +158 common sched_yield sys_sched_yield +159 common sched_get_priority_max sys_sched_get_priority_max +160 common sched_get_priority_min sys_sched_get_priority_min +161 common sched_rr_get_interval sys_sched_rr_get_interval_time32 +162 common nanosleep sys_nanosleep_time32 +163 common mremap sys_mremap +164 common setresuid sys_setresuid16 +165 common getresuid sys_getresuid16 +# 166 was vm86 +# 167 was query_module +168 common poll sys_poll +169 common nfsservctl sys_ni_syscall +170 common setresgid sys_setresgid16 +171 common getresgid sys_getresgid16 +172 common prctl sys_prctl +173 common rt_sigreturn sys_rt_sigreturn +174 common rt_sigaction sys_rt_sigaction +175 common rt_sigprocmask sys_rt_sigprocmask +176 common rt_sigpending sys_rt_sigpending +177 common rt_sigtimedwait sys_rt_sigtimedwait_time32 +178 common rt_sigqueueinfo sys_rt_sigqueueinfo +179 common rt_sigsuspend sys_rt_sigsuspend +180 common pread64 sys_pread_wrapper +181 common pwrite64 sys_pwrite_wrapper +182 common chown sys_chown16 +183 common getcwd sys_getcwd +184 common capget sys_capget +185 common capset sys_capset +186 common sigaltstack sys_sigaltstack +187 common sendfile sys_sendfile +# 188 is reserved for getpmsg +# 189 is reserved for putpmsg +190 common vfork sys_vfork +191 common ugetrlimit sys_getrlimit +192 common mmap2 sys_mmap2 +193 common truncate64 sys_truncate64 +194 common ftruncate64 sys_ftruncate64 +195 common stat64 sys_stat64 +196 common lstat64 sys_lstat64 +197 common fstat64 sys_fstat64 +198 common lchown32 sys_lchown +199 common getuid32 sys_getuid +200 common getgid32 sys_getgid +201 common geteuid32 sys_geteuid +202 common getegid32 sys_getegid +203 common setreuid32 sys_setreuid +204 common setregid32 sys_setregid +205 common getgroups32 sys_getgroups +206 common setgroups32 sys_setgroups +207 common fchown32 sys_fchown +208 common setresuid32 sys_setresuid +209 common getresuid32 sys_getresuid +210 common setresgid32 sys_setresgid +211 common getresgid32 sys_getresgid +212 common chown32 sys_chown +213 common setuid32 sys_setuid +214 common setgid32 sys_setgid +215 common setfsuid32 sys_setfsuid +216 common setfsgid32 sys_setfsgid +217 common pivot_root sys_pivot_root +218 common mincore sys_mincore +219 common madvise sys_madvise +220 common getdents64 sys_getdents64 +221 common fcntl64 sys_fcntl64 +# 222 is reserved for tux +# 223 is unused +224 common gettid sys_gettid +225 common readahead sys_readahead +226 common setxattr sys_setxattr +227 common lsetxattr sys_lsetxattr +228 common fsetxattr sys_fsetxattr +229 common getxattr sys_getxattr +230 common lgetxattr sys_lgetxattr +231 common fgetxattr sys_fgetxattr +232 common listxattr sys_listxattr +233 common llistxattr sys_llistxattr +234 common flistxattr sys_flistxattr +235 common removexattr sys_removexattr +236 common lremovexattr sys_lremovexattr +237 common fremovexattr sys_fremovexattr +238 common tkill sys_tkill +239 common sendfile64 sys_sendfile64 +240 common futex sys_futex_time32 +241 common sched_setaffinity sys_sched_setaffinity +242 common sched_getaffinity sys_sched_getaffinity +# 243 is reserved for set_thread_area +# 244 is reserved for get_thread_area +245 common io_setup sys_io_setup +246 common io_destroy sys_io_destroy +247 common io_getevents sys_io_getevents_time32 +248 common io_submit sys_io_submit +249 common io_cancel sys_io_cancel +250 common fadvise64 sys_fadvise64 +# 251 is unused +252 common exit_group sys_exit_group +253 common lookup_dcookie sys_ni_syscall +254 common epoll_create sys_epoll_create +255 common epoll_ctl sys_epoll_ctl +256 common epoll_wait sys_epoll_wait +257 common remap_file_pages sys_remap_file_pages +258 common set_tid_address sys_set_tid_address +259 common timer_create sys_timer_create +260 common timer_settime sys_timer_settime32 +261 common timer_gettime sys_timer_gettime32 +262 common timer_getoverrun sys_timer_getoverrun +263 common timer_delete sys_timer_delete +264 common clock_settime sys_clock_settime32 +265 common clock_gettime sys_clock_gettime32 +266 common clock_getres sys_clock_getres_time32 +267 common clock_nanosleep sys_clock_nanosleep_time32 +268 common statfs64 sys_statfs64 +269 common fstatfs64 sys_fstatfs64 +270 common tgkill sys_tgkill +271 common utimes sys_utimes_time32 +272 common fadvise64_64 sys_fadvise64_64_wrapper +# 273 is reserved for vserver +274 common mbind sys_mbind +275 common get_mempolicy sys_get_mempolicy +276 common set_mempolicy sys_set_mempolicy +277 common mq_open sys_mq_open +278 common mq_unlink sys_mq_unlink +279 common mq_timedsend sys_mq_timedsend_time32 +280 common mq_timedreceive sys_mq_timedreceive_time32 +281 common mq_notify sys_mq_notify +282 common mq_getsetattr sys_mq_getsetattr +283 common kexec_load sys_kexec_load +284 common waitid sys_waitid +285 common add_key sys_add_key +286 common request_key sys_request_key +287 common keyctl sys_keyctl +288 common ioprio_set sys_ioprio_set +289 common ioprio_get sys_ioprio_get +290 common inotify_init sys_inotify_init +291 common inotify_add_watch sys_inotify_add_watch +292 common inotify_rm_watch sys_inotify_rm_watch +# 293 is unused +294 common migrate_pages sys_migrate_pages +295 common openat sys_openat +296 common mkdirat sys_mkdirat +297 common mknodat sys_mknodat +298 common fchownat sys_fchownat +299 common futimesat sys_futimesat_time32 +300 common fstatat64 sys_fstatat64 +301 common unlinkat sys_unlinkat +302 common renameat sys_renameat +303 common linkat sys_linkat +304 common symlinkat sys_symlinkat +305 common readlinkat sys_readlinkat +306 common fchmodat sys_fchmodat +307 common faccessat sys_faccessat +308 common pselect6 sys_pselect6_time32 +309 common ppoll sys_ppoll_time32 +310 common unshare sys_unshare +311 common set_robust_list sys_set_robust_list +312 common get_robust_list sys_get_robust_list +313 common splice sys_splice +314 common sync_file_range sys_sh_sync_file_range6 +315 common tee sys_tee +316 common vmsplice sys_vmsplice +317 common move_pages sys_move_pages +318 common getcpu sys_getcpu +319 common epoll_pwait sys_epoll_pwait +320 common utimensat sys_utimensat_time32 +321 common signalfd sys_signalfd +322 common timerfd_create sys_timerfd_create +323 common eventfd sys_eventfd +324 common fallocate sys_fallocate +325 common timerfd_settime sys_timerfd_settime32 +326 common timerfd_gettime sys_timerfd_gettime32 +327 common signalfd4 sys_signalfd4 +328 common eventfd2 sys_eventfd2 +329 common epoll_create1 sys_epoll_create1 +330 common dup3 sys_dup3 +331 common pipe2 sys_pipe2 +332 common inotify_init1 sys_inotify_init1 +333 common preadv sys_preadv +334 common pwritev sys_pwritev +335 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo +336 common perf_event_open sys_perf_event_open +337 common fanotify_init sys_fanotify_init +338 common fanotify_mark sys_fanotify_mark +339 common prlimit64 sys_prlimit64 +340 common socket sys_socket +341 common bind sys_bind +342 common connect sys_connect +343 common listen sys_listen +344 common accept sys_accept +345 common getsockname sys_getsockname +346 common getpeername sys_getpeername +347 common socketpair sys_socketpair +348 common send sys_send +349 common sendto sys_sendto +350 common recv sys_recv +351 common recvfrom sys_recvfrom +352 common shutdown sys_shutdown +353 common setsockopt sys_setsockopt +354 common getsockopt sys_getsockopt +355 common sendmsg sys_sendmsg +356 common recvmsg sys_recvmsg +357 common recvmmsg sys_recvmmsg_time32 +358 common accept4 sys_accept4 +359 common name_to_handle_at sys_name_to_handle_at +360 common open_by_handle_at sys_open_by_handle_at +361 common clock_adjtime sys_clock_adjtime32 +362 common syncfs sys_syncfs +363 common sendmmsg sys_sendmmsg +364 common setns sys_setns +365 common process_vm_readv sys_process_vm_readv +366 common process_vm_writev sys_process_vm_writev +367 common kcmp sys_kcmp +368 common finit_module sys_finit_module +369 common sched_getattr sys_sched_getattr +370 common sched_setattr sys_sched_setattr +371 common renameat2 sys_renameat2 +372 common seccomp sys_seccomp +373 common getrandom sys_getrandom +374 common memfd_create sys_memfd_create +375 common bpf sys_bpf +376 common execveat sys_execveat +377 common userfaultfd sys_userfaultfd +378 common membarrier sys_membarrier +379 common mlock2 sys_mlock2 +380 common copy_file_range sys_copy_file_range +381 common preadv2 sys_preadv2 +382 common pwritev2 sys_pwritev2 +383 common statx sys_statx +384 common pkey_mprotect sys_pkey_mprotect +385 common pkey_alloc sys_pkey_alloc +386 common pkey_free sys_pkey_free +387 common rseq sys_rseq +388 common sync_file_range2 sys_sync_file_range2 +# room for arch specific syscalls +393 common semget sys_semget +394 common semctl sys_semctl +395 common shmget sys_shmget +396 common shmctl sys_shmctl +397 common shmat sys_shmat +398 common shmdt sys_shmdt +399 common msgget sys_msgget +400 common msgsnd sys_msgsnd +401 common msgrcv sys_msgrcv +402 common msgctl sys_msgctl +403 common clock_gettime64 sys_clock_gettime +404 common clock_settime64 sys_clock_settime +405 common clock_adjtime64 sys_clock_adjtime +406 common clock_getres_time64 sys_clock_getres +407 common clock_nanosleep_time64 sys_clock_nanosleep +408 common timer_gettime64 sys_timer_gettime +409 common timer_settime64 sys_timer_settime +410 common timerfd_gettime64 sys_timerfd_gettime +411 common timerfd_settime64 sys_timerfd_settime +412 common utimensat_time64 sys_utimensat +413 common pselect6_time64 sys_pselect6 +414 common ppoll_time64 sys_ppoll +416 common io_pgetevents_time64 sys_io_pgetevents +417 common recvmmsg_time64 sys_recvmmsg +418 common mq_timedsend_time64 sys_mq_timedsend +419 common mq_timedreceive_time64 sys_mq_timedreceive +420 common semtimedop_time64 sys_semtimedop +421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait +422 common futex_time64 sys_futex +423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval +424 common pidfd_send_signal sys_pidfd_send_signal +425 common io_uring_setup sys_io_uring_setup +426 common io_uring_enter sys_io_uring_enter +427 common io_uring_register sys_io_uring_register +428 common open_tree sys_open_tree +429 common move_mount sys_move_mount +430 common fsopen sys_fsopen +431 common fsconfig sys_fsconfig +432 common fsmount sys_fsmount +433 common fspick sys_fspick +434 common pidfd_open sys_pidfd_open +# 435 reserved for clone3 +436 common close_range sys_close_range +437 common openat2 sys_openat2 +438 common pidfd_getfd sys_pidfd_getfd +439 common faccessat2 sys_faccessat2 +440 common process_madvise sys_process_madvise +441 common epoll_pwait2 sys_epoll_pwait2 +442 common mount_setattr sys_mount_setattr +443 common quotactl_fd sys_quotactl_fd +444 common landlock_create_ruleset sys_landlock_create_ruleset +445 common landlock_add_rule sys_landlock_add_rule +446 common landlock_restrict_self sys_landlock_restrict_self +# 447 reserved for memfd_secret +448 common process_mrelease sys_process_mrelease +449 common futex_waitv sys_futex_waitv +450 common set_mempolicy_home_node sys_set_mempolicy_home_node +451 common cachestat sys_cachestat +452 common fchmodat2 sys_fchmodat2 +453 common map_shadow_stack sys_map_shadow_stack +454 common futex_wake sys_futex_wake +455 common futex_wait sys_futex_wait +456 common futex_requeue sys_futex_requeue +457 common statmount sys_statmount +458 common listmount sys_listmount +459 common lsm_get_self_attr sys_lsm_get_self_attr +460 common lsm_set_self_attr sys_lsm_set_self_attr +461 common lsm_list_modules sys_lsm_list_modules +462 common mseal sys_mseal +463 common setxattrat sys_setxattrat +464 common getxattrat sys_getxattrat +465 common listxattrat sys_listxattrat +466 common removexattrat sys_removexattrat diff --git a/tools/perf/arch/sh/include/syscall_table.h b/tools/perf/arch/sh/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..4c942821662d95216765b176a84d5fc7974e1064 --- /dev/null +++ b/tools/perf/arch/sh/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index 542f3bee1501c751a831df460c4e585ab756c8fc..2f1b42bf337b3d601f0f2e792bd79413f46e583a 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -203,6 +203,7 @@ check_2 tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/s check_2 tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl check_2 tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl check_2 tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/arm/tools/syscall.tbl +check_2 tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/kernel/syscalls/syscall.tbl for i in "${BEAUTY_FILES[@]}" do From patchwork Fri Dec 13 00:32:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EAC87E7717F for ; Fri, 13 Dec 2024 00:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eymetAMG8umkhOl9XBzJDZFOYNgjh0DrVQThNGkJBg8=; b=oM4qPnigWhI5Cq 1nTy4uhL5wWsHLdvP1cYbKGAIMd94VyJ5ddwcUc7/8ZQyz1KnAYn+ywibWIjmzH6N8uSrECutK8lK hsvJRfZOztt0Ot52ocqZsc71OmP/bxw2uce45AfeSNwg2RgHq3WW0b4ahocozQNIfBCZu/PKEyhhH IaXpHArxGpZi768QaO2f8K6MIpSBeLLkDYwrmijEUPWuQGsv/EyGSBIrFWrDjFhYRFauF2jLvr8o7 3f5EWwvsPMDvqQkdcfA5R8VZ1X+Cxi6utU4a+y8SbSUDeUEqHHsjHnWvg8p1bIz7gFghI4Zz5/2tk gN07JBQSKHURvrDKxhxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLtib-00000002Jmo-1h0l; Fri, 13 Dec 2024 00:39:45 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcS-00000002I4A-1btZ for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:25 +0000 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2ee8e8e29f6so950530a91.0 for ; Thu, 12 Dec 2024 16:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050004; x=1734654804; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=nLxpdc9ePCAx8JhtREbSJ5K8tl2oNUPsh9aV4EULEKk=; b=sxeVaQXWJbUeAv/dK7/mAzeUc3NTjYYyRNro1yoQX5LmB7Cusdlkjfb2vOybC7j7Uc Z/djBzYRrAX4Oq0kW6OkMFjsEC4S9EPr4rTK5LuqFSXJ1Fey/wXjDlXelZByfP4+iCq+ rWSSbMvwxek/2wnYl9dxhnddxefYjY0P+QIzQogpf2csr+cFxhXHaKjErtTBQ2VqHfd3 N5ox9X+yQ16gu+DyN+nfR4BYsMoMr2SWUQ8HHDeQ8ApECeeODvzq9UX59C/iCn0CbFWp +IxypIONqAnS7M1nqIHfQNstQww3NMeDaz0Nn1x7JfN4jUeHduuzBpM/1CkW+tUWuaFG YTDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050004; x=1734654804; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nLxpdc9ePCAx8JhtREbSJ5K8tl2oNUPsh9aV4EULEKk=; b=trBvJopR0GlMfDq/6Cy11s9bpHWmR0JyZ3YlYTHGlYe+PNXp5X5Lx/v0HntYRO/Kfv mo3MIga4TlhJh06IHuovQq3XTVkYByLcQnkkQcBI0SHQBomLPmRkgA2azGhrwyP0seUF eHF5a1fB9lVodlNjvTbMGSvE78Z6u1ZY2ppjh3oWCI4piJfPwvhk5Me0OLN4JRdSnijm sol1+4Clq11DWNMTBvQGiDd3wd2ut35EOOF02CpjdP7wVtD5d117kg9c+WAUHDgN700h 24v6StEQH3JAmXymNf8QyPwFzfioeoHDCPQb2xGBprH1RLZ4ySo2Rpc6fb8FfactFpuD MIOw== X-Forwarded-Encrypted: i=1; AJvYcCUhF8bVNcMot1iCG5uZrY0uDCqAQwapVpIlUYTEayCT7q9B/bjrG2KDtvJ6kLGHesrQw92RHZSQNtZrTg==@lists.infradead.org X-Gm-Message-State: AOJu0YzxvXhjyx6voDrarl375nHS+Edjb4d8mQD+94CzzISWTjt9nxpN dkFNEtdYMXlEkkIYlP4nTuPMenctsp+dJH+ZDeD53pDNQBDFdSoeGl4jwBDzjaA= X-Gm-Gg: ASbGnctN6WiBQp2hOolWKbDiaBGd1PZmQDXjoyzXcDH2vj79ocmltFQy+BxYowGLDmS vbQEQ2v+iM/hcBFBW43vTF4bQOvnzSScnaigNpR9Bes5El0JKSz1WhselhWiW3qktqHHbmwSwJa ICcaDoCbu/b757LMoYiHR1bbWVAbBthQofTcnt+Ac1Yf14u5rEElKuHsWkin4Do8Fne36j+uVlN pUZ2e2sDgoibY7iXigbsv7HJcswSfBlQr6mpoC+654G0z9JL9djT7NqwWyRr8OSUHcfJgSf X-Google-Smtp-Source: AGHT+IGDGoVHOn46wHognJhGv9JIF/jE/fTgj/m8up4qtrzz8TbGPJCJ9236U4yt6r7E/9vCyr7C6A== X-Received: by 2002:a17:90b:3b8a:b0:2ee:d433:7c50 with SMTP id 98e67ed59e1d1-2f28ffa7e8dmr953638a91.23.1734050003748; Thu, 12 Dec 2024 16:33:23 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:22 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:32:56 -0800 Subject: [PATCH v2 06/16] perf tools: sparc: Support syscall headers MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-6-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=26733; i=charlie@rivosinc.com; h=from:subject:message-id; bh=kfBIlQFpMFit9Ep+rgdYy74M2QRz3LqkSJdsRs9+rFA=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w77Gem4vVjHtZrkPR826M+TUi1Lr9vHcfDtJfGL1D f/7pUIdpSwMYhwMsmKKLDzXGphb7+iXHRUtmwAzh5UJZAgDF6cATGT2L0aGFwe3zJsel7zi1X4z dv7LS/lu/UrTUk75U7tQwuuGfVzVbob/tX/0ZRJuL/wREpzAWyocos65xyYzXCxh674ak+U/v/Y zAgA= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163324_445089_C5AC9694 X-CRM114-Status: GOOD ( 14.81 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org sparc uses a syscall table, use that in perf instead of requiring libaudit. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 2 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/sparc/entry/syscalls/Kbuild | 3 + .../arch/sparc/entry/syscalls/Makefile.syscalls | 5 + tools/perf/arch/sparc/entry/syscalls/syscall.tbl | 514 +++++++++++++++++++++ tools/perf/arch/sparc/include/syscall_table.h | 8 + tools/perf/check-headers.sh | 1 + 7 files changed, 533 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index e7b7257f014e2e58130edf5312bf89d5f7681eef..ee67e39be17215847a2cc85e141938a77bac1b97 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -36,7 +36,7 @@ ifneq ($(NO_SYSCALL_TABLE),1) endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 9ea1d7284fa7a161352121e904b933e34e07dc7f..773f9d1913b02abf526054bcabbec9197fd86c28 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/sparc/entry/syscalls/Kbuild b/tools/perf/arch/sparc/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..84c6599b4ea6a160217a3496449b205f2263f0fb --- /dev/null +++ b/tools/perf/arch/sparc/entry/syscalls/Kbuild @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_32.h +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/sparc/entry/syscalls/Makefile.syscalls b/tools/perf/arch/sparc/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..212c1800b64477c615b8963176d873db5ccabe0c --- /dev/null +++ b/tools/perf/arch/sparc/entry/syscalls/Makefile.syscalls @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += +syscall_abis_64 += +syscalltbl = $(srctree)/tools/perf/arch/sparc/entry/syscalls/syscall.tbl diff --git a/tools/perf/arch/sparc/entry/syscalls/syscall.tbl b/tools/perf/arch/sparc/entry/syscalls/syscall.tbl new file mode 100644 index 0000000000000000000000000000000000000000..727f99d333b304b3db0711953a3d91ece18a28eb --- /dev/null +++ b/tools/perf/arch/sparc/entry/syscalls/syscall.tbl @@ -0,0 +1,514 @@ +# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note +# +# system call numbers and entry vectors for sparc +# +# The format is: +# +# +# The can be common, 64, or 32 for this file. +# +0 common restart_syscall sys_restart_syscall +1 32 exit sys_exit sparc_exit +1 64 exit sparc_exit +2 common fork sys_fork +3 common read sys_read +4 common write sys_write +5 common open sys_open compat_sys_open +6 common close sys_close +7 common wait4 sys_wait4 compat_sys_wait4 +8 common creat sys_creat +9 common link sys_link +10 common unlink sys_unlink +11 32 execv sunos_execv +11 64 execv sys_nis_syscall +12 common chdir sys_chdir +13 32 chown sys_chown16 +13 64 chown sys_chown +14 common mknod sys_mknod +15 common chmod sys_chmod +16 32 lchown sys_lchown16 +16 64 lchown sys_lchown +17 common brk sys_brk +18 common perfctr sys_nis_syscall +19 common lseek sys_lseek compat_sys_lseek +20 common getpid sys_getpid +21 common capget sys_capget +22 common capset sys_capset +23 32 setuid sys_setuid16 +23 64 setuid sys_setuid +24 32 getuid sys_getuid16 +24 64 getuid sys_getuid +25 common vmsplice sys_vmsplice +26 common ptrace sys_ptrace compat_sys_ptrace +27 common alarm sys_alarm +28 common sigaltstack sys_sigaltstack compat_sys_sigaltstack +29 32 pause sys_pause +29 64 pause sys_nis_syscall +30 32 utime sys_utime32 +30 64 utime sys_utime +31 32 lchown32 sys_lchown +32 32 fchown32 sys_fchown +33 common access sys_access +34 common nice sys_nice +35 32 chown32 sys_chown +36 common sync sys_sync +37 common kill sys_kill +38 common stat sys_newstat compat_sys_newstat +39 32 sendfile sys_sendfile compat_sys_sendfile +39 64 sendfile sys_sendfile64 +40 common lstat sys_newlstat compat_sys_newlstat +41 common dup sys_dup +42 common pipe sys_sparc_pipe +43 common times sys_times compat_sys_times +44 32 getuid32 sys_getuid +45 common umount2 sys_umount +46 32 setgid sys_setgid16 +46 64 setgid sys_setgid +47 32 getgid sys_getgid16 +47 64 getgid sys_getgid +48 common signal sys_signal +49 32 geteuid sys_geteuid16 +49 64 geteuid sys_geteuid +50 32 getegid sys_getegid16 +50 64 getegid sys_getegid +51 common acct sys_acct +52 64 memory_ordering sys_memory_ordering +53 32 getgid32 sys_getgid +54 common ioctl sys_ioctl compat_sys_ioctl +55 common reboot sys_reboot +56 32 mmap2 sys_mmap2 sys32_mmap2 +57 common symlink sys_symlink +58 common readlink sys_readlink +59 32 execve sys_execve sys32_execve +59 64 execve sys64_execve +60 common umask sys_umask +61 common chroot sys_chroot +62 common fstat sys_newfstat compat_sys_newfstat +63 common fstat64 sys_fstat64 compat_sys_fstat64 +64 common getpagesize sys_getpagesize +65 common msync sys_msync +66 common vfork sys_vfork +67 common pread64 sys_pread64 compat_sys_pread64 +68 common pwrite64 sys_pwrite64 compat_sys_pwrite64 +69 32 geteuid32 sys_geteuid +70 32 getegid32 sys_getegid +71 common mmap sys_mmap +72 32 setreuid32 sys_setreuid +73 32 munmap sys_munmap +73 64 munmap sys_64_munmap +74 common mprotect sys_mprotect +75 common madvise sys_madvise +76 common vhangup sys_vhangup +77 32 truncate64 sys_truncate64 compat_sys_truncate64 +78 common mincore sys_mincore +79 32 getgroups sys_getgroups16 +79 64 getgroups sys_getgroups +80 32 setgroups sys_setgroups16 +80 64 setgroups sys_setgroups +81 common getpgrp sys_getpgrp +82 32 setgroups32 sys_setgroups +83 common setitimer sys_setitimer compat_sys_setitimer +84 32 ftruncate64 sys_ftruncate64 compat_sys_ftruncate64 +85 common swapon sys_swapon +86 common getitimer sys_getitimer compat_sys_getitimer +87 32 setuid32 sys_setuid +88 common sethostname sys_sethostname +89 32 setgid32 sys_setgid +90 common dup2 sys_dup2 +91 32 setfsuid32 sys_setfsuid +92 common fcntl sys_fcntl compat_sys_fcntl +93 common select sys_select compat_sys_select +94 32 setfsgid32 sys_setfsgid +95 common fsync sys_fsync +96 common setpriority sys_setpriority +97 common socket sys_socket +98 common connect sys_connect +99 common accept sys_accept +100 common getpriority sys_getpriority +101 common rt_sigreturn sys_rt_sigreturn sys32_rt_sigreturn +102 common rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction +103 common rt_sigprocmask sys_rt_sigprocmask compat_sys_rt_sigprocmask +104 common rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending +105 32 rt_sigtimedwait sys_rt_sigtimedwait_time32 compat_sys_rt_sigtimedwait_time32 +105 64 rt_sigtimedwait sys_rt_sigtimedwait +106 common rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo +107 common rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend +108 32 setresuid32 sys_setresuid +108 64 setresuid sys_setresuid +109 32 getresuid32 sys_getresuid +109 64 getresuid sys_getresuid +110 32 setresgid32 sys_setresgid +110 64 setresgid sys_setresgid +111 32 getresgid32 sys_getresgid +111 64 getresgid sys_getresgid +112 32 setregid32 sys_setregid +113 common recvmsg sys_recvmsg compat_sys_recvmsg +114 common sendmsg sys_sendmsg compat_sys_sendmsg +115 32 getgroups32 sys_getgroups +116 common gettimeofday sys_gettimeofday compat_sys_gettimeofday +117 common getrusage sys_getrusage compat_sys_getrusage +118 common getsockopt sys_getsockopt sys_getsockopt +119 common getcwd sys_getcwd +120 common readv sys_readv +121 common writev sys_writev +122 common settimeofday sys_settimeofday compat_sys_settimeofday +123 32 fchown sys_fchown16 +123 64 fchown sys_fchown +124 common fchmod sys_fchmod +125 common recvfrom sys_recvfrom compat_sys_recvfrom +126 32 setreuid sys_setreuid16 +126 64 setreuid sys_setreuid +127 32 setregid sys_setregid16 +127 64 setregid sys_setregid +128 common rename sys_rename +129 common truncate sys_truncate compat_sys_truncate +130 common ftruncate sys_ftruncate compat_sys_ftruncate +131 common flock sys_flock +132 common lstat64 sys_lstat64 compat_sys_lstat64 +133 common sendto sys_sendto +134 common shutdown sys_shutdown +135 common socketpair sys_socketpair +136 common mkdir sys_mkdir +137 common rmdir sys_rmdir +138 32 utimes sys_utimes_time32 +138 64 utimes sys_utimes +139 common stat64 sys_stat64 compat_sys_stat64 +140 common sendfile64 sys_sendfile64 +141 common getpeername sys_getpeername +142 32 futex sys_futex_time32 +142 64 futex sys_futex +143 common gettid sys_gettid +144 common getrlimit sys_getrlimit compat_sys_getrlimit +145 common setrlimit sys_setrlimit compat_sys_setrlimit +146 common pivot_root sys_pivot_root +147 common prctl sys_prctl +148 common pciconfig_read sys_pciconfig_read +149 common pciconfig_write sys_pciconfig_write +150 common getsockname sys_getsockname +151 common inotify_init sys_inotify_init +152 common inotify_add_watch sys_inotify_add_watch +153 common poll sys_poll +154 common getdents64 sys_getdents64 +155 32 fcntl64 sys_fcntl64 compat_sys_fcntl64 +156 common inotify_rm_watch sys_inotify_rm_watch +157 common statfs sys_statfs compat_sys_statfs +158 common fstatfs sys_fstatfs compat_sys_fstatfs +159 common umount sys_oldumount +160 common sched_set_affinity sys_sched_setaffinity compat_sys_sched_setaffinity +161 common sched_get_affinity sys_sched_getaffinity compat_sys_sched_getaffinity +162 common getdomainname sys_getdomainname +163 common setdomainname sys_setdomainname +164 64 utrap_install sys_utrap_install +165 common quotactl sys_quotactl +166 common set_tid_address sys_set_tid_address +167 common mount sys_mount +168 common ustat sys_ustat compat_sys_ustat +169 common setxattr sys_setxattr +170 common lsetxattr sys_lsetxattr +171 common fsetxattr sys_fsetxattr +172 common getxattr sys_getxattr +173 common lgetxattr sys_lgetxattr +174 common getdents sys_getdents compat_sys_getdents +175 common setsid sys_setsid +176 common fchdir sys_fchdir +177 common fgetxattr sys_fgetxattr +178 common listxattr sys_listxattr +179 common llistxattr sys_llistxattr +180 common flistxattr sys_flistxattr +181 common removexattr sys_removexattr +182 common lremovexattr sys_lremovexattr +183 32 sigpending sys_sigpending compat_sys_sigpending +183 64 sigpending sys_nis_syscall +184 common query_module sys_ni_syscall +185 common setpgid sys_setpgid +186 common fremovexattr sys_fremovexattr +187 common tkill sys_tkill +188 32 exit_group sys_exit_group sparc_exit_group +188 64 exit_group sparc_exit_group +189 common uname sys_newuname +190 common init_module sys_init_module +191 32 personality sys_personality sys_sparc64_personality +191 64 personality sys_sparc64_personality +192 32 remap_file_pages sys_sparc_remap_file_pages sys_remap_file_pages +192 64 remap_file_pages sys_remap_file_pages +193 common epoll_create sys_epoll_create +194 common epoll_ctl sys_epoll_ctl +195 common epoll_wait sys_epoll_wait +196 common ioprio_set sys_ioprio_set +197 common getppid sys_getppid +198 32 sigaction sys_sparc_sigaction compat_sys_sparc_sigaction +198 64 sigaction sys_nis_syscall +199 common sgetmask sys_sgetmask +200 common ssetmask sys_ssetmask +201 32 sigsuspend sys_sigsuspend +201 64 sigsuspend sys_nis_syscall +202 common oldlstat sys_newlstat compat_sys_newlstat +203 common uselib sys_uselib +204 32 readdir sys_old_readdir compat_sys_old_readdir +204 64 readdir sys_nis_syscall +205 common readahead sys_readahead compat_sys_readahead +206 common socketcall sys_socketcall compat_sys_socketcall +207 common syslog sys_syslog +208 common lookup_dcookie sys_ni_syscall +209 common fadvise64 sys_fadvise64 compat_sys_fadvise64 +210 common fadvise64_64 sys_fadvise64_64 compat_sys_fadvise64_64 +211 common tgkill sys_tgkill +212 common waitpid sys_waitpid +213 common swapoff sys_swapoff +214 common sysinfo sys_sysinfo compat_sys_sysinfo +215 32 ipc sys_ipc compat_sys_ipc +215 64 ipc sys_sparc_ipc +216 32 sigreturn sys_sigreturn sys32_sigreturn +216 64 sigreturn sys_nis_syscall +217 common clone sys_clone +218 common ioprio_get sys_ioprio_get +219 32 adjtimex sys_adjtimex_time32 +219 64 adjtimex sys_sparc_adjtimex +220 32 sigprocmask sys_sigprocmask compat_sys_sigprocmask +220 64 sigprocmask sys_nis_syscall +221 common create_module sys_ni_syscall +222 common delete_module sys_delete_module +223 common get_kernel_syms sys_ni_syscall +224 common getpgid sys_getpgid +225 common bdflush sys_ni_syscall +226 common sysfs sys_sysfs +227 common afs_syscall sys_nis_syscall +228 common setfsuid sys_setfsuid16 +229 common setfsgid sys_setfsgid16 +230 common _newselect sys_select compat_sys_select +231 32 time sys_time32 +232 common splice sys_splice +233 32 stime sys_stime32 +233 64 stime sys_stime +234 common statfs64 sys_statfs64 compat_sys_statfs64 +235 common fstatfs64 sys_fstatfs64 compat_sys_fstatfs64 +236 common _llseek sys_llseek +237 common mlock sys_mlock +238 common munlock sys_munlock +239 common mlockall sys_mlockall +240 common munlockall sys_munlockall +241 common sched_setparam sys_sched_setparam +242 common sched_getparam sys_sched_getparam +243 common sched_setscheduler sys_sched_setscheduler +244 common sched_getscheduler sys_sched_getscheduler +245 common sched_yield sys_sched_yield +246 common sched_get_priority_max sys_sched_get_priority_max +247 common sched_get_priority_min sys_sched_get_priority_min +248 32 sched_rr_get_interval sys_sched_rr_get_interval_time32 +248 64 sched_rr_get_interval sys_sched_rr_get_interval +249 32 nanosleep sys_nanosleep_time32 +249 64 nanosleep sys_nanosleep +250 32 mremap sys_mremap +250 64 mremap sys_64_mremap +251 common _sysctl sys_ni_syscall +252 common getsid sys_getsid +253 common fdatasync sys_fdatasync +254 32 nfsservctl sys_ni_syscall sys_nis_syscall +254 64 nfsservctl sys_nis_syscall +255 common sync_file_range sys_sync_file_range compat_sys_sync_file_range +256 32 clock_settime sys_clock_settime32 +256 64 clock_settime sys_clock_settime +257 32 clock_gettime sys_clock_gettime32 +257 64 clock_gettime sys_clock_gettime +258 32 clock_getres sys_clock_getres_time32 +258 64 clock_getres sys_clock_getres +259 32 clock_nanosleep sys_clock_nanosleep_time32 +259 64 clock_nanosleep sys_clock_nanosleep +260 common sched_getaffinity sys_sched_getaffinity compat_sys_sched_getaffinity +261 common sched_setaffinity sys_sched_setaffinity compat_sys_sched_setaffinity +262 32 timer_settime sys_timer_settime32 +262 64 timer_settime sys_timer_settime +263 32 timer_gettime sys_timer_gettime32 +263 64 timer_gettime sys_timer_gettime +264 common timer_getoverrun sys_timer_getoverrun +265 common timer_delete sys_timer_delete +266 common timer_create sys_timer_create compat_sys_timer_create +# 267 was vserver +267 common vserver sys_nis_syscall +268 common io_setup sys_io_setup compat_sys_io_setup +269 common io_destroy sys_io_destroy +270 common io_submit sys_io_submit compat_sys_io_submit +271 common io_cancel sys_io_cancel +272 32 io_getevents sys_io_getevents_time32 +272 64 io_getevents sys_io_getevents +273 common mq_open sys_mq_open compat_sys_mq_open +274 common mq_unlink sys_mq_unlink +275 32 mq_timedsend sys_mq_timedsend_time32 +275 64 mq_timedsend sys_mq_timedsend +276 32 mq_timedreceive sys_mq_timedreceive_time32 +276 64 mq_timedreceive sys_mq_timedreceive +277 common mq_notify sys_mq_notify compat_sys_mq_notify +278 common mq_getsetattr sys_mq_getsetattr compat_sys_mq_getsetattr +279 common waitid sys_waitid compat_sys_waitid +280 common tee sys_tee +281 common add_key sys_add_key +282 common request_key sys_request_key +283 common keyctl sys_keyctl compat_sys_keyctl +284 common openat sys_openat compat_sys_openat +285 common mkdirat sys_mkdirat +286 common mknodat sys_mknodat +287 common fchownat sys_fchownat +288 32 futimesat sys_futimesat_time32 +288 64 futimesat sys_futimesat +289 common fstatat64 sys_fstatat64 compat_sys_fstatat64 +290 common unlinkat sys_unlinkat +291 common renameat sys_renameat +292 common linkat sys_linkat +293 common symlinkat sys_symlinkat +294 common readlinkat sys_readlinkat +295 common fchmodat sys_fchmodat +296 common faccessat sys_faccessat +297 32 pselect6 sys_pselect6_time32 compat_sys_pselect6_time32 +297 64 pselect6 sys_pselect6 +298 32 ppoll sys_ppoll_time32 compat_sys_ppoll_time32 +298 64 ppoll sys_ppoll +299 common unshare sys_unshare +300 common set_robust_list sys_set_robust_list compat_sys_set_robust_list +301 common get_robust_list sys_get_robust_list compat_sys_get_robust_list +302 common migrate_pages sys_migrate_pages +303 common mbind sys_mbind +304 common get_mempolicy sys_get_mempolicy +305 common set_mempolicy sys_set_mempolicy +306 common kexec_load sys_kexec_load compat_sys_kexec_load +307 common move_pages sys_move_pages +308 common getcpu sys_getcpu +309 common epoll_pwait sys_epoll_pwait compat_sys_epoll_pwait +310 32 utimensat sys_utimensat_time32 +310 64 utimensat sys_utimensat +311 common signalfd sys_signalfd compat_sys_signalfd +312 common timerfd_create sys_timerfd_create +313 common eventfd sys_eventfd +314 common fallocate sys_fallocate compat_sys_fallocate +315 32 timerfd_settime sys_timerfd_settime32 +315 64 timerfd_settime sys_timerfd_settime +316 32 timerfd_gettime sys_timerfd_gettime32 +316 64 timerfd_gettime sys_timerfd_gettime +317 common signalfd4 sys_signalfd4 compat_sys_signalfd4 +318 common eventfd2 sys_eventfd2 +319 common epoll_create1 sys_epoll_create1 +320 common dup3 sys_dup3 +321 common pipe2 sys_pipe2 +322 common inotify_init1 sys_inotify_init1 +323 common accept4 sys_accept4 +324 common preadv sys_preadv compat_sys_preadv +325 common pwritev sys_pwritev compat_sys_pwritev +326 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo +327 common perf_event_open sys_perf_event_open +328 32 recvmmsg sys_recvmmsg_time32 compat_sys_recvmmsg_time32 +328 64 recvmmsg sys_recvmmsg +329 common fanotify_init sys_fanotify_init +330 common fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark +331 common prlimit64 sys_prlimit64 +332 common name_to_handle_at sys_name_to_handle_at +333 common open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at +334 32 clock_adjtime sys_clock_adjtime32 +334 64 clock_adjtime sys_sparc_clock_adjtime +335 common syncfs sys_syncfs +336 common sendmmsg sys_sendmmsg compat_sys_sendmmsg +337 common setns sys_setns +338 common process_vm_readv sys_process_vm_readv +339 common process_vm_writev sys_process_vm_writev +340 32 kern_features sys_ni_syscall sys_kern_features +340 64 kern_features sys_kern_features +341 common kcmp sys_kcmp +342 common finit_module sys_finit_module +343 common sched_setattr sys_sched_setattr +344 common sched_getattr sys_sched_getattr +345 common renameat2 sys_renameat2 +346 common seccomp sys_seccomp +347 common getrandom sys_getrandom +348 common memfd_create sys_memfd_create +349 common bpf sys_bpf +350 32 execveat sys_execveat sys32_execveat +350 64 execveat sys64_execveat +351 common membarrier sys_membarrier +352 common userfaultfd sys_userfaultfd +353 common bind sys_bind +354 common listen sys_listen +355 common setsockopt sys_setsockopt sys_setsockopt +356 common mlock2 sys_mlock2 +357 common copy_file_range sys_copy_file_range +358 common preadv2 sys_preadv2 compat_sys_preadv2 +359 common pwritev2 sys_pwritev2 compat_sys_pwritev2 +360 common statx sys_statx +361 32 io_pgetevents sys_io_pgetevents_time32 compat_sys_io_pgetevents +361 64 io_pgetevents sys_io_pgetevents +362 common pkey_mprotect sys_pkey_mprotect +363 common pkey_alloc sys_pkey_alloc +364 common pkey_free sys_pkey_free +365 common rseq sys_rseq +# room for arch specific syscalls +392 64 semtimedop sys_semtimedop +393 common semget sys_semget +394 common semctl sys_semctl compat_sys_semctl +395 common shmget sys_shmget +396 common shmctl sys_shmctl compat_sys_shmctl +397 common shmat sys_shmat compat_sys_shmat +398 common shmdt sys_shmdt +399 common msgget sys_msgget +400 common msgsnd sys_msgsnd compat_sys_msgsnd +401 common msgrcv sys_msgrcv compat_sys_msgrcv +402 common msgctl sys_msgctl compat_sys_msgctl +403 32 clock_gettime64 sys_clock_gettime sys_clock_gettime +404 32 clock_settime64 sys_clock_settime sys_clock_settime +405 32 clock_adjtime64 sys_clock_adjtime sys_clock_adjtime +406 32 clock_getres_time64 sys_clock_getres sys_clock_getres +407 32 clock_nanosleep_time64 sys_clock_nanosleep sys_clock_nanosleep +408 32 timer_gettime64 sys_timer_gettime sys_timer_gettime +409 32 timer_settime64 sys_timer_settime sys_timer_settime +410 32 timerfd_gettime64 sys_timerfd_gettime sys_timerfd_gettime +411 32 timerfd_settime64 sys_timerfd_settime sys_timerfd_settime +412 32 utimensat_time64 sys_utimensat sys_utimensat +413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 +414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64 +416 32 io_pgetevents_time64 sys_io_pgetevents compat_sys_io_pgetevents_time64 +417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 +418 32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend +419 32 mq_timedreceive_time64 sys_mq_timedreceive sys_mq_timedreceive +420 32 semtimedop_time64 sys_semtimedop sys_semtimedop +421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 +422 32 futex_time64 sys_futex sys_futex +423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval +424 common pidfd_send_signal sys_pidfd_send_signal +425 common io_uring_setup sys_io_uring_setup +426 common io_uring_enter sys_io_uring_enter +427 common io_uring_register sys_io_uring_register +428 common open_tree sys_open_tree +429 common move_mount sys_move_mount +430 common fsopen sys_fsopen +431 common fsconfig sys_fsconfig +432 common fsmount sys_fsmount +433 common fspick sys_fspick +434 common pidfd_open sys_pidfd_open +# 435 reserved for clone3 +436 common close_range sys_close_range +437 common openat2 sys_openat2 +438 common pidfd_getfd sys_pidfd_getfd +439 common faccessat2 sys_faccessat2 +440 common process_madvise sys_process_madvise +441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 +442 common mount_setattr sys_mount_setattr +443 common quotactl_fd sys_quotactl_fd +444 common landlock_create_ruleset sys_landlock_create_ruleset +445 common landlock_add_rule sys_landlock_add_rule +446 common landlock_restrict_self sys_landlock_restrict_self +# 447 reserved for memfd_secret +448 common process_mrelease sys_process_mrelease +449 common futex_waitv sys_futex_waitv +450 common set_mempolicy_home_node sys_set_mempolicy_home_node +451 common cachestat sys_cachestat +452 common fchmodat2 sys_fchmodat2 +453 common map_shadow_stack sys_map_shadow_stack +454 common futex_wake sys_futex_wake +455 common futex_wait sys_futex_wait +456 common futex_requeue sys_futex_requeue +457 common statmount sys_statmount +458 common listmount sys_listmount +459 common lsm_get_self_attr sys_lsm_get_self_attr +460 common lsm_set_self_attr sys_lsm_set_self_attr +461 common lsm_list_modules sys_lsm_list_modules +462 common mseal sys_mseal +463 common setxattrat sys_setxattrat +464 common getxattrat sys_getxattrat +465 common listxattrat sys_listxattrat +466 common removexattrat sys_removexattrat diff --git a/tools/perf/arch/sparc/include/syscall_table.h b/tools/perf/arch/sparc/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..7ff51b783000d727ec48be960730b81ecdb05575 --- /dev/null +++ b/tools/perf/arch/sparc/include/syscall_table.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include + +#if __BITS_PER_LONG == 64 +#include +#else +#include +#endif diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index 2f1b42bf337b3d601f0f2e792bd79413f46e583a..99a278a3f1b5bf44132c817ed1f2623a232d3dc5 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -204,6 +204,7 @@ check_2 tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscall check_2 tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl check_2 tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/arm/tools/syscall.tbl check_2 tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/kernel/syscalls/syscall.tbl +check_2 tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/sparc/kernel/syscalls/syscall.tbl for i in "${BEAUTY_FILES[@]}" do From patchwork Fri Dec 13 00:32:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1A24E7717F for ; Fri, 13 Dec 2024 00:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NVhHfOmx2wqakA7ZB1Q2EKJPFH16W/hsEylqmPRSSz0=; b=tugIVYNg2+Kx1L TpGlUNQbRc2ec6hCN7XPot5zm12xfzwNmVXtc5V0Df2t/WjXdhsRN2rYTlJRRyN7eTf+oOanKEO38 a99kJCudNXESRgOpNqthfMgXzboS12XOenivQ46gbg9iWzsGyFbNLG+RAG6Jahr8acFjJd5oCqjfU hxoxqtT+HmmBRyUQQrBSibjZg7Jf9SZdbUbzgoa03OSD/SdhzXvjMDMx1HRdqTTbUAdDelJi1Heks jugBNy51WU91QiVrk7NRVqPSPk3Nd8PGVazsjRg9R0VMiYgJY1zPRnS6vI18fq9qvOfQANsqTvpIp nuIGGXyALwdC550zUBmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLtje-00000002K4Z-2ek9; Fri, 13 Dec 2024 00:40:50 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcU-00000002I5z-3uqe for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:28 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2ef748105deso867127a91.1 for ; Thu, 12 Dec 2024 16:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050006; x=1734654806; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yktWQsS3VyGMkSE7oM25NtivsCw2LCE7DYhxNwduxeU=; b=m5ls38rkMd52BuKjSTd/L+3Pur10i4T9pz8gSSSKkw536qKKbvJkyLLk4UHdTzVCVL o3jOaFxEJM8uYUl39AwoWRLyDOzAgXV80ejpIMoyGVDPWrPiscVxK56f34+YcO7gMxd/ af2Neapg37xFs52z/csLBZOZ9MvGS0D8V4XMfI2mKG8PqWP63DE7G2GrggXzwnsMN/Th +krYjAYIehUdecVA2edIVKyktvGJH5wBBVoFlDbQq1nb8tDN7dgLbX4NNepc/dwOkw/x RaQ6a76U77Yn6jWGt+UKbIF1LINYyFjYYvuRHnBLIa0FUM+xcgg9YS6iXzaDGsThyJeW rX1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050006; x=1734654806; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yktWQsS3VyGMkSE7oM25NtivsCw2LCE7DYhxNwduxeU=; b=V+EUUhvfVMYxib7040QEJw59LlxC7fj8XuGZnV/ol8fQjpaJTDBIN3YiSlIeJiLq3V 8Kur8LSkY1PnonqwOCsU4ziHjKsc8A/o32EnLiRA0e/KK9SeojAXRT57kxX6FP/15LRK ZUYGeG3y/wrlD0xkF6FcvBfTyR7t4GPQD1BozUGDukpNVPeRz/+jHdFvr9BdCYXCpQpS hqwHT29+90rcNkGcFw6JB5gkgPi9eufBIAYKtnKp9CoRwi89lMEgtiajUrQocqzgJtgC OAujxJFq4AZp4/bq/VeOzKdiqPuTrzBzRAigZtOZsU5sIPF1kyYq7MpzgIwbVp89auH5 GiRw== X-Forwarded-Encrypted: i=1; AJvYcCWZvFUOzRWgBPBk1UbLYyiZyyhnj4PmkQ7UyEzmUZJdnRBn51kvK+Lc/0+XIlC1RuDsPhi6zH+U0tb9Qw==@lists.infradead.org X-Gm-Message-State: AOJu0Yw5kUld3KNLTYzZrM1yvhm9UO4isgJB1uT96oxOUP9nSbpKwqKY oXmdWNoFNX0b4IK4HXcRTOu7vEyQ+oTl0XUUsaNkzwBWY/i8CYY96f0gR8xAyp0= X-Gm-Gg: ASbGnctOC+R4Gvjwcs6aZTXcKVigPOP75pjmPwuzFY/XIueTGiCS5klIJBuGxBMd6Jf mN9MQOuCeZGjf9ENT9KpicBnQ6c1L19x+q+NYy5OrjD7WavUQU6Ql8X5VcqnZyr9P6i8PHS52wi 5HdnFg5s106XIYUnagISKji7ozCKB8Z2LxsZR69xc+1MFxYNLsTIq5ftKf3TZRMKbj9BFi13mD1 xKu07QvbOnPGtG7vJq3OCUOKEb4NlOgFzdFNJJGZYGbgu/lsFXyBm4IfMlclgjlOBvhulPV X-Google-Smtp-Source: AGHT+IFrm8sS1hWmCXxEkC7U+dAs2T0sT/L2wrXqLG3+IZ91vhNkk1Oq4eKvs+OppHYN7tC4Gu+7xQ== X-Received: by 2002:a17:90b:2b45:b0:2ee:c457:bf83 with SMTP id 98e67ed59e1d1-2f28fd6f852mr1082614a91.19.1734050006317; Thu, 12 Dec 2024 16:33:26 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:25 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:32:57 -0800 Subject: [PATCH v2 07/16] perf tools: xtensa: Support syscall header MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-7-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=21454; i=charlie@rivosinc.com; h=from:subject:message-id; bh=+ANuxQtpXOkmYhVa/IicI6rEqDLhvVcELktLu8Heytk=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w75NR3exLZsu9/h2+r4X2761sLqaKrF2LhE/tlg32 /74suM2HaUsDGIcDLJiiiw81xqYW+/olx0VLZsAM4eVCWQIAxenAEzEcxnD/+KyfF650om65650 T8stlag6Wx0t2GrwRJDxxM67ExsL5zIybHdMTXx8rtnqwrUqiblCeQv+/tP60eZ99WTQV8F3cxJ l+QE= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163327_007766_B01C78A1 X-CRM114-Status: GOOD ( 15.02 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org xtensa uses a syscall table, use that in perf instead of requiring libaudit. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 2 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/xtensa/entry/syscalls/Kbuild | 2 + .../arch/xtensa/entry/syscalls/Makefile.syscalls | 4 + tools/perf/arch/xtensa/entry/syscalls/syscall.tbl | 439 +++++++++++++++++++++ tools/perf/arch/xtensa/include/syscall_table.h | 2 + tools/perf/check-headers.sh | 1 + 7 files changed, 450 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index ee67e39be17215847a2cc85e141938a77bac1b97..9348c1e72bf00f43faf1c9aadab171236e6c3621 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -36,7 +36,7 @@ ifneq ($(NO_SYSCALL_TABLE),1) endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 773f9d1913b02abf526054bcabbec9197fd86c28..c7e1c6b7f8d97dddf07eab122a169b379ec43a19 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/xtensa/entry/syscalls/Kbuild b/tools/perf/arch/xtensa/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..11707c481a24ecf4e220e51eb1aca890fe929a13 --- /dev/null +++ b/tools/perf/arch/xtensa/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_32.h diff --git a/tools/perf/arch/xtensa/entry/syscalls/Makefile.syscalls b/tools/perf/arch/xtensa/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..d4aa2358460c13945a8299b6513c93d35a5c5ea4 --- /dev/null +++ b/tools/perf/arch/xtensa/entry/syscalls/Makefile.syscalls @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += +syscalltbl = $(srctree)/tools/perf/arch/xtensa/entry/syscalls/syscall.tbl diff --git a/tools/perf/arch/xtensa/entry/syscalls/syscall.tbl b/tools/perf/arch/xtensa/entry/syscalls/syscall.tbl new file mode 100644 index 0000000000000000000000000000000000000000..37effc1b134eea061f2c350c1d68b4436b65a4dd --- /dev/null +++ b/tools/perf/arch/xtensa/entry/syscalls/syscall.tbl @@ -0,0 +1,439 @@ +# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note +# +# system call numbers and entry vectors for xtensa +# +# The format is: +# +# +# The is always "common" for this file +# +0 common spill sys_ni_syscall +1 common xtensa sys_ni_syscall +2 common available4 sys_ni_syscall +3 common available5 sys_ni_syscall +4 common available6 sys_ni_syscall +5 common available7 sys_ni_syscall +6 common available8 sys_ni_syscall +7 common available9 sys_ni_syscall +# File Operations +8 common open sys_open +9 common close sys_close +10 common dup sys_dup +11 common dup2 sys_dup2 +12 common read sys_read +13 common write sys_write +14 common select sys_select +15 common lseek sys_lseek +16 common poll sys_poll +17 common _llseek sys_llseek +18 common epoll_wait sys_epoll_wait +19 common epoll_ctl sys_epoll_ctl +20 common epoll_create sys_epoll_create +21 common creat sys_creat +22 common truncate sys_truncate +23 common ftruncate sys_ftruncate +24 common readv sys_readv +25 common writev sys_writev +26 common fsync sys_fsync +27 common fdatasync sys_fdatasync +28 common truncate64 sys_truncate64 +29 common ftruncate64 sys_ftruncate64 +30 common pread64 sys_pread64 +31 common pwrite64 sys_pwrite64 +32 common link sys_link +33 common rename sys_rename +34 common symlink sys_symlink +35 common readlink sys_readlink +36 common mknod sys_mknod +37 common pipe sys_pipe +38 common unlink sys_unlink +39 common rmdir sys_rmdir +40 common mkdir sys_mkdir +41 common chdir sys_chdir +42 common fchdir sys_fchdir +43 common getcwd sys_getcwd +44 common chmod sys_chmod +45 common chown sys_chown +46 common stat sys_newstat +47 common stat64 sys_stat64 +48 common lchown sys_lchown +49 common lstat sys_newlstat +50 common lstat64 sys_lstat64 +51 common available51 sys_ni_syscall +52 common fchmod sys_fchmod +53 common fchown sys_fchown +54 common fstat sys_newfstat +55 common fstat64 sys_fstat64 +56 common flock sys_flock +57 common access sys_access +58 common umask sys_umask +59 common getdents sys_getdents +60 common getdents64 sys_getdents64 +61 common fcntl64 sys_fcntl64 +62 common fallocate sys_fallocate +63 common fadvise64_64 xtensa_fadvise64_64 +64 common utime sys_utime32 +65 common utimes sys_utimes_time32 +66 common ioctl sys_ioctl +67 common fcntl sys_fcntl +68 common setxattr sys_setxattr +69 common getxattr sys_getxattr +70 common listxattr sys_listxattr +71 common removexattr sys_removexattr +72 common lsetxattr sys_lsetxattr +73 common lgetxattr sys_lgetxattr +74 common llistxattr sys_llistxattr +75 common lremovexattr sys_lremovexattr +76 common fsetxattr sys_fsetxattr +77 common fgetxattr sys_fgetxattr +78 common flistxattr sys_flistxattr +79 common fremovexattr sys_fremovexattr +# File Map / Shared Memory Operations +80 common mmap2 sys_mmap_pgoff +81 common munmap sys_munmap +82 common mprotect sys_mprotect +83 common brk sys_brk +84 common mlock sys_mlock +85 common munlock sys_munlock +86 common mlockall sys_mlockall +87 common munlockall sys_munlockall +88 common mremap sys_mremap +89 common msync sys_msync +90 common mincore sys_mincore +91 common madvise sys_madvise +92 common shmget sys_shmget +93 common shmat xtensa_shmat +94 common shmctl sys_old_shmctl +95 common shmdt sys_shmdt +# Socket Operations +96 common socket sys_socket +97 common setsockopt sys_setsockopt +98 common getsockopt sys_getsockopt +99 common shutdown sys_shutdown +100 common bind sys_bind +101 common connect sys_connect +102 common listen sys_listen +103 common accept sys_accept +104 common getsockname sys_getsockname +105 common getpeername sys_getpeername +106 common sendmsg sys_sendmsg +107 common recvmsg sys_recvmsg +108 common send sys_send +109 common recv sys_recv +110 common sendto sys_sendto +111 common recvfrom sys_recvfrom +112 common socketpair sys_socketpair +113 common sendfile sys_sendfile +114 common sendfile64 sys_sendfile64 +115 common sendmmsg sys_sendmmsg +# Process Operations +116 common clone sys_clone +117 common execve sys_execve +118 common exit sys_exit +119 common exit_group sys_exit_group +120 common getpid sys_getpid +121 common wait4 sys_wait4 +122 common waitid sys_waitid +123 common kill sys_kill +124 common tkill sys_tkill +125 common tgkill sys_tgkill +126 common set_tid_address sys_set_tid_address +127 common gettid sys_gettid +128 common setsid sys_setsid +129 common getsid sys_getsid +130 common prctl sys_prctl +131 common personality sys_personality +132 common getpriority sys_getpriority +133 common setpriority sys_setpriority +134 common setitimer sys_setitimer +135 common getitimer sys_getitimer +136 common setuid sys_setuid +137 common getuid sys_getuid +138 common setgid sys_setgid +139 common getgid sys_getgid +140 common geteuid sys_geteuid +141 common getegid sys_getegid +142 common setreuid sys_setreuid +143 common setregid sys_setregid +144 common setresuid sys_setresuid +145 common getresuid sys_getresuid +146 common setresgid sys_setresgid +147 common getresgid sys_getresgid +148 common setpgid sys_setpgid +149 common getpgid sys_getpgid +150 common getppid sys_getppid +151 common getpgrp sys_getpgrp +# 152 was set_thread_area +152 common reserved152 sys_ni_syscall +# 153 was get_thread_area +153 common reserved153 sys_ni_syscall +154 common times sys_times +155 common acct sys_acct +156 common sched_setaffinity sys_sched_setaffinity +157 common sched_getaffinity sys_sched_getaffinity +158 common capget sys_capget +159 common capset sys_capset +160 common ptrace sys_ptrace +161 common semtimedop sys_semtimedop_time32 +162 common semget sys_semget +163 common semop sys_semop +164 common semctl sys_old_semctl +165 common available165 sys_ni_syscall +166 common msgget sys_msgget +167 common msgsnd sys_msgsnd +168 common msgrcv sys_msgrcv +169 common msgctl sys_old_msgctl +170 common available170 sys_ni_syscall +# File System +171 common umount2 sys_umount +172 common mount sys_mount +173 common swapon sys_swapon +174 common chroot sys_chroot +175 common pivot_root sys_pivot_root +176 common umount sys_oldumount +177 common swapoff sys_swapoff +178 common sync sys_sync +179 common syncfs sys_syncfs +180 common setfsuid sys_setfsuid +181 common setfsgid sys_setfsgid +182 common sysfs sys_sysfs +183 common ustat sys_ustat +184 common statfs sys_statfs +185 common fstatfs sys_fstatfs +186 common statfs64 sys_statfs64 +187 common fstatfs64 sys_fstatfs64 +# System +188 common setrlimit sys_setrlimit +189 common getrlimit sys_getrlimit +190 common getrusage sys_getrusage +191 common futex sys_futex_time32 +192 common gettimeofday sys_gettimeofday +193 common settimeofday sys_settimeofday +194 common adjtimex sys_adjtimex_time32 +195 common nanosleep sys_nanosleep_time32 +196 common getgroups sys_getgroups +197 common setgroups sys_setgroups +198 common sethostname sys_sethostname +199 common setdomainname sys_setdomainname +200 common syslog sys_syslog +201 common vhangup sys_vhangup +202 common uselib sys_uselib +203 common reboot sys_reboot +204 common quotactl sys_quotactl +# 205 was old nfsservctl +205 common nfsservctl sys_ni_syscall +206 common _sysctl sys_ni_syscall +207 common bdflush sys_ni_syscall +208 common uname sys_newuname +209 common sysinfo sys_sysinfo +210 common init_module sys_init_module +211 common delete_module sys_delete_module +212 common sched_setparam sys_sched_setparam +213 common sched_getparam sys_sched_getparam +214 common sched_setscheduler sys_sched_setscheduler +215 common sched_getscheduler sys_sched_getscheduler +216 common sched_get_priority_max sys_sched_get_priority_max +217 common sched_get_priority_min sys_sched_get_priority_min +218 common sched_rr_get_interval sys_sched_rr_get_interval_time32 +219 common sched_yield sys_sched_yield +222 common available222 sys_ni_syscall +# Signal Handling +223 common restart_syscall sys_restart_syscall +224 common sigaltstack sys_sigaltstack +225 common rt_sigreturn xtensa_rt_sigreturn +226 common rt_sigaction sys_rt_sigaction +227 common rt_sigprocmask sys_rt_sigprocmask +228 common rt_sigpending sys_rt_sigpending +229 common rt_sigtimedwait sys_rt_sigtimedwait_time32 +230 common rt_sigqueueinfo sys_rt_sigqueueinfo +231 common rt_sigsuspend sys_rt_sigsuspend +# Message +232 common mq_open sys_mq_open +233 common mq_unlink sys_mq_unlink +234 common mq_timedsend sys_mq_timedsend_time32 +235 common mq_timedreceive sys_mq_timedreceive_time32 +236 common mq_notify sys_mq_notify +237 common mq_getsetattr sys_mq_getsetattr +238 common available238 sys_ni_syscall +239 common io_setup sys_io_setup +# IO +240 common io_destroy sys_io_destroy +241 common io_submit sys_io_submit +242 common io_getevents sys_io_getevents_time32 +243 common io_cancel sys_io_cancel +244 common clock_settime sys_clock_settime32 +245 common clock_gettime sys_clock_gettime32 +246 common clock_getres sys_clock_getres_time32 +247 common clock_nanosleep sys_clock_nanosleep_time32 +# Timer +248 common timer_create sys_timer_create +249 common timer_delete sys_timer_delete +250 common timer_settime sys_timer_settime32 +251 common timer_gettime sys_timer_gettime32 +252 common timer_getoverrun sys_timer_getoverrun +# System +253 common reserved253 sys_ni_syscall +254 common lookup_dcookie sys_ni_syscall +255 common available255 sys_ni_syscall +256 common add_key sys_add_key +257 common request_key sys_request_key +258 common keyctl sys_keyctl +259 common available259 sys_ni_syscall +260 common readahead sys_readahead +261 common remap_file_pages sys_remap_file_pages +262 common migrate_pages sys_migrate_pages +263 common mbind sys_mbind +264 common get_mempolicy sys_get_mempolicy +265 common set_mempolicy sys_set_mempolicy +266 common unshare sys_unshare +267 common move_pages sys_move_pages +268 common splice sys_splice +269 common tee sys_tee +270 common vmsplice sys_vmsplice +271 common available271 sys_ni_syscall +272 common pselect6 sys_pselect6_time32 +273 common ppoll sys_ppoll_time32 +274 common epoll_pwait sys_epoll_pwait +275 common epoll_create1 sys_epoll_create1 +276 common inotify_init sys_inotify_init +277 common inotify_add_watch sys_inotify_add_watch +278 common inotify_rm_watch sys_inotify_rm_watch +279 common inotify_init1 sys_inotify_init1 +280 common getcpu sys_getcpu +281 common kexec_load sys_ni_syscall +282 common ioprio_set sys_ioprio_set +283 common ioprio_get sys_ioprio_get +284 common set_robust_list sys_set_robust_list +285 common get_robust_list sys_get_robust_list +286 common available286 sys_ni_syscall +287 common available287 sys_ni_syscall +# Relative File Operations +288 common openat sys_openat +289 common mkdirat sys_mkdirat +290 common mknodat sys_mknodat +291 common unlinkat sys_unlinkat +292 common renameat sys_renameat +293 common linkat sys_linkat +294 common symlinkat sys_symlinkat +295 common readlinkat sys_readlinkat +296 common utimensat sys_utimensat_time32 +297 common fchownat sys_fchownat +298 common futimesat sys_futimesat_time32 +299 common fstatat64 sys_fstatat64 +300 common fchmodat sys_fchmodat +301 common faccessat sys_faccessat +302 common available302 sys_ni_syscall +303 common available303 sys_ni_syscall +304 common signalfd sys_signalfd +# 305 was timerfd +306 common eventfd sys_eventfd +307 common recvmmsg sys_recvmmsg_time32 +308 common setns sys_setns +309 common signalfd4 sys_signalfd4 +310 common dup3 sys_dup3 +311 common pipe2 sys_pipe2 +312 common timerfd_create sys_timerfd_create +313 common timerfd_settime sys_timerfd_settime32 +314 common timerfd_gettime sys_timerfd_gettime32 +315 common available315 sys_ni_syscall +316 common eventfd2 sys_eventfd2 +317 common preadv sys_preadv +318 common pwritev sys_pwritev +319 common available319 sys_ni_syscall +320 common fanotify_init sys_fanotify_init +321 common fanotify_mark sys_fanotify_mark +322 common process_vm_readv sys_process_vm_readv +323 common process_vm_writev sys_process_vm_writev +324 common name_to_handle_at sys_name_to_handle_at +325 common open_by_handle_at sys_open_by_handle_at +326 common sync_file_range2 sys_sync_file_range2 +327 common perf_event_open sys_perf_event_open +328 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo +329 common clock_adjtime sys_clock_adjtime32 +330 common prlimit64 sys_prlimit64 +331 common kcmp sys_kcmp +332 common finit_module sys_finit_module +333 common accept4 sys_accept4 +334 common sched_setattr sys_sched_setattr +335 common sched_getattr sys_sched_getattr +336 common renameat2 sys_renameat2 +337 common seccomp sys_seccomp +338 common getrandom sys_getrandom +339 common memfd_create sys_memfd_create +340 common bpf sys_bpf +341 common execveat sys_execveat +342 common userfaultfd sys_userfaultfd +343 common membarrier sys_membarrier +344 common mlock2 sys_mlock2 +345 common copy_file_range sys_copy_file_range +346 common preadv2 sys_preadv2 +347 common pwritev2 sys_pwritev2 +348 common pkey_mprotect sys_pkey_mprotect +349 common pkey_alloc sys_pkey_alloc +350 common pkey_free sys_pkey_free +351 common statx sys_statx +352 common rseq sys_rseq +# 353 through 402 are unassigned to sync up with generic numbers +403 common clock_gettime64 sys_clock_gettime +404 common clock_settime64 sys_clock_settime +405 common clock_adjtime64 sys_clock_adjtime +406 common clock_getres_time64 sys_clock_getres +407 common clock_nanosleep_time64 sys_clock_nanosleep +408 common timer_gettime64 sys_timer_gettime +409 common timer_settime64 sys_timer_settime +410 common timerfd_gettime64 sys_timerfd_gettime +411 common timerfd_settime64 sys_timerfd_settime +412 common utimensat_time64 sys_utimensat +413 common pselect6_time64 sys_pselect6 +414 common ppoll_time64 sys_ppoll +416 common io_pgetevents_time64 sys_io_pgetevents +417 common recvmmsg_time64 sys_recvmmsg +418 common mq_timedsend_time64 sys_mq_timedsend +419 common mq_timedreceive_time64 sys_mq_timedreceive +420 common semtimedop_time64 sys_semtimedop +421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait +422 common futex_time64 sys_futex +423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval +424 common pidfd_send_signal sys_pidfd_send_signal +425 common io_uring_setup sys_io_uring_setup +426 common io_uring_enter sys_io_uring_enter +427 common io_uring_register sys_io_uring_register +428 common open_tree sys_open_tree +429 common move_mount sys_move_mount +430 common fsopen sys_fsopen +431 common fsconfig sys_fsconfig +432 common fsmount sys_fsmount +433 common fspick sys_fspick +434 common pidfd_open sys_pidfd_open +435 common clone3 sys_clone3 +436 common close_range sys_close_range +437 common openat2 sys_openat2 +438 common pidfd_getfd sys_pidfd_getfd +439 common faccessat2 sys_faccessat2 +440 common process_madvise sys_process_madvise +441 common epoll_pwait2 sys_epoll_pwait2 +442 common mount_setattr sys_mount_setattr +443 common quotactl_fd sys_quotactl_fd +444 common landlock_create_ruleset sys_landlock_create_ruleset +445 common landlock_add_rule sys_landlock_add_rule +446 common landlock_restrict_self sys_landlock_restrict_self +# 447 reserved for memfd_secret +448 common process_mrelease sys_process_mrelease +449 common futex_waitv sys_futex_waitv +450 common set_mempolicy_home_node sys_set_mempolicy_home_node +451 common cachestat sys_cachestat +452 common fchmodat2 sys_fchmodat2 +453 common map_shadow_stack sys_map_shadow_stack +454 common futex_wake sys_futex_wake +455 common futex_wait sys_futex_wait +456 common futex_requeue sys_futex_requeue +457 common statmount sys_statmount +458 common listmount sys_listmount +459 common lsm_get_self_attr sys_lsm_get_self_attr +460 common lsm_set_self_attr sys_lsm_set_self_attr +461 common lsm_list_modules sys_lsm_list_modules +462 common mseal sys_mseal +463 common setxattrat sys_setxattrat +464 common getxattrat sys_getxattrat +465 common listxattrat sys_listxattrat +466 common removexattrat sys_removexattrat diff --git a/tools/perf/arch/xtensa/include/syscall_table.h b/tools/perf/arch/xtensa/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..4c942821662d95216765b176a84d5fc7974e1064 --- /dev/null +++ b/tools/perf/arch/xtensa/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index 99a278a3f1b5bf44132c817ed1f2623a232d3dc5..e9e352579e6d33085a1d863441432c81d2353f49 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -205,6 +205,7 @@ check_2 tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/sys check_2 tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/arm/tools/syscall.tbl check_2 tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/kernel/syscalls/syscall.tbl check_2 tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/sparc/kernel/syscalls/syscall.tbl +check_2 tools/perf/arch/xtensa/entry/syscalls/syscall.tbl arch/xtensa/kernel/syscalls/syscall.tbl for i in "${BEAUTY_FILES[@]}" do From patchwork Fri Dec 13 00:32:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906176 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F720E7717F for ; Fri, 13 Dec 2024 00:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dIdQh9Cs/Yiyd+gVTmQAV7msUfV1ln9LoxprcHczruI=; b=QXcHXD90+zT/Zw aczb7f6RPfB8EJOa5MDVWLEfinBei7Wr/XKSmM7wC2nh1o8lNaUi5pKomLxSjN3VQePWEn4/7hnlw jsKVJ+5zOJ/YhghK9wZBlRaGQRIDhS2AFRyw2X3snQsSb9q4XICMpRNhf2NTU9+hao8ZRBy30St6W uWsNuhLXZ9x5GDH3UFl7bBEowzw6JNkFoSn1DQQrOMXf6kqsHrwFYH4XVa7FlZqvHoFOwGiHrwTFQ +uo02zfY8gt+aytiGw+oJAoGVC8A65injtyRTxDfaZ6ZsPYglB9krTbX0HDhyka4Vkh102WnJdqf2 2OdLSew0pBh1jugNGKWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLtlk-00000002KNq-49N7; Fri, 13 Dec 2024 00:43:00 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcX-00000002I7q-1fnp for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:30 +0000 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2ef89dbd8eeso796984a91.0 for ; Thu, 12 Dec 2024 16:33:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050009; x=1734654809; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wqtsJdH0T6zZbhdBCcLZmUo3J7d8jbx2wRY5+ZHZK5Y=; b=n76CFWBHhMr4Uinqj2NaZXXL60KsA4BEGfLFw6s5DbqcW4qw6BmpfAD3j6Yg70aFfU oi0ZamIZI1uqQuegFNTIsvQOdPiFMnvfsQ0sECmaueIzPCNMlFQNLGxo++v/8QYaavMn 18X2AdkqpKSsEsQjqYxYtqLwNuGHVyvOvg5l2++P76kb6aS6mvCcQM0Fc1TfpCzm8/Gc TM7BNr8Bcg+PG+cJPyyYpCDCAwVucxVcB/4fgix+KWtKYh/pnb9vGzw3x/XNXCl4JIhu ktQEjT+tsWBdvJklYff7XXoeUwJ/WY9YorqsQgGNXzwANvviiAPFieZrbHHkDiEEO60q nrpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050009; x=1734654809; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wqtsJdH0T6zZbhdBCcLZmUo3J7d8jbx2wRY5+ZHZK5Y=; b=YCL+NgABalbdrzAEo5+u2kE+xK0HybIhI1UAtbv1FpZLWonZBuu70ZZCFrJyua+Vja u0fGx0U+NmpDwMan19n1t3FAAOJc/S5e8p2E8WyNsYz+EEDWSXMnBETC0F0mvAhFxhiB yHf3KDgJuzAJRevPZ99yUa6AuOoMTw1qvFMeeDKnXydPNt8mgQcJEH5pjTPqg8XBLH40 pqT78X8bHNhOcKLBiFVlh7d+rAyRvC9VTRezbfc7GitqWgcV7Ln0WM9qV5cCL1Xsx2AT F9KJJB1fxQWpnHMVgQajanrEmSexFAFvDJyVIh/fHzmMorPWeeQmLmJ1S2+u9ExbhqlS Blpg== X-Forwarded-Encrypted: i=1; AJvYcCUlhvOOf3wvf/i+ykUe3NndTgZB4EIsMuajO5z+ZCRZHifPcEKT4ITVJSF7OIdGDGMxOPt1vgCTWCBxpg==@lists.infradead.org X-Gm-Message-State: AOJu0YxWYZLiS/D3jfWEbs+GPv4nIa/mj0yFY8PXSAI9ALc/juDr0orF afhn8+sdphNiKuDY9jpODAT0rQsyq4TtwWGs7GetHz6s3bY+AeYGTQvau8nPJUM= X-Gm-Gg: ASbGncsDKzRXJphnXp+ohJSYqPzb3gVEd1mKpIBAspF8i4KQMAdlOOGMGypZ6M7Rnlr znKC5mep0SmAxqvyOOQ+QV65xYf5/fmhLuA8RT4x4HGO0L8FxBTsL9gtO6OiPo53aQzAJlFhnVf nkwrpBNHtWXN4S27L57Bz3L7z+nRuoaO1IhnMtgN81tbWXqggtrCPgO3O+AWZJ93djLk8GW60ZK ji5eXh0VwZwnpEOPwPv2iQ9KBC+FJwOF/0xQAz5Ll0FxF6ErHofR33ZVS33DHDBPpDAPXcF X-Google-Smtp-Source: AGHT+IGi90vHo4yCrr7BQy/TsA036N7tv/gNvOdFJlDNh6L5trY7iFH3eAjPqcmD14GDGTyDF3GXKQ== X-Received: by 2002:a17:90b:3b52:b0:2ef:2d9f:8e55 with SMTP id 98e67ed59e1d1-2f28fd66b3dmr1299199a91.17.1734050008781; Thu, 12 Dec 2024 16:33:28 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:27 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:32:58 -0800 Subject: [PATCH v2 08/16] perf tools: x86: Use generic syscall scripts MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-8-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=7567; i=charlie@rivosinc.com; h=from:subject:message-id; bh=vWB516XE68OePgZAgArR+UCA4Mc0u0OEiQYLsE2X2xs=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w35j+78f3skpZFdbZ2kttLGZ2dZ67d2VOa//eIo+C D475UJURykLgxgHg6yYIgvPtQbm1jv6ZUdFyybAzGFlAhnCwMUpABM5Mpfhf/rukAKHT13bVNYl mU0Ij9YO3n4h+lTgG0tZrTVLri3d7crIsIv7+gXDvZw/5aed4fthqCzMe/t99Msn7cYzb5mGsyz azAIA X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163329_435101_B87B026B X-CRM114-Status: GOOD ( 16.62 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Use the generic scripts to generate headers from the syscall table for both 32- and 64-bit x86. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 5 ++- tools/perf/Makefile.perf | 2 +- tools/perf/arch/x86/Build | 1 - tools/perf/arch/x86/Makefile | 25 ------------- tools/perf/arch/x86/entry/syscalls/Kbuild | 3 ++ .../perf/arch/x86/entry/syscalls/Makefile.syscalls | 6 ++++ tools/perf/arch/x86/entry/syscalls/syscalltbl.sh | 42 ---------------------- tools/perf/arch/x86/include/syscall_table.h | 8 +++++ tools/perf/util/syscalltbl.c | 10 +----- 9 files changed, 21 insertions(+), 81 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 9348c1e72bf00f43faf1c9aadab171236e6c3621..ada51e0dc17fbf5012e606ffc0b580c6993ebe64 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,12 +31,12 @@ $(call detected_var,SRCARCH) ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE := 1 - ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 powerpc arm64 s390 mips loongarch riscv)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc arm64 s390 mips loongarch)) NO_SYSCALL_TABLE := 0 endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated @@ -56,7 +56,6 @@ endif # Additional ARCH settings for x86 ifeq ($(SRCARCH),x86) $(call detected,CONFIG_X86) - CFLAGS += -I$(OUTPUT)arch/x86/include/generated ifeq (${IS_64_BIT}, 1) CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index c7e1c6b7f8d97dddf07eab122a169b379ec43a19..efce35bb535b8ce4c20ee0a9250a548e4af1fbce 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/x86/Build b/tools/perf/arch/x86/Build index 87d0574913431b7c4505caf78f41d48b180a2fbc..02a1ca780a2071d322f75fb2885c3a36bc278e8d 100644 --- a/tools/perf/arch/x86/Build +++ b/tools/perf/arch/x86/Build @@ -2,7 +2,6 @@ perf-util-y += util/ perf-test-y += tests/ ifdef SHELLCHECK - SHELL_TESTS := entry/syscalls/syscalltbl.sh TEST_LOGS := $(SHELL_TESTS:%=%.shellcheck_log) else SHELL_TESTS := diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile index a6b6e0a9308a8e401c65eb802e5815a41fbdefe9..a295a80ea078199547e816d18531820bfdba7961 100644 --- a/tools/perf/arch/x86/Makefile +++ b/tools/perf/arch/x86/Makefile @@ -1,28 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 HAVE_KVM_STAT_SUPPORT := 1 PERF_HAVE_JITDUMP := 1 - -### -# Syscall table generation -# - -generated := $(OUTPUT)arch/x86/include/generated -out := $(generated)/asm -header := $(out)/syscalls_64.c -header_32 := $(out)/syscalls_32.c -sys := $(srctree)/tools/perf/arch/x86/entry/syscalls -systbl := $(sys)/syscalltbl.sh - -# Create output directory if not already present -$(shell [ -d '$(out)' ] || mkdir -p '$(out)') - -$(header): $(sys)/syscall_64.tbl $(systbl) - $(Q)$(SHELL) '$(systbl)' $(sys)/syscall_64.tbl 'x86_64' > $@ - -$(header_32): $(sys)/syscall_32.tbl $(systbl) - $(Q)$(SHELL) '$(systbl)' $(sys)/syscall_32.tbl 'x86' > $@ - -clean:: - $(call QUIET_CLEAN, x86) $(RM) -r $(header) $(generated) - -archheaders: $(header) $(header_32) diff --git a/tools/perf/arch/x86/entry/syscalls/Kbuild b/tools/perf/arch/x86/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..84c6599b4ea6a160217a3496449b205f2263f0fb --- /dev/null +++ b/tools/perf/arch/x86/entry/syscalls/Kbuild @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_32.h +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/x86/entry/syscalls/Makefile.syscalls b/tools/perf/arch/x86/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..db3d5d6d4e5699d338afc55f6415612ef924d985 --- /dev/null +++ b/tools/perf/arch/x86/entry/syscalls/Makefile.syscalls @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += i386 +syscall_abis_64 += + +syscalltbl = $(srctree)/tools/perf/arch/x86/entry/syscalls/syscall_%.tbl diff --git a/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh b/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh deleted file mode 100755 index 2b71f99933a549607b0c18aa2b8be16b860f603c..0000000000000000000000000000000000000000 --- a/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -in="$1" -arch="$2" - -syscall_macro() { - nr="$1" - name="$2" - - echo " [$nr] = \"$name\"," -} - -emit() { - nr="$1" - entry="$2" - - syscall_macro "$nr" "$entry" -} - -echo "static const char *const syscalltbl_${arch}[] = {" - -sorted_table=$(mktemp /tmp/syscalltbl.XXXXXX) -grep '^[0-9]' "$in" | sort -n > $sorted_table - -max_nr=0 -# the params are: nr abi name entry compat -# use _ for intentionally unused variables according to SC2034 -while read nr _ name _ _; do - if [ $nr -ge 512 ] ; then # discard compat sycalls - break - fi - - emit "$nr" "$name" - max_nr=$nr -done < $sorted_table - -rm -f $sorted_table - -echo "};" - -echo "#define SYSCALLTBL_${arch}_MAX_ID ${max_nr}" diff --git a/tools/perf/arch/x86/include/syscall_table.h b/tools/perf/arch/x86/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..7ff51b783000d727ec48be960730b81ecdb05575 --- /dev/null +++ b/tools/perf/arch/x86/include/syscall_table.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include + +#if __BITS_PER_LONG == 64 +#include +#else +#include +#endif diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index ccf234a54366f9921c3b9a02ffb0a365d17244bc..02f23483bfff83809c4e649a2d054dba6975d12c 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -14,15 +14,7 @@ #include #include "string2.h" -#if defined(__x86_64__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_x86_64_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_x86_64; -#elif defined(__i386__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_x86_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_x86; -#elif defined(__s390x__) +#if defined(__s390x__) #include const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID; static const char *const *syscalltbl_native = syscalltbl_s390_64; From patchwork Fri Dec 13 00:32:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4722EE77182 for ; Fri, 13 Dec 2024 00:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qg2JfVbiK5l+hRMRENhlWTDpppKnuKTmbupZ0akn57g=; b=4xm564+Jbv0qkP cY9UrmHIdBJdU6OEzTLnUGoYn+m0DPBJvdsaGQbA3Vi5YmQWH44HogfXQzbcB1Hl/85xjjAYuZa0F UE8RxtvtqiDhkI44tWiV/GnVHuo4Rym1+76zw4628QUeHUaEMGcTSxWQffSjvfvqB9IwMg5fvQ4RI PjxZpDl/nsdcw6ZBPMhmVRzuqtxFk/kk4UJlTQtjW5M4OBztidGyylynPOMHBVYs2kORIBay5NIYV dk04CH1i4UVLUuLH7sk1xeh90ydnhtCvYXoktLyREgbLVJzQAzFonlnbUIzcFW0aY1oLrH/ufrxjW 1ZUgQmpjr8b85NFH0o5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLtll-00000002KOK-2aaq; Fri, 13 Dec 2024 00:43:01 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtca-00000002I9Y-1hUr for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:33 +0000 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-728e3826211so1032301b3a.0 for ; Thu, 12 Dec 2024 16:33:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050011; x=1734654811; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LydJwai9v52F8ijt7JfJJURvKfIWZJItLlAf22eQEtA=; b=qdY+dmeU2v5QB/q4UNJo3Z9uQGEamJpr1AqJffpfGSaBSBlc/AeTRzlnxORsATyV8d wq84EvJHS4cubeW11igR6lyNd8wiVrPpQiaarFJIavGbchDDf5JJKMarfvIZP2kbOf5V 27RMa4lFsGexSznIVtZ//2lyJ2K7avJ5sUAqXk5ctKpiez2d8nBZl/CXTupakyLISbmP jUuVZjJ0weoHnONIezA+7wMme0XpGubsjYLOazhoqGD2RsU+Ap+4cJsX7ACjLmwQqK07 qLOmg+XtAs8/DtxS9izfQMk48alxBrRuXjMEPGlLNPJjus76VOnG4wMpWXu/rmmB6rw5 eNog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050011; x=1734654811; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LydJwai9v52F8ijt7JfJJURvKfIWZJItLlAf22eQEtA=; b=D0mVxZyzEI3ks6yC52G9gfkvEE+3pd0L6FOhKWdPDj4kxaBqcp6ef3xt3lFXl7eIle 6DimyXy/mkMnF9d650mAJH4fla39ZLEyL67J2eq3YVZaa8nUHh27IwJqLb0gDplGsk8d z8smDMQYjBUkhMhtcWERDvWVoWRDWtHaXc57HnHqAkTOb+u7MV7tW8s4fmj/oNLkKU1g uxjMa9T3gEJv0CyOhO/iUeYIMpakWr+CyaZAvfOZE6S6nkTxhfOH32VeI8pzx6diJ8kq IFfzGwVGjv3JuQ/FFYyehAf0o3qhQwYDeUqAHvHp4PezcD1lpxKQEwIjOc0rfx/09D3k 8RwA== X-Forwarded-Encrypted: i=1; AJvYcCUXXDvVoiB6gV/7KVcmBmBufVV1SdE+yA2U2tIJXag7XN28OL9HxAkfqNhULm3S+rZvNOqkI7sannAeow==@lists.infradead.org X-Gm-Message-State: AOJu0Yw/gJG8FhvMbrStrP42x+KNcFnATo5vAYX6WrPrTQKuFBZnHfkQ OfI0vh/Yv/91bGYyRPNGq9+zL+JL+Hp4B3GpdzfHlWy4efL8/JOkihnXAh7sGkM= X-Gm-Gg: ASbGncstXMfFqn5LWS0nipi2MhYQIbpi4/dpybA0RNH8G0BAN7euhN+tG/FH50P9c/7 I+Jv6IPNYrL4OaZNuVJEbiwfnSEqQXRgK8VxTPrgAMsdZcsftHwl8xVFyDKbGP/eBs5bVKGGjHC LvzNHkssS4L+sKqyqU1mz0FrifRUs0btZnQ4ELJiR3bkWoWOpvLAKfBcv5ju/NJcKKwWnqFAJ9Q AA7vV/rG+FCm2h1YFdG1DgC1mepsIWyLi1MzXa95+H0zi0RdbSnHG+Q6UOeQiLrd0xvfRSS X-Google-Smtp-Source: AGHT+IFYevbrKZfIbCHSwtS3hTvVfcKmieRM/4x3loeC9t8BiXo/a1veKxcSZaLwEjMUjBGy7FzWmw== X-Received: by 2002:a17:90b:1d8e:b0:2ee:aa95:6de9 with SMTP id 98e67ed59e1d1-2f2904a8b08mr1147445a91.33.1734050011449; Thu, 12 Dec 2024 16:33:31 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:30 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:32:59 -0800 Subject: [PATCH v2 09/16] perf tools: alpha: Support syscall header MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-9-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=24514; i=charlie@rivosinc.com; h=from:subject:message-id; bh=h4gID6uxSRUHjnwb+ZFRNgExeez5XAq6WPTSoL5ZAgI=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w37muo0mqWF107/mmhksbHDQCzQ12PQm49zm5zt0J swNEbTuKGVhEONgkBVTZOG51sDceke/7Kho2QSYOaxMIEMYuDgFYCLCexj+1zVc0zj9fNeGCXdq bm3rPnI1viz/jePJfe46Ja43I44qyDL8D5S/3/lh6tui7SFT7zzac3zPhscOXReXe3VeMWmZ8Jr TiREA X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163332_706997_17DB041E X-CRM114-Status: GOOD ( 14.76 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org alpha uses a syscall table, use that in perf instead of requiring libaudit. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 2 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/alpha/entry/syscalls/Kbuild | 2 + .../arch/alpha/entry/syscalls/Makefile.syscalls | 5 + tools/perf/arch/alpha/entry/syscalls/syscall.tbl | 504 +++++++++++++++++++++ tools/perf/arch/alpha/include/syscall_table.h | 2 + tools/perf/check-headers.sh | 1 + 7 files changed, 516 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index ada51e0dc17fbf5012e606ffc0b580c6993ebe64..802a8aa3a4fcd91ef7b7400373ce40736dfae0a1 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -36,7 +36,7 @@ ifneq ($(NO_SYSCALL_TABLE),1) endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index efce35bb535b8ce4c20ee0a9250a548e4af1fbce..178a96bfc50e78f7c843f67d850b7cc323e163b6 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/alpha/entry/syscalls/Kbuild b/tools/perf/arch/alpha/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..9a41e3572c3afd4f202321fd9e492714540e8fd3 --- /dev/null +++ b/tools/perf/arch/alpha/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/alpha/entry/syscalls/Makefile.syscalls b/tools/perf/arch/alpha/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..690168aac34db9f1b96346210993675defcfc300 --- /dev/null +++ b/tools/perf/arch/alpha/entry/syscalls/Makefile.syscalls @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_64 += + +syscalltbl = $(srctree)/tools/perf/arch/alpha/entry/syscalls/syscall.tbl diff --git a/tools/perf/arch/alpha/entry/syscalls/syscall.tbl b/tools/perf/arch/alpha/entry/syscalls/syscall.tbl new file mode 100644 index 0000000000000000000000000000000000000000..74720667fe091768800a22fd4ce68b5324abff09 --- /dev/null +++ b/tools/perf/arch/alpha/entry/syscalls/syscall.tbl @@ -0,0 +1,504 @@ +# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note +# +# system call numbers and entry vectors for alpha +# +# The format is: +# +# +# The is always "common" for this file +# +0 common osf_syscall alpha_syscall_zero +1 common exit sys_exit +2 common fork alpha_fork +3 common read sys_read +4 common write sys_write +5 common osf_old_open sys_ni_syscall +6 common close sys_close +7 common osf_wait4 sys_osf_wait4 +8 common osf_old_creat sys_ni_syscall +9 common link sys_link +10 common unlink sys_unlink +11 common osf_execve sys_ni_syscall +12 common chdir sys_chdir +13 common fchdir sys_fchdir +14 common mknod sys_mknod +15 common chmod sys_chmod +16 common chown sys_chown +17 common brk sys_osf_brk +18 common osf_getfsstat sys_ni_syscall +19 common lseek sys_lseek +20 common getxpid sys_getxpid +21 common osf_mount sys_osf_mount +22 common umount2 sys_umount +23 common setuid sys_setuid +24 common getxuid sys_getxuid +25 common exec_with_loader sys_ni_syscall +26 common ptrace sys_ptrace +27 common osf_nrecvmsg sys_ni_syscall +28 common osf_nsendmsg sys_ni_syscall +29 common osf_nrecvfrom sys_ni_syscall +30 common osf_naccept sys_ni_syscall +31 common osf_ngetpeername sys_ni_syscall +32 common osf_ngetsockname sys_ni_syscall +33 common access sys_access +34 common osf_chflags sys_ni_syscall +35 common osf_fchflags sys_ni_syscall +36 common sync sys_sync +37 common kill sys_kill +38 common osf_old_stat sys_ni_syscall +39 common setpgid sys_setpgid +40 common osf_old_lstat sys_ni_syscall +41 common dup sys_dup +42 common pipe sys_alpha_pipe +43 common osf_set_program_attributes sys_osf_set_program_attributes +44 common osf_profil sys_ni_syscall +45 common open sys_open +46 common osf_old_sigaction sys_ni_syscall +47 common getxgid sys_getxgid +48 common osf_sigprocmask sys_osf_sigprocmask +49 common osf_getlogin sys_ni_syscall +50 common osf_setlogin sys_ni_syscall +51 common acct sys_acct +52 common sigpending sys_sigpending +54 common ioctl sys_ioctl +55 common osf_reboot sys_ni_syscall +56 common osf_revoke sys_ni_syscall +57 common symlink sys_symlink +58 common readlink sys_readlink +59 common execve sys_execve +60 common umask sys_umask +61 common chroot sys_chroot +62 common osf_old_fstat sys_ni_syscall +63 common getpgrp sys_getpgrp +64 common getpagesize sys_getpagesize +65 common osf_mremap sys_ni_syscall +66 common vfork alpha_vfork +67 common stat sys_newstat +68 common lstat sys_newlstat +69 common osf_sbrk sys_ni_syscall +70 common osf_sstk sys_ni_syscall +71 common mmap sys_osf_mmap +72 common osf_old_vadvise sys_ni_syscall +73 common munmap sys_munmap +74 common mprotect sys_mprotect +75 common madvise sys_madvise +76 common vhangup sys_vhangup +77 common osf_kmodcall sys_ni_syscall +78 common osf_mincore sys_ni_syscall +79 common getgroups sys_getgroups +80 common setgroups sys_setgroups +81 common osf_old_getpgrp sys_ni_syscall +82 common setpgrp sys_setpgid +83 common osf_setitimer compat_sys_setitimer +84 common osf_old_wait sys_ni_syscall +85 common osf_table sys_ni_syscall +86 common osf_getitimer compat_sys_getitimer +87 common gethostname sys_gethostname +88 common sethostname sys_sethostname +89 common getdtablesize sys_getdtablesize +90 common dup2 sys_dup2 +91 common fstat sys_newfstat +92 common fcntl sys_fcntl +93 common osf_select sys_osf_select +94 common poll sys_poll +95 common fsync sys_fsync +96 common setpriority sys_setpriority +97 common socket sys_socket +98 common connect sys_connect +99 common accept sys_accept +100 common getpriority sys_osf_getpriority +101 common send sys_send +102 common recv sys_recv +103 common sigreturn sys_sigreturn +104 common bind sys_bind +105 common setsockopt sys_setsockopt +106 common listen sys_listen +107 common osf_plock sys_ni_syscall +108 common osf_old_sigvec sys_ni_syscall +109 common osf_old_sigblock sys_ni_syscall +110 common osf_old_sigsetmask sys_ni_syscall +111 common sigsuspend sys_sigsuspend +112 common osf_sigstack sys_osf_sigstack +113 common recvmsg sys_recvmsg +114 common sendmsg sys_sendmsg +115 common osf_old_vtrace sys_ni_syscall +116 common osf_gettimeofday sys_osf_gettimeofday +117 common osf_getrusage sys_osf_getrusage +118 common getsockopt sys_getsockopt +120 common readv sys_readv +121 common writev sys_writev +122 common osf_settimeofday sys_osf_settimeofday +123 common fchown sys_fchown +124 common fchmod sys_fchmod +125 common recvfrom sys_recvfrom +126 common setreuid sys_setreuid +127 common setregid sys_setregid +128 common rename sys_rename +129 common truncate sys_truncate +130 common ftruncate sys_ftruncate +131 common flock sys_flock +132 common setgid sys_setgid +133 common sendto sys_sendto +134 common shutdown sys_shutdown +135 common socketpair sys_socketpair +136 common mkdir sys_mkdir +137 common rmdir sys_rmdir +138 common osf_utimes sys_osf_utimes +139 common osf_old_sigreturn sys_ni_syscall +140 common osf_adjtime sys_ni_syscall +141 common getpeername sys_getpeername +142 common osf_gethostid sys_ni_syscall +143 common osf_sethostid sys_ni_syscall +144 common getrlimit sys_getrlimit +145 common setrlimit sys_setrlimit +146 common osf_old_killpg sys_ni_syscall +147 common setsid sys_setsid +148 common quotactl sys_quotactl +149 common osf_oldquota sys_ni_syscall +150 common getsockname sys_getsockname +153 common osf_pid_block sys_ni_syscall +154 common osf_pid_unblock sys_ni_syscall +156 common sigaction sys_osf_sigaction +157 common osf_sigwaitprim sys_ni_syscall +158 common osf_nfssvc sys_ni_syscall +159 common osf_getdirentries sys_osf_getdirentries +160 common osf_statfs sys_osf_statfs +161 common osf_fstatfs sys_osf_fstatfs +163 common osf_asynch_daemon sys_ni_syscall +164 common osf_getfh sys_ni_syscall +165 common osf_getdomainname sys_osf_getdomainname +166 common setdomainname sys_setdomainname +169 common osf_exportfs sys_ni_syscall +181 common osf_alt_plock sys_ni_syscall +184 common osf_getmnt sys_ni_syscall +187 common osf_alt_sigpending sys_ni_syscall +188 common osf_alt_setsid sys_ni_syscall +199 common osf_swapon sys_swapon +200 common msgctl sys_old_msgctl +201 common msgget sys_msgget +202 common msgrcv sys_msgrcv +203 common msgsnd sys_msgsnd +204 common semctl sys_old_semctl +205 common semget sys_semget +206 common semop sys_semop +207 common osf_utsname sys_osf_utsname +208 common lchown sys_lchown +209 common shmat sys_shmat +210 common shmctl sys_old_shmctl +211 common shmdt sys_shmdt +212 common shmget sys_shmget +213 common osf_mvalid sys_ni_syscall +214 common osf_getaddressconf sys_ni_syscall +215 common osf_msleep sys_ni_syscall +216 common osf_mwakeup sys_ni_syscall +217 common msync sys_msync +218 common osf_signal sys_ni_syscall +219 common osf_utc_gettime sys_ni_syscall +220 common osf_utc_adjtime sys_ni_syscall +222 common osf_security sys_ni_syscall +223 common osf_kloadcall sys_ni_syscall +224 common osf_stat sys_osf_stat +225 common osf_lstat sys_osf_lstat +226 common osf_fstat sys_osf_fstat +227 common osf_statfs64 sys_osf_statfs64 +228 common osf_fstatfs64 sys_osf_fstatfs64 +233 common getpgid sys_getpgid +234 common getsid sys_getsid +235 common sigaltstack sys_sigaltstack +236 common osf_waitid sys_ni_syscall +237 common osf_priocntlset sys_ni_syscall +238 common osf_sigsendset sys_ni_syscall +239 common osf_set_speculative sys_ni_syscall +240 common osf_msfs_syscall sys_ni_syscall +241 common osf_sysinfo sys_osf_sysinfo +242 common osf_uadmin sys_ni_syscall +243 common osf_fuser sys_ni_syscall +244 common osf_proplist_syscall sys_osf_proplist_syscall +245 common osf_ntp_adjtime sys_ni_syscall +246 common osf_ntp_gettime sys_ni_syscall +247 common osf_pathconf sys_ni_syscall +248 common osf_fpathconf sys_ni_syscall +250 common osf_uswitch sys_ni_syscall +251 common osf_usleep_thread sys_osf_usleep_thread +252 common osf_audcntl sys_ni_syscall +253 common osf_audgen sys_ni_syscall +254 common sysfs sys_sysfs +255 common osf_subsys_info sys_ni_syscall +256 common osf_getsysinfo sys_osf_getsysinfo +257 common osf_setsysinfo sys_osf_setsysinfo +258 common osf_afs_syscall sys_ni_syscall +259 common osf_swapctl sys_ni_syscall +260 common osf_memcntl sys_ni_syscall +261 common osf_fdatasync sys_ni_syscall +300 common bdflush sys_ni_syscall +301 common sethae sys_sethae +302 common mount sys_mount +303 common old_adjtimex sys_old_adjtimex +304 common swapoff sys_swapoff +305 common getdents sys_getdents +306 common create_module sys_ni_syscall +307 common init_module sys_init_module +308 common delete_module sys_delete_module +309 common get_kernel_syms sys_ni_syscall +310 common syslog sys_syslog +311 common reboot sys_reboot +312 common clone alpha_clone +313 common uselib sys_uselib +314 common mlock sys_mlock +315 common munlock sys_munlock +316 common mlockall sys_mlockall +317 common munlockall sys_munlockall +318 common sysinfo sys_sysinfo +319 common _sysctl sys_ni_syscall +# 320 was sys_idle +321 common oldumount sys_oldumount +322 common swapon sys_swapon +323 common times sys_times +324 common personality sys_personality +325 common setfsuid sys_setfsuid +326 common setfsgid sys_setfsgid +327 common ustat sys_ustat +328 common statfs sys_statfs +329 common fstatfs sys_fstatfs +330 common sched_setparam sys_sched_setparam +331 common sched_getparam sys_sched_getparam +332 common sched_setscheduler sys_sched_setscheduler +333 common sched_getscheduler sys_sched_getscheduler +334 common sched_yield sys_sched_yield +335 common sched_get_priority_max sys_sched_get_priority_max +336 common sched_get_priority_min sys_sched_get_priority_min +337 common sched_rr_get_interval sys_sched_rr_get_interval +338 common afs_syscall sys_ni_syscall +339 common uname sys_newuname +340 common nanosleep sys_nanosleep +341 common mremap sys_mremap +342 common nfsservctl sys_ni_syscall +343 common setresuid sys_setresuid +344 common getresuid sys_getresuid +345 common pciconfig_read sys_pciconfig_read +346 common pciconfig_write sys_pciconfig_write +347 common query_module sys_ni_syscall +348 common prctl sys_prctl +349 common pread64 sys_pread64 +350 common pwrite64 sys_pwrite64 +351 common rt_sigreturn sys_rt_sigreturn +352 common rt_sigaction sys_rt_sigaction +353 common rt_sigprocmask sys_rt_sigprocmask +354 common rt_sigpending sys_rt_sigpending +355 common rt_sigtimedwait sys_rt_sigtimedwait +356 common rt_sigqueueinfo sys_rt_sigqueueinfo +357 common rt_sigsuspend sys_rt_sigsuspend +358 common select sys_select +359 common gettimeofday sys_gettimeofday +360 common settimeofday sys_settimeofday +361 common getitimer sys_getitimer +362 common setitimer sys_setitimer +363 common utimes sys_utimes +364 common getrusage sys_getrusage +365 common wait4 sys_wait4 +366 common adjtimex sys_adjtimex +367 common getcwd sys_getcwd +368 common capget sys_capget +369 common capset sys_capset +370 common sendfile sys_sendfile64 +371 common setresgid sys_setresgid +372 common getresgid sys_getresgid +373 common dipc sys_ni_syscall +374 common pivot_root sys_pivot_root +375 common mincore sys_mincore +376 common pciconfig_iobase sys_pciconfig_iobase +377 common getdents64 sys_getdents64 +378 common gettid sys_gettid +379 common readahead sys_readahead +# 380 is unused +381 common tkill sys_tkill +382 common setxattr sys_setxattr +383 common lsetxattr sys_lsetxattr +384 common fsetxattr sys_fsetxattr +385 common getxattr sys_getxattr +386 common lgetxattr sys_lgetxattr +387 common fgetxattr sys_fgetxattr +388 common listxattr sys_listxattr +389 common llistxattr sys_llistxattr +390 common flistxattr sys_flistxattr +391 common removexattr sys_removexattr +392 common lremovexattr sys_lremovexattr +393 common fremovexattr sys_fremovexattr +394 common futex sys_futex +395 common sched_setaffinity sys_sched_setaffinity +396 common sched_getaffinity sys_sched_getaffinity +397 common tuxcall sys_ni_syscall +398 common io_setup sys_io_setup +399 common io_destroy sys_io_destroy +400 common io_getevents sys_io_getevents +401 common io_submit sys_io_submit +402 common io_cancel sys_io_cancel +405 common exit_group sys_exit_group +406 common lookup_dcookie sys_ni_syscall +407 common epoll_create sys_epoll_create +408 common epoll_ctl sys_epoll_ctl +409 common epoll_wait sys_epoll_wait +410 common remap_file_pages sys_remap_file_pages +411 common set_tid_address sys_set_tid_address +412 common restart_syscall sys_restart_syscall +413 common fadvise64 sys_fadvise64 +414 common timer_create sys_timer_create +415 common timer_settime sys_timer_settime +416 common timer_gettime sys_timer_gettime +417 common timer_getoverrun sys_timer_getoverrun +418 common timer_delete sys_timer_delete +419 common clock_settime sys_clock_settime +420 common clock_gettime sys_clock_gettime +421 common clock_getres sys_clock_getres +422 common clock_nanosleep sys_clock_nanosleep +423 common semtimedop sys_semtimedop +424 common tgkill sys_tgkill +425 common stat64 sys_stat64 +426 common lstat64 sys_lstat64 +427 common fstat64 sys_fstat64 +428 common vserver sys_ni_syscall +429 common mbind sys_ni_syscall +430 common get_mempolicy sys_ni_syscall +431 common set_mempolicy sys_ni_syscall +432 common mq_open sys_mq_open +433 common mq_unlink sys_mq_unlink +434 common mq_timedsend sys_mq_timedsend +435 common mq_timedreceive sys_mq_timedreceive +436 common mq_notify sys_mq_notify +437 common mq_getsetattr sys_mq_getsetattr +438 common waitid sys_waitid +439 common add_key sys_add_key +440 common request_key sys_request_key +441 common keyctl sys_keyctl +442 common ioprio_set sys_ioprio_set +443 common ioprio_get sys_ioprio_get +444 common inotify_init sys_inotify_init +445 common inotify_add_watch sys_inotify_add_watch +446 common inotify_rm_watch sys_inotify_rm_watch +447 common fdatasync sys_fdatasync +448 common kexec_load sys_kexec_load +449 common migrate_pages sys_migrate_pages +450 common openat sys_openat +451 common mkdirat sys_mkdirat +452 common mknodat sys_mknodat +453 common fchownat sys_fchownat +454 common futimesat sys_futimesat +455 common fstatat64 sys_fstatat64 +456 common unlinkat sys_unlinkat +457 common renameat sys_renameat +458 common linkat sys_linkat +459 common symlinkat sys_symlinkat +460 common readlinkat sys_readlinkat +461 common fchmodat sys_fchmodat +462 common faccessat sys_faccessat +463 common pselect6 sys_pselect6 +464 common ppoll sys_ppoll +465 common unshare sys_unshare +466 common set_robust_list sys_set_robust_list +467 common get_robust_list sys_get_robust_list +468 common splice sys_splice +469 common sync_file_range sys_sync_file_range +470 common tee sys_tee +471 common vmsplice sys_vmsplice +472 common move_pages sys_move_pages +473 common getcpu sys_getcpu +474 common epoll_pwait sys_epoll_pwait +475 common utimensat sys_utimensat +476 common signalfd sys_signalfd +477 common timerfd sys_ni_syscall +478 common eventfd sys_eventfd +479 common recvmmsg sys_recvmmsg +480 common fallocate sys_fallocate +481 common timerfd_create sys_timerfd_create +482 common timerfd_settime sys_timerfd_settime +483 common timerfd_gettime sys_timerfd_gettime +484 common signalfd4 sys_signalfd4 +485 common eventfd2 sys_eventfd2 +486 common epoll_create1 sys_epoll_create1 +487 common dup3 sys_dup3 +488 common pipe2 sys_pipe2 +489 common inotify_init1 sys_inotify_init1 +490 common preadv sys_preadv +491 common pwritev sys_pwritev +492 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo +493 common perf_event_open sys_perf_event_open +494 common fanotify_init sys_fanotify_init +495 common fanotify_mark sys_fanotify_mark +496 common prlimit64 sys_prlimit64 +497 common name_to_handle_at sys_name_to_handle_at +498 common open_by_handle_at sys_open_by_handle_at +499 common clock_adjtime sys_clock_adjtime +500 common syncfs sys_syncfs +501 common setns sys_setns +502 common accept4 sys_accept4 +503 common sendmmsg sys_sendmmsg +504 common process_vm_readv sys_process_vm_readv +505 common process_vm_writev sys_process_vm_writev +506 common kcmp sys_kcmp +507 common finit_module sys_finit_module +508 common sched_setattr sys_sched_setattr +509 common sched_getattr sys_sched_getattr +510 common renameat2 sys_renameat2 +511 common getrandom sys_getrandom +512 common memfd_create sys_memfd_create +513 common execveat sys_execveat +514 common seccomp sys_seccomp +515 common bpf sys_bpf +516 common userfaultfd sys_userfaultfd +517 common membarrier sys_membarrier +518 common mlock2 sys_mlock2 +519 common copy_file_range sys_copy_file_range +520 common preadv2 sys_preadv2 +521 common pwritev2 sys_pwritev2 +522 common statx sys_statx +523 common io_pgetevents sys_io_pgetevents +524 common pkey_mprotect sys_pkey_mprotect +525 common pkey_alloc sys_pkey_alloc +526 common pkey_free sys_pkey_free +527 common rseq sys_rseq +528 common statfs64 sys_statfs64 +529 common fstatfs64 sys_fstatfs64 +530 common getegid sys_getegid +531 common geteuid sys_geteuid +532 common getppid sys_getppid +# all other architectures have common numbers for new syscall, alpha +# is the exception. +534 common pidfd_send_signal sys_pidfd_send_signal +535 common io_uring_setup sys_io_uring_setup +536 common io_uring_enter sys_io_uring_enter +537 common io_uring_register sys_io_uring_register +538 common open_tree sys_open_tree +539 common move_mount sys_move_mount +540 common fsopen sys_fsopen +541 common fsconfig sys_fsconfig +542 common fsmount sys_fsmount +543 common fspick sys_fspick +544 common pidfd_open sys_pidfd_open +545 common clone3 alpha_clone3 +546 common close_range sys_close_range +547 common openat2 sys_openat2 +548 common pidfd_getfd sys_pidfd_getfd +549 common faccessat2 sys_faccessat2 +550 common process_madvise sys_process_madvise +551 common epoll_pwait2 sys_epoll_pwait2 +552 common mount_setattr sys_mount_setattr +553 common quotactl_fd sys_quotactl_fd +554 common landlock_create_ruleset sys_landlock_create_ruleset +555 common landlock_add_rule sys_landlock_add_rule +556 common landlock_restrict_self sys_landlock_restrict_self +# 557 reserved for memfd_secret +558 common process_mrelease sys_process_mrelease +559 common futex_waitv sys_futex_waitv +560 common set_mempolicy_home_node sys_ni_syscall +561 common cachestat sys_cachestat +562 common fchmodat2 sys_fchmodat2 +563 common map_shadow_stack sys_map_shadow_stack +564 common futex_wake sys_futex_wake +565 common futex_wait sys_futex_wait +566 common futex_requeue sys_futex_requeue +567 common statmount sys_statmount +568 common listmount sys_listmount +569 common lsm_get_self_attr sys_lsm_get_self_attr +570 common lsm_set_self_attr sys_lsm_set_self_attr +571 common lsm_list_modules sys_lsm_list_modules +572 common mseal sys_mseal diff --git a/tools/perf/arch/alpha/include/syscall_table.h b/tools/perf/arch/alpha/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..b53e31c15805319a01719c22d489c4037378b02b --- /dev/null +++ b/tools/perf/arch/alpha/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index e9e352579e6d33085a1d863441432c81d2353f49..a821df1fd4c0e78c9706304e5b8974cbc5ef4437 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -206,6 +206,7 @@ check_2 tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/arm/tools/syscall.tb check_2 tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/kernel/syscalls/syscall.tbl check_2 tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/sparc/kernel/syscalls/syscall.tbl check_2 tools/perf/arch/xtensa/entry/syscalls/syscall.tbl arch/xtensa/kernel/syscalls/syscall.tbl +check_2 tools/perf/arch/alpha/entry/syscalls/syscall.tbl arch/alpha/entry/syscalls/syscall.tbl for i in "${BEAUTY_FILES[@]}" do From patchwork Fri Dec 13 00:33:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906342 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 89AEBE77182 for ; Fri, 13 Dec 2024 01:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UYfbLVOc8uO7fUFkboyzHce8hbDLBNxszB97seTdmz0=; b=bOUG6H50qlVZjk HNNZsfTuDfnq6gQDXzs9Rih02BaOxTH3pA3jf6E9RtiTSN4PA6qu0LYOR0aGqOwg8Ky3YO8HIlKJJ iwAskvAlyuQbuxPk/ctey/5Wygg14JDFQE7t2c1chspu0wztUhnZ7QQ/+czkBVnn2mrxj2i1BqxvZ MgkNP0Gzti0uYJUZvOHPipOcBUA2643OhrLUyKXKcth1fWKnhoIY2LefKzSAqJ/6sIUfol+2lkZCF qZRZWmoRqYJStS70RNUqO9HxDHgh8KUWcYVrpxWjSoT0kMBoDgsHTzKS2OhpSuB4gRgA5YexO/xES GtZxVy8XqX7Q6QjKvCkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLukM-00000002RD3-0yb8; Fri, 13 Dec 2024 01:45:38 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcc-00000002IAw-43Kk for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:36 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-725dc290c00so1961276b3a.0 for ; Thu, 12 Dec 2024 16:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050014; x=1734654814; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=50bVmHyKsu5kLy52jHqfG7I5gbmYwGpF39knaftX4hQ=; b=JNxv3BaI4j8YylOdvcOe6Rp63gWiJ0LrJ5YrDQGSMYco5NnsNL8bP8486oFEX9Vyak oeqViOK1Mpxa6AAsS0efnxfcgJcQl6MpVXf8f/bxPfNaXGXN67cyyds/ivh6RIdUWdkp iYBe3kwI2ibIeNo6jc9tLUCH1GIJzLbCOEMpMxt8xL+qut6PPsyGA5V7swyNfbrJL86/ Hxfv2KN3lC2U0cSvrkn7vspiLnUU36vk5wfrpYeI6pF/3LBJq31v5+gRYIKTdwRTdGFg Y7dDQziF04ubS+UMteu6heuqhAYRP9S3XHH1GZlMk7eGqys/IVtMtDLOhZjn0EWdK5Mk LJiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050014; x=1734654814; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=50bVmHyKsu5kLy52jHqfG7I5gbmYwGpF39knaftX4hQ=; b=PVylpnMJ0gv9LjS0wzgH7WtbQzNR4tJfLfmcF7AV21kDbKEtv/1HxBPmZJ+Y3l86M4 YZw3gm5x0x5U4AezzjPljyVU2rTC2KuXIeHOvYiR/OmydSHK8PH/kCcONNRrK2lLX1XF OdZss5qSkKQJa2cDbh1P9eZN3j+BkzJux/k/p1R8jnRWSilANFMwIDlHTXF4cMSSxgEA f+3wW7RpRvLEG4/dAOSkn7HB8rXE74B4vg/qH0z1bS2a5nptqkrxvniktOVkI4IQvxIr R5KY8WETofmIMIdNJ+kW5NA+BxT5VOmcEbB3j81XGgKKKVSDbwp8zCypce/xAy4102Hw G3Cg== X-Forwarded-Encrypted: i=1; AJvYcCUvcB1SIoVlSzZoZZe+e43Co22e6AeYZm+pUlhlM7tpU5KEZBMbREI4sB7iO6mh1BXlY2nTaPeU1itffA==@lists.infradead.org X-Gm-Message-State: AOJu0YxFAlJT2rzjD4nOKfQm4XHN9F5uqZzHu4aZd30FdgQ5AjPKC5u1 rStLDhE57Ov7FduHZe5o6nMBce4SNn0n+fCVyMlqxlySuhHeuOLaET0+35NNr28= X-Gm-Gg: ASbGncssenmFXiFf0n/k0JUq34mIGct3FhFf/usd9GSCqffJpXiakEf08mzg6Dgk48k X1UT7uE1sKkhQPyJ6MIf5q0dX75nx3j2db3eMqNBBLgE9zvghG5lr60Q51xcqIh37DxQHyZm/B5 TrSnUYmiF/73DRd/rKhfJl1Foazxut8IoHfZWIAFR1P9Y26hbW9iC7WoIcTNvQqxVZzqtBOfr0m Le5EsWSHItprfq2zTjzmz8mK4N4DSCQC+k1nl/eGwa8FjdV7T4qVGh7ow28IB7ea4YqYZA3 X-Google-Smtp-Source: AGHT+IGoehB7Jsy/fQWFlR4DVX8ECKNmLPVKe1SJ1dbXqS/A2Sjgy4gw2TgD2gOPLaPC4tZrLmGMOg== X-Received: by 2002:a17:90b:3e82:b0:2ee:edae:775 with SMTP id 98e67ed59e1d1-2f29153c0c4mr758238a91.3.1734050014020; Thu, 12 Dec 2024 16:33:34 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:33 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:33:00 -0800 Subject: [PATCH v2 10/16] perf tools: parisc: Support syscall header MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-10-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=24390; i=charlie@rivosinc.com; h=from:subject:message-id; bh=t4LOMueQ9p5X7gLEVH0HpkQafnL4Wqs8A6ESzwm+IH4=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w/5Hc0z4Gw5b3lhWufnHeYsd9frZkmcdOQ7IPBLsX 8Bn/X9jRykLgxgHg6yYIgvPtQbm1jv6ZUdFyybAzGFlAhnCwMUpABOJrWRk+FmUsc/inmHViy8O F00OBawvaUiIy59rG84+R7ns5aXf2gz/FBZO0Wudwro6nac7LHBZLD/PzHMhxgm/OU/OaL/cYdr PCgA= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163335_028752_47AC0690 X-CRM114-Status: GOOD ( 14.72 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org parisc uses a syscall table, use that in perf instead of requiring libaudit. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 2 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/parisc/entry/syscalls/Kbuild | 3 + .../arch/parisc/entry/syscalls/Makefile.syscalls | 6 + tools/perf/arch/parisc/entry/syscalls/syscall.tbl | 463 +++++++++++++++++++++ tools/perf/arch/parisc/include/syscall_table.h | 8 + tools/perf/check-headers.sh | 1 + 7 files changed, 483 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 802a8aa3a4fcd91ef7b7400373ce40736dfae0a1..bf88840528a2e700983bd6ca4ca8b199ce93bc21 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -36,7 +36,7 @@ ifneq ($(NO_SYSCALL_TABLE),1) endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 178a96bfc50e78f7c843f67d850b7cc323e163b6..b64d06a999f679b64a158d73a213954f30ae4702 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/parisc/entry/syscalls/Kbuild b/tools/perf/arch/parisc/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..84c6599b4ea6a160217a3496449b205f2263f0fb --- /dev/null +++ b/tools/perf/arch/parisc/entry/syscalls/Kbuild @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_32.h +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/parisc/entry/syscalls/Makefile.syscalls b/tools/perf/arch/parisc/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..ae326fecb83b307fb5b0a885ae109480aafd586f --- /dev/null +++ b/tools/perf/arch/parisc/entry/syscalls/Makefile.syscalls @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += +syscall_abis_64 += + +syscalltbl = $(srctree)/tools/perf/arch/parisc/entry/syscalls/syscall.tbl diff --git a/tools/perf/arch/parisc/entry/syscalls/syscall.tbl b/tools/perf/arch/parisc/entry/syscalls/syscall.tbl new file mode 100644 index 0000000000000000000000000000000000000000..66dc406b12e4482832b0e8836b8267b0fb37a5ed --- /dev/null +++ b/tools/perf/arch/parisc/entry/syscalls/syscall.tbl @@ -0,0 +1,463 @@ +# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note +# +# system call numbers and entry vectors for parisc +# +# The format is: +# +# +# The can be common, 64, or 32 for this file. +# +0 common restart_syscall sys_restart_syscall +1 common exit sys_exit +2 common fork sys_fork_wrapper +3 common read sys_read +4 common write sys_write +5 common open sys_open compat_sys_open +6 common close sys_close +7 common waitpid sys_waitpid +8 common creat sys_creat +9 common link sys_link +10 common unlink sys_unlink +11 common execve sys_execve compat_sys_execve +12 common chdir sys_chdir +13 32 time sys_time32 +13 64 time sys_time +14 common mknod sys_mknod +15 common chmod sys_chmod +16 common lchown sys_lchown +17 common socket sys_socket +18 common stat sys_newstat compat_sys_newstat +19 common lseek sys_lseek compat_sys_lseek +20 common getpid sys_getpid +21 common mount sys_mount +22 common bind sys_bind +23 common setuid sys_setuid +24 common getuid sys_getuid +25 32 stime sys_stime32 +25 64 stime sys_stime +26 common ptrace sys_ptrace compat_sys_ptrace +27 common alarm sys_alarm +28 common fstat sys_newfstat compat_sys_newfstat +29 common pause sys_pause +30 32 utime sys_utime32 +30 64 utime sys_utime +31 common connect sys_connect +32 common listen sys_listen +33 common access sys_access +34 common nice sys_nice +35 common accept sys_accept +36 common sync sys_sync +37 common kill sys_kill +38 common rename sys_rename +39 common mkdir sys_mkdir +40 common rmdir sys_rmdir +41 common dup sys_dup +42 common pipe sys_pipe +43 common times sys_times compat_sys_times +44 common getsockname sys_getsockname +45 common brk sys_brk +46 common setgid sys_setgid +47 common getgid sys_getgid +48 common signal sys_signal +49 common geteuid sys_geteuid +50 common getegid sys_getegid +51 common acct sys_acct +52 common umount2 sys_umount +53 common getpeername sys_getpeername +54 common ioctl sys_ioctl compat_sys_ioctl +55 common fcntl sys_fcntl compat_sys_fcntl +56 common socketpair sys_socketpair +57 common setpgid sys_setpgid +58 common send sys_send +59 common uname sys_newuname +60 common umask sys_umask +61 common chroot sys_chroot +62 common ustat sys_ustat compat_sys_ustat +63 common dup2 sys_dup2 +64 common getppid sys_getppid +65 common getpgrp sys_getpgrp +66 common setsid sys_setsid +67 common pivot_root sys_pivot_root +68 common sgetmask sys_sgetmask sys32_unimplemented +69 common ssetmask sys_ssetmask sys32_unimplemented +70 common setreuid sys_setreuid +71 common setregid sys_setregid +72 common mincore sys_mincore +73 common sigpending sys_sigpending compat_sys_sigpending +74 common sethostname sys_sethostname +75 common setrlimit sys_setrlimit compat_sys_setrlimit +76 common getrlimit sys_getrlimit compat_sys_getrlimit +77 common getrusage sys_getrusage compat_sys_getrusage +78 common gettimeofday sys_gettimeofday compat_sys_gettimeofday +79 common settimeofday sys_settimeofday compat_sys_settimeofday +80 common getgroups sys_getgroups +81 common setgroups sys_setgroups +82 common sendto sys_sendto +83 common symlink sys_symlink +84 common lstat sys_newlstat compat_sys_newlstat +85 common readlink sys_readlink +86 common uselib sys_ni_syscall +87 common swapon sys_swapon +88 common reboot sys_reboot +89 common mmap2 sys_mmap2 +90 common mmap sys_mmap +91 common munmap sys_munmap +92 common truncate sys_truncate compat_sys_truncate +93 common ftruncate sys_ftruncate compat_sys_ftruncate +94 common fchmod sys_fchmod +95 common fchown sys_fchown +96 common getpriority sys_getpriority +97 common setpriority sys_setpriority +98 common recv sys_recv compat_sys_recv +99 common statfs sys_statfs compat_sys_statfs +100 common fstatfs sys_fstatfs compat_sys_fstatfs +101 common stat64 sys_stat64 +# 102 was socketcall +103 common syslog sys_syslog +104 common setitimer sys_setitimer compat_sys_setitimer +105 common getitimer sys_getitimer compat_sys_getitimer +106 common capget sys_capget +107 common capset sys_capset +108 32 pread64 parisc_pread64 +108 64 pread64 sys_pread64 +109 32 pwrite64 parisc_pwrite64 +109 64 pwrite64 sys_pwrite64 +110 common getcwd sys_getcwd +111 common vhangup sys_vhangup +112 common fstat64 sys_fstat64 +113 common vfork sys_vfork_wrapper +114 common wait4 sys_wait4 compat_sys_wait4 +115 common swapoff sys_swapoff +116 common sysinfo sys_sysinfo compat_sys_sysinfo +117 common shutdown sys_shutdown +118 common fsync sys_fsync +119 common madvise parisc_madvise +120 common clone sys_clone_wrapper +121 common setdomainname sys_setdomainname +122 common sendfile sys_sendfile compat_sys_sendfile +123 common recvfrom sys_recvfrom compat_sys_recvfrom +124 32 adjtimex sys_adjtimex_time32 +124 64 adjtimex sys_adjtimex +125 common mprotect sys_mprotect +126 common sigprocmask sys_sigprocmask compat_sys_sigprocmask +# 127 was create_module +128 common init_module sys_init_module +129 common delete_module sys_delete_module +# 130 was get_kernel_syms +131 common quotactl sys_quotactl +132 common getpgid sys_getpgid +133 common fchdir sys_fchdir +134 common bdflush sys_ni_syscall +135 common sysfs sys_sysfs +136 32 personality parisc_personality +136 64 personality sys_personality +# 137 was afs_syscall +138 common setfsuid sys_setfsuid +139 common setfsgid sys_setfsgid +140 common _llseek sys_llseek +141 common getdents sys_getdents compat_sys_getdents +142 common _newselect sys_select compat_sys_select +143 common flock sys_flock +144 common msync sys_msync +145 common readv sys_readv +146 common writev sys_writev +147 common getsid sys_getsid +148 common fdatasync sys_fdatasync +149 common _sysctl sys_ni_syscall +150 common mlock sys_mlock +151 common munlock sys_munlock +152 common mlockall sys_mlockall +153 common munlockall sys_munlockall +154 common sched_setparam sys_sched_setparam +155 common sched_getparam sys_sched_getparam +156 common sched_setscheduler sys_sched_setscheduler +157 common sched_getscheduler sys_sched_getscheduler +158 common sched_yield sys_sched_yield +159 common sched_get_priority_max sys_sched_get_priority_max +160 common sched_get_priority_min sys_sched_get_priority_min +161 32 sched_rr_get_interval sys_sched_rr_get_interval_time32 +161 64 sched_rr_get_interval sys_sched_rr_get_interval +162 32 nanosleep sys_nanosleep_time32 +162 64 nanosleep sys_nanosleep +163 common mremap sys_mremap +164 common setresuid sys_setresuid +165 common getresuid sys_getresuid +166 common sigaltstack sys_sigaltstack compat_sys_sigaltstack +# 167 was query_module +168 common poll sys_poll +# 169 was nfsservctl +170 common setresgid sys_setresgid +171 common getresgid sys_getresgid +172 common prctl sys_prctl +173 common rt_sigreturn sys_rt_sigreturn_wrapper +174 common rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction +175 common rt_sigprocmask sys_rt_sigprocmask compat_sys_rt_sigprocmask +176 common rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending +177 32 rt_sigtimedwait sys_rt_sigtimedwait_time32 compat_sys_rt_sigtimedwait_time32 +177 64 rt_sigtimedwait sys_rt_sigtimedwait +178 common rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo +179 common rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend +180 common chown sys_chown +181 common setsockopt sys_setsockopt sys_setsockopt +182 common getsockopt sys_getsockopt sys_getsockopt +183 common sendmsg sys_sendmsg compat_sys_sendmsg +184 common recvmsg sys_recvmsg compat_sys_recvmsg +185 common semop sys_semop +186 common semget sys_semget +187 common semctl sys_semctl compat_sys_semctl +188 common msgsnd sys_msgsnd compat_sys_msgsnd +189 common msgrcv sys_msgrcv compat_sys_msgrcv +190 common msgget sys_msgget +191 common msgctl sys_msgctl compat_sys_msgctl +192 common shmat sys_shmat compat_sys_shmat +193 common shmdt sys_shmdt +194 common shmget sys_shmget +195 common shmctl sys_shmctl compat_sys_shmctl +# 196 was getpmsg +# 197 was putpmsg +198 common lstat64 sys_lstat64 +199 32 truncate64 parisc_truncate64 +199 64 truncate64 sys_truncate64 +200 32 ftruncate64 parisc_ftruncate64 +200 64 ftruncate64 sys_ftruncate64 +201 common getdents64 sys_getdents64 +202 common fcntl64 sys_fcntl64 compat_sys_fcntl64 +# 203 was attrctl +# 204 was acl_get +# 205 was acl_set +206 common gettid sys_gettid +207 32 readahead parisc_readahead +207 64 readahead sys_readahead +208 common tkill sys_tkill +209 common sendfile64 sys_sendfile64 compat_sys_sendfile64 +210 32 futex sys_futex_time32 +210 64 futex sys_futex +211 common sched_setaffinity sys_sched_setaffinity compat_sys_sched_setaffinity +212 common sched_getaffinity sys_sched_getaffinity compat_sys_sched_getaffinity +# 213 was set_thread_area +# 214 was get_thread_area +215 common io_setup sys_io_setup compat_sys_io_setup +216 common io_destroy sys_io_destroy +217 32 io_getevents sys_io_getevents_time32 +217 64 io_getevents sys_io_getevents +218 common io_submit sys_io_submit compat_sys_io_submit +219 common io_cancel sys_io_cancel +# 220 was alloc_hugepages +# 221 was free_hugepages +222 common exit_group sys_exit_group +223 common lookup_dcookie sys_ni_syscall +224 common epoll_create sys_epoll_create +225 common epoll_ctl sys_epoll_ctl +226 common epoll_wait sys_epoll_wait +227 common remap_file_pages sys_remap_file_pages +228 32 semtimedop sys_semtimedop_time32 +228 64 semtimedop sys_semtimedop +229 common mq_open sys_mq_open compat_sys_mq_open +230 common mq_unlink sys_mq_unlink +231 32 mq_timedsend sys_mq_timedsend_time32 +231 64 mq_timedsend sys_mq_timedsend +232 32 mq_timedreceive sys_mq_timedreceive_time32 +232 64 mq_timedreceive sys_mq_timedreceive +233 common mq_notify sys_mq_notify compat_sys_mq_notify +234 common mq_getsetattr sys_mq_getsetattr compat_sys_mq_getsetattr +235 common waitid sys_waitid compat_sys_waitid +236 32 fadvise64_64 parisc_fadvise64_64 +236 64 fadvise64_64 sys_fadvise64_64 +237 common set_tid_address sys_set_tid_address +238 common setxattr sys_setxattr +239 common lsetxattr sys_lsetxattr +240 common fsetxattr sys_fsetxattr +241 common getxattr sys_getxattr +242 common lgetxattr sys_lgetxattr +243 common fgetxattr sys_fgetxattr +244 common listxattr sys_listxattr +245 common llistxattr sys_llistxattr +246 common flistxattr sys_flistxattr +247 common removexattr sys_removexattr +248 common lremovexattr sys_lremovexattr +249 common fremovexattr sys_fremovexattr +250 common timer_create sys_timer_create compat_sys_timer_create +251 32 timer_settime sys_timer_settime32 +251 64 timer_settime sys_timer_settime +252 32 timer_gettime sys_timer_gettime32 +252 64 timer_gettime sys_timer_gettime +253 common timer_getoverrun sys_timer_getoverrun +254 common timer_delete sys_timer_delete +255 32 clock_settime sys_clock_settime32 +255 64 clock_settime sys_clock_settime +256 32 clock_gettime sys_clock_gettime32 +256 64 clock_gettime sys_clock_gettime +257 32 clock_getres sys_clock_getres_time32 +257 64 clock_getres sys_clock_getres +258 32 clock_nanosleep sys_clock_nanosleep_time32 +258 64 clock_nanosleep sys_clock_nanosleep +259 common tgkill sys_tgkill +260 common mbind sys_mbind +261 common get_mempolicy sys_get_mempolicy +262 common set_mempolicy sys_set_mempolicy +# 263 was vserver +264 common add_key sys_add_key +265 common request_key sys_request_key +266 common keyctl sys_keyctl compat_sys_keyctl +267 common ioprio_set sys_ioprio_set +268 common ioprio_get sys_ioprio_get +269 common inotify_init sys_inotify_init +270 common inotify_add_watch sys_inotify_add_watch +271 common inotify_rm_watch sys_inotify_rm_watch +272 common migrate_pages sys_migrate_pages +273 32 pselect6 sys_pselect6_time32 compat_sys_pselect6_time32 +273 64 pselect6 sys_pselect6 +274 32 ppoll sys_ppoll_time32 compat_sys_ppoll_time32 +274 64 ppoll sys_ppoll +275 common openat sys_openat compat_sys_openat +276 common mkdirat sys_mkdirat +277 common mknodat sys_mknodat +278 common fchownat sys_fchownat +279 32 futimesat sys_futimesat_time32 +279 64 futimesat sys_futimesat +280 common fstatat64 sys_fstatat64 +281 common unlinkat sys_unlinkat +282 common renameat sys_renameat +283 common linkat sys_linkat +284 common symlinkat sys_symlinkat +285 common readlinkat sys_readlinkat +286 common fchmodat sys_fchmodat +287 common faccessat sys_faccessat +288 common unshare sys_unshare +289 common set_robust_list sys_set_robust_list compat_sys_set_robust_list +290 common get_robust_list sys_get_robust_list compat_sys_get_robust_list +291 common splice sys_splice +292 32 sync_file_range parisc_sync_file_range +292 64 sync_file_range sys_sync_file_range +293 common tee sys_tee +294 common vmsplice sys_vmsplice +295 common move_pages sys_move_pages +296 common getcpu sys_getcpu +297 common epoll_pwait sys_epoll_pwait compat_sys_epoll_pwait +298 common statfs64 sys_statfs64 compat_sys_statfs64 +299 common fstatfs64 sys_fstatfs64 compat_sys_fstatfs64 +300 common kexec_load sys_kexec_load compat_sys_kexec_load +301 32 utimensat sys_utimensat_time32 +301 64 utimensat sys_utimensat +302 common signalfd sys_signalfd compat_sys_signalfd +# 303 was timerfd +304 common eventfd sys_eventfd +305 32 fallocate parisc_fallocate +305 64 fallocate sys_fallocate +306 common timerfd_create parisc_timerfd_create +307 32 timerfd_settime sys_timerfd_settime32 +307 64 timerfd_settime sys_timerfd_settime +308 32 timerfd_gettime sys_timerfd_gettime32 +308 64 timerfd_gettime sys_timerfd_gettime +309 common signalfd4 parisc_signalfd4 parisc_compat_signalfd4 +310 common eventfd2 parisc_eventfd2 +311 common epoll_create1 sys_epoll_create1 +312 common dup3 sys_dup3 +313 common pipe2 parisc_pipe2 +314 common inotify_init1 parisc_inotify_init1 +315 common preadv sys_preadv compat_sys_preadv +316 common pwritev sys_pwritev compat_sys_pwritev +317 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo +318 common perf_event_open sys_perf_event_open +319 32 recvmmsg sys_recvmmsg_time32 compat_sys_recvmmsg_time32 +319 64 recvmmsg sys_recvmmsg +320 common accept4 sys_accept4 +321 common prlimit64 sys_prlimit64 +322 common fanotify_init sys_fanotify_init +323 common fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark +324 32 clock_adjtime sys_clock_adjtime32 +324 64 clock_adjtime sys_clock_adjtime +325 common name_to_handle_at sys_name_to_handle_at +326 common open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at +327 common syncfs sys_syncfs +328 common setns sys_setns +329 common sendmmsg sys_sendmmsg compat_sys_sendmmsg +330 common process_vm_readv sys_process_vm_readv +331 common process_vm_writev sys_process_vm_writev +332 common kcmp sys_kcmp +333 common finit_module sys_finit_module +334 common sched_setattr sys_sched_setattr +335 common sched_getattr sys_sched_getattr +336 32 utimes sys_utimes_time32 +336 64 utimes sys_utimes +337 common renameat2 sys_renameat2 +338 common seccomp sys_seccomp +339 common getrandom sys_getrandom +340 common memfd_create sys_memfd_create +341 common bpf sys_bpf +342 common execveat sys_execveat compat_sys_execveat +343 common membarrier sys_membarrier +344 common userfaultfd parisc_userfaultfd +345 common mlock2 sys_mlock2 +346 common copy_file_range sys_copy_file_range +347 common preadv2 sys_preadv2 compat_sys_preadv2 +348 common pwritev2 sys_pwritev2 compat_sys_pwritev2 +349 common statx sys_statx +350 32 io_pgetevents sys_io_pgetevents_time32 compat_sys_io_pgetevents +350 64 io_pgetevents sys_io_pgetevents +351 common pkey_mprotect sys_pkey_mprotect +352 common pkey_alloc sys_pkey_alloc +353 common pkey_free sys_pkey_free +354 common rseq sys_rseq +355 common kexec_file_load sys_kexec_file_load sys_kexec_file_load +356 common cacheflush sys_cacheflush +# up to 402 is unassigned and reserved for arch specific syscalls +403 32 clock_gettime64 sys_clock_gettime sys_clock_gettime +404 32 clock_settime64 sys_clock_settime sys_clock_settime +405 32 clock_adjtime64 sys_clock_adjtime sys_clock_adjtime +406 32 clock_getres_time64 sys_clock_getres sys_clock_getres +407 32 clock_nanosleep_time64 sys_clock_nanosleep sys_clock_nanosleep +408 32 timer_gettime64 sys_timer_gettime sys_timer_gettime +409 32 timer_settime64 sys_timer_settime sys_timer_settime +410 32 timerfd_gettime64 sys_timerfd_gettime sys_timerfd_gettime +411 32 timerfd_settime64 sys_timerfd_settime sys_timerfd_settime +412 32 utimensat_time64 sys_utimensat sys_utimensat +413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 +414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64 +416 32 io_pgetevents_time64 sys_io_pgetevents compat_sys_io_pgetevents_time64 +417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 +418 32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend +419 32 mq_timedreceive_time64 sys_mq_timedreceive sys_mq_timedreceive +420 32 semtimedop_time64 sys_semtimedop sys_semtimedop +421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 +422 32 futex_time64 sys_futex sys_futex +423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval +424 common pidfd_send_signal sys_pidfd_send_signal +425 common io_uring_setup sys_io_uring_setup +426 common io_uring_enter sys_io_uring_enter +427 common io_uring_register sys_io_uring_register +428 common open_tree sys_open_tree +429 common move_mount sys_move_mount +430 common fsopen sys_fsopen +431 common fsconfig sys_fsconfig +432 common fsmount sys_fsmount +433 common fspick sys_fspick +434 common pidfd_open sys_pidfd_open +435 common clone3 sys_clone3_wrapper +436 common close_range sys_close_range +437 common openat2 sys_openat2 +438 common pidfd_getfd sys_pidfd_getfd +439 common faccessat2 sys_faccessat2 +440 common process_madvise sys_process_madvise +441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 +442 common mount_setattr sys_mount_setattr +443 common quotactl_fd sys_quotactl_fd +444 common landlock_create_ruleset sys_landlock_create_ruleset +445 common landlock_add_rule sys_landlock_add_rule +446 common landlock_restrict_self sys_landlock_restrict_self +# 447 reserved for memfd_secret +448 common process_mrelease sys_process_mrelease +449 common futex_waitv sys_futex_waitv +450 common set_mempolicy_home_node sys_set_mempolicy_home_node +451 common cachestat sys_cachestat +452 common fchmodat2 sys_fchmodat2 +453 common map_shadow_stack sys_map_shadow_stack +454 common futex_wake sys_futex_wake +455 common futex_wait sys_futex_wait +456 common futex_requeue sys_futex_requeue +457 common statmount sys_statmount +458 common listmount sys_listmount +459 common lsm_get_self_attr sys_lsm_get_self_attr +460 common lsm_set_self_attr sys_lsm_set_self_attr +461 common lsm_list_modules sys_lsm_list_modules +462 common mseal sys_mseal diff --git a/tools/perf/arch/parisc/include/syscall_table.h b/tools/perf/arch/parisc/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..7ff51b783000d727ec48be960730b81ecdb05575 --- /dev/null +++ b/tools/perf/arch/parisc/include/syscall_table.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include + +#if __BITS_PER_LONG == 64 +#include +#else +#include +#endif diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index a821df1fd4c0e78c9706304e5b8974cbc5ef4437..ae9f00ae79f34fec75ef2c91300ccd771c030529 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -207,6 +207,7 @@ check_2 tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/kernel/syscalls/sy check_2 tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/sparc/kernel/syscalls/syscall.tbl check_2 tools/perf/arch/xtensa/entry/syscalls/syscall.tbl arch/xtensa/kernel/syscalls/syscall.tbl check_2 tools/perf/arch/alpha/entry/syscalls/syscall.tbl arch/alpha/entry/syscalls/syscall.tbl +check_2 tools/perf/arch/parisc/entry/syscalls/syscall.tbl arch/parisc/entry/syscalls/syscall.tbl for i in "${BEAUTY_FILES[@]}" do From patchwork Fri Dec 13 00:33:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9618CE77182 for ; Fri, 13 Dec 2024 00:46:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+eT8z8Jsz4cK89gCItwoVi+dExs4CJXiGcTHohdj6yM=; b=cBzdAurNiJmVe5 XKvascLeoSRV8l8sAbizrSoUyfFnVr3m2X5/1YgDMO+6dkvXaAb8lJ0vPuQx+ipWIm75JRdBrgWDm ctxz6xWn1nkleRNEqOivYaCPf7dZ9U241Vud7nXfxQD2gb8MVTAvEzfY0sofNnCZRD19ZxknCrrp8 nkCcp8EdNXVChrDbbOTOqetCNjsGQ/H0GMdqmhmITiaalqW0IUcRVx/QEf33RYGYD04MDdCW6iTZd JAwUosPg5V2Wn6HtjCyVGQJXha+0ClavAtvYUIANv/7j7LKNNMpmWj+dLQWqvtdAmhf2YQSF1KiHp JGOMzIu05OtKOUhAaSaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLtot-00000002Kw8-2rAD; Fri, 13 Dec 2024 00:46:15 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcf-00000002ID4-378q for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:40 +0000 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-8019f048bc7so904853a12.1 for ; Thu, 12 Dec 2024 16:33:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050017; x=1734654817; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+HenWMeGh4kAbYR9t7BvDO7+uAdDd2bkf5B0cZ/CzUA=; b=LS0n0eGcUAwK9NCy28sKaucRVMeiA0gfgGlrDFXyonhdrvZPKBwCrgZI4L5g9XmxtI VJysULgnQ8S/45rdJE7l6G4HcMPOXyq/PzdZtCm1ftkOBi8bneFI2QgkslBjUoz9jEMN uVrqZ5QGdZCbSxIJK4t2E1MJG4P08tDM6PUgLQ0p0ptwkRu4EmwtjHJZ+VX9dkUcfQeK 6XzFj9g4HpdIyk218zXoZ/g9X1v1SzsuhlLit0FEZQk/6Kf9ISDBrH7Zfe5ZBrte6YxI ZDfwrfdPu9c8nUUN3sdhob2ubnuOPW3xcEin83rPeKsDU/ivafu4wSn4NGQGEPY1eWLV KXOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050017; x=1734654817; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+HenWMeGh4kAbYR9t7BvDO7+uAdDd2bkf5B0cZ/CzUA=; b=aW4QHagFE7H4PsHZt3m5zHSgkEh7n2j5dpXIammGBWExCfVck969P/z/CGOFUrMN+a voT5nLFpOsSeQpKN8N3upiy82PmzIkdJHgiGk+i0X4UV3CCzCgiHbmSz5F4qLfwrEw0B yXvQeHs7GpGKFueqARuu3xEJ3VSnt72UE+3psI9yoTJj3qIdo5Uhl3jdFs9055LPwlZK wm5kprxbhF4I6fI0JptwKgVlTswLkvJ5xhvQWtol0H5DpzAk06ZcxoMgYJCUCIGtw5wc yuW1NRqYPwlEz0bUOp0nEA7puuJ5OpVldJLpa/q/AFRhfZgoHJmioqviM3hLN6WmXiSz zMow== X-Forwarded-Encrypted: i=1; AJvYcCVMs9P83ewbfrpog0fnCX7l/y8jxJjI1946zrwB+ZScbikWiP0qbOumi1b5C3xhIjof2mS1xmIOexOIDg==@lists.infradead.org X-Gm-Message-State: AOJu0Yyh0Zg1ju+YXpHebjW0DDqSYJOBg7SekqaiHTF8POurGnjaGwjs Ju7oZr958XTQeuGOpvwBMDI8erI5krffezhsV3nGPC53knoW+pamjgWoUnOdA1w= X-Gm-Gg: ASbGnctmQALlRyrX44MNIfGzydf/RifFufPJmQJstC2fa8/UNWjE82mrKIJQDt3G3f7 HW0lkFwRiJ0pmOjDhFZp0fuezeanofHFwNNasZISBeeRgxv0cEWU20tV1rcrJmeB9Bt7VwW0mWM JjhSBXFX5UzmcVuUZucSRLbDlv8AOCxP9096PjVxklDt0BLIMl5/Ujvlm3CCwo85jQElgLvXUMl BaJ9PCu36N0jQ3+twcFFCKKx5lZ5+iZgIpPiEzNuAYCr0R7om41PVCLNSCNORmI+f/1V88g X-Google-Smtp-Source: AGHT+IGFr7iD0oVKjTfkj6Egz2p76t/e5Kg7od7ykJe2c9o+wAfbD5N/hgAssXC8jLb4S6T4Qwzuvw== X-Received: by 2002:a17:90b:4a09:b0:2ee:5bc9:75c7 with SMTP id 98e67ed59e1d1-2f28fa55c38mr1117715a91.5.1734050016653; Thu, 12 Dec 2024 16:33:36 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:35 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:33:01 -0800 Subject: [PATCH v2 11/16] perf tools: arm64: Use syscall table MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-11-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=28964; i=charlie@rivosinc.com; h=from:subject:message-id; bh=7ttteN6jJNiJ743CBfUquONgd/7tisg0Po/62UU9U2Y=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0wwGVgK3Sn9c8XJ4u3e0xYcO3pQdes/wJqZsWmnBEf K/g0ZLEjlIWBjEOBlkxRRaeaw3MrXf0y46Klk2AmcPKBDKEgYtTACbyp4bhf/aKWfzuISpi0lFn ljxkPDHb5euiSausxO+n61lfdM9qCGX47xN5+pTkmYLDXy8dOTyt+o/Qg0fv8n3nfU5+9pRTsX2 HNBsA X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163337_795413_A319B6A0 X-CRM114-Status: GOOD ( 16.79 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org arm64 uses a syscall table, use that in perf instead of using unistd.h. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 5 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/arm64/Makefile | 22 - tools/perf/arch/arm64/entry/syscalls/Kbuild | 3 + .../arch/arm64/entry/syscalls/Makefile.syscalls | 6 + tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 46 -- .../perf/arch/arm64/entry/syscalls/syscall_32.tbl | 476 +++++++++++++++++++++ .../perf/arch/arm64/entry/syscalls/syscall_64.tbl | 1 + tools/perf/arch/arm64/include/syscall_table.h | 8 + tools/perf/check-headers.sh | 2 + tools/perf/util/syscalltbl.c | 4 - 11 files changed, 499 insertions(+), 76 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index bf88840528a2e700983bd6ca4ca8b199ce93bc21..aefcbed7cdfac7c2a5d8db5cb111513f2d7c74ed 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,12 +31,12 @@ $(call detected_var,SRCARCH) ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE := 1 - ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc arm64 s390 mips loongarch)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390 mips loongarch)) NO_SYSCALL_TABLE := 0 endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated @@ -71,7 +71,6 @@ ifeq ($(SRCARCH),arm) endif ifeq ($(SRCARCH),arm64) - CFLAGS += -I$(OUTPUT)arch/arm64/include/generated LIBUNWIND_LIBS = -lunwind -lunwind-aarch64 endif diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index b64d06a999f679b64a158d73a213954f30ae4702..6a287f15fa1da5e8957558ee0a73b297d347f00d 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/arm64/Makefile b/tools/perf/arch/arm64/Makefile index 91570d5d428e401d940e1c31332ebb40c4b998d8..087e099fb453a9236db34878077a51f711881ce0 100644 --- a/tools/perf/arch/arm64/Makefile +++ b/tools/perf/arch/arm64/Makefile @@ -1,25 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 PERF_HAVE_JITDUMP := 1 HAVE_KVM_STAT_SUPPORT := 1 - -# -# Syscall table generation for perf -# - -out := $(OUTPUT)arch/arm64/include/generated/asm -header := $(out)/syscalls.c -incpath := $(srctree)/tools -sysdef := $(srctree)/tools/arch/arm64/include/uapi/asm/unistd.h -sysprf := $(srctree)/tools/perf/arch/arm64/entry/syscalls/ -systbl := $(sysprf)/mksyscalltbl - -# Create output directory if not already present -$(shell [ -d '$(out)' ] || mkdir -p '$(out)') - -$(header): $(sysdef) $(systbl) - $(Q)$(SHELL) '$(systbl)' '$(CC)' '$(HOSTCC)' $(incpath) $(sysdef) > $@ - -clean:: - $(call QUIET_CLEAN, arm64) $(RM) $(header) - -archheaders: $(header) diff --git a/tools/perf/arch/arm64/entry/syscalls/Kbuild b/tools/perf/arch/arm64/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..84c6599b4ea6a160217a3496449b205f2263f0fb --- /dev/null +++ b/tools/perf/arch/arm64/entry/syscalls/Kbuild @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_32.h +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/arm64/entry/syscalls/Makefile.syscalls b/tools/perf/arch/arm64/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..e7e78c2d1c025b6954a1a22d44a744012e1ca3d4 --- /dev/null +++ b/tools/perf/arch/arm64/entry/syscalls/Makefile.syscalls @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += +syscall_abis_64 += renameat rlimit memfd_secret + +syscalltbl = $(srctree)/tools/perf/arch/arm64/entry/syscalls/syscall_%.tbl diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl deleted file mode 100755 index 27d747c92d44c04f26ce7aef766a50e3f896f5ff..0000000000000000000000000000000000000000 --- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# -# Generate system call table for perf. Derived from -# powerpc script. -# -# Copyright IBM Corp. 2017 -# Author(s): Hendrik Brueckner -# Changed by: Ravi Bangoria -# Changed by: Kim Phillips - -gcc=$1 -hostcc=$2 -incpath=$3 -input=$4 - -if ! test -r $input; then - echo "Could not read input file" >&2 - exit 1 -fi - -create_sc_table() -{ - local sc nr max_nr - - while read sc nr; do - printf "%s\n" " [$nr] = \"$sc\"," - max_nr=$nr - done - - echo "#define SYSCALLTBL_ARM64_MAX_ID $max_nr" -} - -create_table() -{ - echo "#include \"$input\"" - echo "static const char *const syscalltbl_arm64[] = {" - create_sc_table - echo "};" -} - -$gcc -E -dM -x c -I $incpath/include/uapi $input \ - |awk '$2 ~ "__NR" && $3 !~ "__NR3264_" { - sub("^#define __NR(3264)?_", ""); - print | "sort -k2 -n"}' \ - |create_table diff --git a/tools/perf/arch/arm64/entry/syscalls/syscall_32.tbl b/tools/perf/arch/arm64/entry/syscalls/syscall_32.tbl new file mode 100644 index 0000000000000000000000000000000000000000..9a37930d4e26f0c6cb8fe78f76bb1a4f32cbea16 --- /dev/null +++ b/tools/perf/arch/arm64/entry/syscalls/syscall_32.tbl @@ -0,0 +1,476 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# AArch32 (compat) system call definitions. +# +# Copyright (C) 2001-2005 Russell King +# Copyright (C) 2012 ARM Ltd. +# +# This file corresponds to arch/arm/tools/syscall.tbl +# for the native EABI syscalls and should be kept in sync +# Instead of the OABI syscalls, it contains pointers to +# the compat entry points where they differ from the native +# syscalls. +# +0 common restart_syscall sys_restart_syscall +1 common exit sys_exit +2 common fork sys_fork +3 common read sys_read +4 common write sys_write +5 common open sys_open compat_sys_open +6 common close sys_close +# 7 was sys_waitpid +8 common creat sys_creat +9 common link sys_link +10 common unlink sys_unlink +11 common execve sys_execve compat_sys_execve +12 common chdir sys_chdir +# 13 was sys_time +14 common mknod sys_mknod +15 common chmod sys_chmod +16 common lchown sys_lchown16 +# 17 was sys_break +# 18 was sys_stat +19 common lseek sys_lseek compat_sys_lseek +20 common getpid sys_getpid +21 common mount sys_mount +# 22 was sys_umount +23 common setuid sys_setuid16 +24 common getuid sys_getuid16 +# 25 was sys_stime +26 common ptrace sys_ptrace compat_sys_ptrace +# 27 was sys_alarm +# 28 was sys_fstat +29 common pause sys_pause +# 30 was sys_utime +# 31 was sys_stty +# 32 was sys_gtty +33 common access sys_access +34 common nice sys_nice +# 35 was sys_ftime +36 common sync sys_sync +37 common kill sys_kill +38 common rename sys_rename +39 common mkdir sys_mkdir +40 common rmdir sys_rmdir +41 common dup sys_dup +42 common pipe sys_pipe +43 common times sys_times compat_sys_times +# 44 was sys_prof +45 common brk sys_brk +46 common setgid sys_setgid16 +47 common getgid sys_getgid16 +# 48 was sys_signal +49 common geteuid sys_geteuid16 +50 common getegid sys_getegid16 +51 common acct sys_acct +52 common umount2 sys_umount +# 53 was sys_lock +54 common ioctl sys_ioctl compat_sys_ioctl +55 common fcntl sys_fcntl compat_sys_fcntl +# 56 was sys_mpx +57 common setpgid sys_setpgid +# 58 was sys_ulimit +# 59 was sys_olduname +60 common umask sys_umask +61 common chroot sys_chroot +62 common ustat sys_ustat compat_sys_ustat +63 common dup2 sys_dup2 +64 common getppid sys_getppid +65 common getpgrp sys_getpgrp +66 common setsid sys_setsid +67 common sigaction sys_sigaction compat_sys_sigaction +# 68 was sys_sgetmask +# 69 was sys_ssetmask +70 common setreuid sys_setreuid16 +71 common setregid sys_setregid16 +72 common sigsuspend sys_sigsuspend +73 common sigpending sys_sigpending compat_sys_sigpending +74 common sethostname sys_sethostname +75 common setrlimit sys_setrlimit compat_sys_setrlimit +# 76 was compat_sys_getrlimit +77 common getrusage sys_getrusage compat_sys_getrusage +78 common gettimeofday sys_gettimeofday compat_sys_gettimeofday +79 common settimeofday sys_settimeofday compat_sys_settimeofday +80 common getgroups sys_getgroups16 +81 common setgroups sys_setgroups16 +# 82 was compat_sys_select +83 common symlink sys_symlink +# 84 was sys_lstat +85 common readlink sys_readlink +86 common uselib sys_uselib +87 common swapon sys_swapon +88 common reboot sys_reboot +# 89 was sys_readdir +# 90 was sys_mmap +91 common munmap sys_munmap +92 common truncate sys_truncate compat_sys_truncate +93 common ftruncate sys_ftruncate compat_sys_ftruncate +94 common fchmod sys_fchmod +95 common fchown sys_fchown16 +96 common getpriority sys_getpriority +97 common setpriority sys_setpriority +# 98 was sys_profil +99 common statfs sys_statfs compat_sys_statfs +100 common fstatfs sys_fstatfs compat_sys_fstatfs +# 101 was sys_ioperm +# 102 was sys_socketcall +103 common syslog sys_syslog +104 common setitimer sys_setitimer compat_sys_setitimer +105 common getitimer sys_getitimer compat_sys_getitimer +106 common stat sys_newstat compat_sys_newstat +107 common lstat sys_newlstat compat_sys_newlstat +108 common fstat sys_newfstat compat_sys_newfstat +# 109 was sys_uname +# 110 was sys_iopl +111 common vhangup sys_vhangup +# 112 was sys_idle +# 113 was sys_syscall +114 common wait4 sys_wait4 compat_sys_wait4 +115 common swapoff sys_swapoff +116 common sysinfo sys_sysinfo compat_sys_sysinfo +# 117 was sys_ipc +118 common fsync sys_fsync +119 common sigreturn sys_sigreturn_wrapper compat_sys_sigreturn +120 common clone sys_clone +121 common setdomainname sys_setdomainname +122 common uname sys_newuname +# 123 was sys_modify_ldt +124 common adjtimex sys_adjtimex_time32 +125 common mprotect sys_mprotect +126 common sigprocmask sys_sigprocmask compat_sys_sigprocmask +# 127 was sys_create_module +128 common init_module sys_init_module +129 common delete_module sys_delete_module +# 130 was sys_get_kernel_syms +131 common quotactl sys_quotactl +132 common getpgid sys_getpgid +133 common fchdir sys_fchdir +134 common bdflush sys_ni_syscall +135 common sysfs sys_sysfs +136 common personality sys_personality +# 137 was sys_afs_syscall +138 common setfsuid sys_setfsuid16 +139 common setfsgid sys_setfsgid16 +140 common _llseek sys_llseek +141 common getdents sys_getdents compat_sys_getdents +142 common _newselect sys_select compat_sys_select +143 common flock sys_flock +144 common msync sys_msync +145 common readv sys_readv +146 common writev sys_writev +147 common getsid sys_getsid +148 common fdatasync sys_fdatasync +149 common _sysctl sys_ni_syscall +150 common mlock sys_mlock +151 common munlock sys_munlock +152 common mlockall sys_mlockall +153 common munlockall sys_munlockall +154 common sched_setparam sys_sched_setparam +155 common sched_getparam sys_sched_getparam +156 common sched_setscheduler sys_sched_setscheduler +157 common sched_getscheduler sys_sched_getscheduler +158 common sched_yield sys_sched_yield +159 common sched_get_priority_max sys_sched_get_priority_max +160 common sched_get_priority_min sys_sched_get_priority_min +161 common sched_rr_get_interval sys_sched_rr_get_interval_time32 +162 common nanosleep sys_nanosleep_time32 +163 common mremap sys_mremap +164 common setresuid sys_setresuid16 +165 common getresuid sys_getresuid16 +# 166 was sys_vm86 +# 167 was sys_query_module +168 common poll sys_poll +169 common nfsservctl sys_ni_syscall +170 common setresgid sys_setresgid16 +171 common getresgid sys_getresgid16 +172 common prctl sys_prctl +173 common rt_sigreturn sys_rt_sigreturn_wrapper compat_sys_rt_sigreturn +174 common rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction +175 common rt_sigprocmask sys_rt_sigprocmask compat_sys_rt_sigprocmask +176 common rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending +177 common rt_sigtimedwait sys_rt_sigtimedwait_time32 compat_sys_rt_sigtimedwait_time32 +178 common rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo +179 common rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend +180 common pread64 sys_pread64 compat_sys_aarch32_pread64 +181 common pwrite64 sys_pwrite64 compat_sys_aarch32_pwrite64 +182 common chown sys_chown16 +183 common getcwd sys_getcwd +184 common capget sys_capget +185 common capset sys_capset +186 common sigaltstack sys_sigaltstack compat_sys_sigaltstack +187 common sendfile sys_sendfile compat_sys_sendfile +# 188 reserved +# 189 reserved +190 common vfork sys_vfork +# SuS compliant getrlimit +191 common ugetrlimit sys_getrlimit compat_sys_getrlimit +192 common mmap2 sys_mmap2 compat_sys_aarch32_mmap2 +193 common truncate64 sys_truncate64 compat_sys_aarch32_truncate64 +194 common ftruncate64 sys_ftruncate64 compat_sys_aarch32_ftruncate64 +195 common stat64 sys_stat64 +196 common lstat64 sys_lstat64 +197 common fstat64 sys_fstat64 +198 common lchown32 sys_lchown +199 common getuid32 sys_getuid +200 common getgid32 sys_getgid +201 common geteuid32 sys_geteuid +202 common getegid32 sys_getegid +203 common setreuid32 sys_setreuid +204 common setregid32 sys_setregid +205 common getgroups32 sys_getgroups +206 common setgroups32 sys_setgroups +207 common fchown32 sys_fchown +208 common setresuid32 sys_setresuid +209 common getresuid32 sys_getresuid +210 common setresgid32 sys_setresgid +211 common getresgid32 sys_getresgid +212 common chown32 sys_chown +213 common setuid32 sys_setuid +214 common setgid32 sys_setgid +215 common setfsuid32 sys_setfsuid +216 common setfsgid32 sys_setfsgid +217 common getdents64 sys_getdents64 +218 common pivot_root sys_pivot_root +219 common mincore sys_mincore +220 common madvise sys_madvise +221 common fcntl64 sys_fcntl64 compat_sys_fcntl64 +# 222 for tux +# 223 is unused +224 common gettid sys_gettid +225 common readahead sys_readahead compat_sys_aarch32_readahead +226 common setxattr sys_setxattr +227 common lsetxattr sys_lsetxattr +228 common fsetxattr sys_fsetxattr +229 common getxattr sys_getxattr +230 common lgetxattr sys_lgetxattr +231 common fgetxattr sys_fgetxattr +232 common listxattr sys_listxattr +233 common llistxattr sys_llistxattr +234 common flistxattr sys_flistxattr +235 common removexattr sys_removexattr +236 common lremovexattr sys_lremovexattr +237 common fremovexattr sys_fremovexattr +238 common tkill sys_tkill +239 common sendfile64 sys_sendfile64 +240 common futex sys_futex_time32 +241 common sched_setaffinity sys_sched_setaffinity compat_sys_sched_setaffinity +242 common sched_getaffinity sys_sched_getaffinity compat_sys_sched_getaffinity +243 common io_setup sys_io_setup compat_sys_io_setup +244 common io_destroy sys_io_destroy +245 common io_getevents sys_io_getevents_time32 +246 common io_submit sys_io_submit compat_sys_io_submit +247 common io_cancel sys_io_cancel +248 common exit_group sys_exit_group +249 common lookup_dcookie sys_ni_syscall +250 common epoll_create sys_epoll_create +251 common epoll_ctl sys_epoll_ctl +252 common epoll_wait sys_epoll_wait +253 common remap_file_pages sys_remap_file_pages +# 254 for set_thread_area +# 255 for get_thread_area +256 common set_tid_address sys_set_tid_address +257 common timer_create sys_timer_create compat_sys_timer_create +258 common timer_settime sys_timer_settime32 +259 common timer_gettime sys_timer_gettime32 +260 common timer_getoverrun sys_timer_getoverrun +261 common timer_delete sys_timer_delete +262 common clock_settime sys_clock_settime32 +263 common clock_gettime sys_clock_gettime32 +264 common clock_getres sys_clock_getres_time32 +265 common clock_nanosleep sys_clock_nanosleep_time32 +266 common statfs64 sys_statfs64_wrapper compat_sys_aarch32_statfs64 +267 common fstatfs64 sys_fstatfs64_wrapper compat_sys_aarch32_fstatfs64 +268 common tgkill sys_tgkill +269 common utimes sys_utimes_time32 +270 common arm_fadvise64_64 sys_arm_fadvise64_64 compat_sys_aarch32_fadvise64_64 +271 common pciconfig_iobase sys_pciconfig_iobase +272 common pciconfig_read sys_pciconfig_read +273 common pciconfig_write sys_pciconfig_write +274 common mq_open sys_mq_open compat_sys_mq_open +275 common mq_unlink sys_mq_unlink +276 common mq_timedsend sys_mq_timedsend_time32 +277 common mq_timedreceive sys_mq_timedreceive_time32 +278 common mq_notify sys_mq_notify compat_sys_mq_notify +279 common mq_getsetattr sys_mq_getsetattr compat_sys_mq_getsetattr +280 common waitid sys_waitid compat_sys_waitid +281 common socket sys_socket +282 common bind sys_bind +283 common connect sys_connect +284 common listen sys_listen +285 common accept sys_accept +286 common getsockname sys_getsockname +287 common getpeername sys_getpeername +288 common socketpair sys_socketpair +289 common send sys_send +290 common sendto sys_sendto +291 common recv sys_recv compat_sys_recv +292 common recvfrom sys_recvfrom compat_sys_recvfrom +293 common shutdown sys_shutdown +294 common setsockopt sys_setsockopt +295 common getsockopt sys_getsockopt +296 common sendmsg sys_sendmsg compat_sys_sendmsg +297 common recvmsg sys_recvmsg compat_sys_recvmsg +298 common semop sys_semop +299 common semget sys_semget +300 common semctl sys_old_semctl compat_sys_old_semctl +301 common msgsnd sys_msgsnd compat_sys_msgsnd +302 common msgrcv sys_msgrcv compat_sys_msgrcv +303 common msgget sys_msgget +304 common msgctl sys_old_msgctl compat_sys_old_msgctl +305 common shmat sys_shmat compat_sys_shmat +306 common shmdt sys_shmdt +307 common shmget sys_shmget +308 common shmctl sys_old_shmctl compat_sys_old_shmctl +309 common add_key sys_add_key +310 common request_key sys_request_key +311 common keyctl sys_keyctl compat_sys_keyctl +312 common semtimedop sys_semtimedop_time32 +313 common vserver sys_ni_syscall +314 common ioprio_set sys_ioprio_set +315 common ioprio_get sys_ioprio_get +316 common inotify_init sys_inotify_init +317 common inotify_add_watch sys_inotify_add_watch +318 common inotify_rm_watch sys_inotify_rm_watch +319 common mbind sys_mbind +320 common get_mempolicy sys_get_mempolicy +321 common set_mempolicy sys_set_mempolicy +322 common openat sys_openat compat_sys_openat +323 common mkdirat sys_mkdirat +324 common mknodat sys_mknodat +325 common fchownat sys_fchownat +326 common futimesat sys_futimesat_time32 +327 common fstatat64 sys_fstatat64 +328 common unlinkat sys_unlinkat +329 common renameat sys_renameat +330 common linkat sys_linkat +331 common symlinkat sys_symlinkat +332 common readlinkat sys_readlinkat +333 common fchmodat sys_fchmodat +334 common faccessat sys_faccessat +335 common pselect6 sys_pselect6_time32 compat_sys_pselect6_time32 +336 common ppoll sys_ppoll_time32 compat_sys_ppoll_time32 +337 common unshare sys_unshare +338 common set_robust_list sys_set_robust_list compat_sys_set_robust_list +339 common get_robust_list sys_get_robust_list compat_sys_get_robust_list +340 common splice sys_splice +341 common arm_sync_file_range sys_sync_file_range2 compat_sys_aarch32_sync_file_range2 +342 common tee sys_tee +343 common vmsplice sys_vmsplice +344 common move_pages sys_move_pages +345 common getcpu sys_getcpu +346 common epoll_pwait sys_epoll_pwait compat_sys_epoll_pwait +347 common kexec_load sys_kexec_load compat_sys_kexec_load +348 common utimensat sys_utimensat_time32 +349 common signalfd sys_signalfd compat_sys_signalfd +350 common timerfd_create sys_timerfd_create +351 common eventfd sys_eventfd +352 common fallocate sys_fallocate compat_sys_aarch32_fallocate +353 common timerfd_settime sys_timerfd_settime32 +354 common timerfd_gettime sys_timerfd_gettime32 +355 common signalfd4 sys_signalfd4 compat_sys_signalfd4 +356 common eventfd2 sys_eventfd2 +357 common epoll_create1 sys_epoll_create1 +358 common dup3 sys_dup3 +359 common pipe2 sys_pipe2 +360 common inotify_init1 sys_inotify_init1 +361 common preadv sys_preadv compat_sys_preadv +362 common pwritev sys_pwritev compat_sys_pwritev +363 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo +364 common perf_event_open sys_perf_event_open +365 common recvmmsg sys_recvmmsg_time32 compat_sys_recvmmsg_time32 +366 common accept4 sys_accept4 +367 common fanotify_init sys_fanotify_init +368 common fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark +369 common prlimit64 sys_prlimit64 +370 common name_to_handle_at sys_name_to_handle_at +371 common open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at +372 common clock_adjtime sys_clock_adjtime32 +373 common syncfs sys_syncfs +374 common sendmmsg sys_sendmmsg compat_sys_sendmmsg +375 common setns sys_setns +376 common process_vm_readv sys_process_vm_readv +377 common process_vm_writev sys_process_vm_writev +378 common kcmp sys_kcmp +379 common finit_module sys_finit_module +380 common sched_setattr sys_sched_setattr +381 common sched_getattr sys_sched_getattr +382 common renameat2 sys_renameat2 +383 common seccomp sys_seccomp +384 common getrandom sys_getrandom +385 common memfd_create sys_memfd_create +386 common bpf sys_bpf +387 common execveat sys_execveat compat_sys_execveat +388 common userfaultfd sys_userfaultfd +389 common membarrier sys_membarrier +390 common mlock2 sys_mlock2 +391 common copy_file_range sys_copy_file_range +392 common preadv2 sys_preadv2 compat_sys_preadv2 +393 common pwritev2 sys_pwritev2 compat_sys_pwritev2 +394 common pkey_mprotect sys_pkey_mprotect +395 common pkey_alloc sys_pkey_alloc +396 common pkey_free sys_pkey_free +397 common statx sys_statx +398 common rseq sys_rseq +399 common io_pgetevents sys_io_pgetevents_time32 compat_sys_io_pgetevents +400 common migrate_pages sys_migrate_pages +401 common kexec_file_load sys_kexec_file_load +# 402 is unused +403 common clock_gettime64 sys_clock_gettime +404 common clock_settime64 sys_clock_settime +405 common clock_adjtime64 sys_clock_adjtime +406 common clock_getres_time64 sys_clock_getres +407 common clock_nanosleep_time64 sys_clock_nanosleep +408 common timer_gettime64 sys_timer_gettime +409 common timer_settime64 sys_timer_settime +410 common timerfd_gettime64 sys_timerfd_gettime +411 common timerfd_settime64 sys_timerfd_settime +412 common utimensat_time64 sys_utimensat +413 common pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 +414 common ppoll_time64 sys_ppoll compat_sys_ppoll_time64 +416 common io_pgetevents_time64 sys_io_pgetevents compat_sys_io_pgetevents_time64 +417 common recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 +418 common mq_timedsend_time64 sys_mq_timedsend +419 common mq_timedreceive_time64 sys_mq_timedreceive +420 common semtimedop_time64 sys_semtimedop +421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 +422 common futex_time64 sys_futex +423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval +424 common pidfd_send_signal sys_pidfd_send_signal +425 common io_uring_setup sys_io_uring_setup +426 common io_uring_enter sys_io_uring_enter +427 common io_uring_register sys_io_uring_register +428 common open_tree sys_open_tree +429 common move_mount sys_move_mount +430 common fsopen sys_fsopen +431 common fsconfig sys_fsconfig +432 common fsmount sys_fsmount +433 common fspick sys_fspick +434 common pidfd_open sys_pidfd_open +435 common clone3 sys_clone3 +436 common close_range sys_close_range +437 common openat2 sys_openat2 +438 common pidfd_getfd sys_pidfd_getfd +439 common faccessat2 sys_faccessat2 +440 common process_madvise sys_process_madvise +441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 +442 common mount_setattr sys_mount_setattr +443 common quotactl_fd sys_quotactl_fd +444 common landlock_create_ruleset sys_landlock_create_ruleset +445 common landlock_add_rule sys_landlock_add_rule +446 common landlock_restrict_self sys_landlock_restrict_self +# 447 reserved for memfd_secret +448 common process_mrelease sys_process_mrelease +449 common futex_waitv sys_futex_waitv +450 common set_mempolicy_home_node sys_set_mempolicy_home_node +451 common cachestat sys_cachestat +452 common fchmodat2 sys_fchmodat2 +453 common map_shadow_stack sys_map_shadow_stack +454 common futex_wake sys_futex_wake +455 common futex_wait sys_futex_wait +456 common futex_requeue sys_futex_requeue +457 common statmount sys_statmount +458 common listmount sys_listmount +459 common lsm_get_self_attr sys_lsm_get_self_attr +460 common lsm_set_self_attr sys_lsm_set_self_attr +461 common lsm_list_modules sys_lsm_list_modules +462 common mseal sys_mseal diff --git a/tools/perf/arch/arm64/entry/syscalls/syscall_64.tbl b/tools/perf/arch/arm64/entry/syscalls/syscall_64.tbl new file mode 120000 index 0000000000000000000000000000000000000000..4fdd58f10c155ee45b8d4f6ab1ca4e36ea677c75 --- /dev/null +++ b/tools/perf/arch/arm64/entry/syscalls/syscall_64.tbl @@ -0,0 +1 @@ +../../../../../scripts/syscall.tbl \ No newline at end of file diff --git a/tools/perf/arch/arm64/include/syscall_table.h b/tools/perf/arch/arm64/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..7ff51b783000d727ec48be960730b81ecdb05575 --- /dev/null +++ b/tools/perf/arch/arm64/include/syscall_table.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include + +#if __BITS_PER_LONG == 64 +#include +#else +#include +#endif diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index ae9f00ae79f34fec75ef2c91300ccd771c030529..d3c6e10dce73f122cfbaa6ca75ea82bec38c6a16 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -208,6 +208,8 @@ check_2 tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/sparc/kernel/sysca check_2 tools/perf/arch/xtensa/entry/syscalls/syscall.tbl arch/xtensa/kernel/syscalls/syscall.tbl check_2 tools/perf/arch/alpha/entry/syscalls/syscall.tbl arch/alpha/entry/syscalls/syscall.tbl check_2 tools/perf/arch/parisc/entry/syscalls/syscall.tbl arch/parisc/entry/syscalls/syscall.tbl +check_2 tools/perf/arch/arm64/entry/syscalls/syscall_32.tbl arch/arm64/entry/syscalls/syscall_32.tbl +check_2 tools/perf/arch/arm64/entry/syscalls/syscall_64.tbl arch/arm64/entry/syscalls/syscall_64.tbl for i in "${BEAUTY_FILES[@]}" do diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 02f23483bfff83809c4e649a2d054dba6975d12c..b7c0a4b9245a94b3b245fea59af79081b1f91081 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -26,10 +26,6 @@ static const char *const *syscalltbl_native = syscalltbl_powerpc_64; #include const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_32_MAX_ID; static const char *const *syscalltbl_native = syscalltbl_powerpc_32; -#elif defined(__aarch64__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_ARM64_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_arm64; #elif defined(__mips__) #include const int syscalltbl_native_max_id = SYSCALLTBL_MIPS_N64_MAX_ID; From patchwork Fri Dec 13 00:33:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 790B4E7717F for ; Fri, 13 Dec 2024 00:46:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=atTT+UDlfDl79NfC2TFXfv2N2fNCnGAhnl47hLnWlto=; b=h7U3Q8vpcdumtD ktAkubbhH/N9cQypcTkst6Dkru3WAQ05kRYDNWW5rEF+uhnGfPI1nMoBL6CX0EfWXWRNRpFw0KOQq TaI2a3/oMh+5D5FM7lCogkSoG7sD3cZxfzt8wEN8U4ViluO2wqICPNBVTHlzrF0MlrUs/m7r9Kt3d 9oJqkRvUM9UPKlI6joV6JLqSNpJvRWruHwUI+0pyKEtheRU02vpH48NYeD0hlrYNCY7a22y1HLpxC dJ4kUk2KvyZ/+BK51bEfk1TRXh60/dTrbsTb2IEPyLCXhekatjLtulMbYV1vBW6NmdyvzYrxZTeUL UuQKlE4grfG++JB804yQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLtou-00000002KwP-11dP; Fri, 13 Dec 2024 00:46:16 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtch-00000002IEu-30AO for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:41 +0000 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-7fd4c0220bbso1193724a12.0 for ; Thu, 12 Dec 2024 16:33:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050019; x=1734654819; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=BkBpGiJJV1xZfjJsAMeOkH46KtRGtX/VgJPGRtgwU6w=; b=NjODZCMVePioE4v6So6piFQfHOovC7tuGJlrqioiUW9pDjono4kM96jMaOTSrqGcP/ wDV0EfO0XgREcElyCXDmV43K9mS+CyFS5NnWTneM+nTFuqxPiQy55G8Ikxrl7UiQ3oKS /MTRq+hDJeQPbfcstwdhZCwu5aKBcXCsefIxxw/Na5zjx3JBrMRrjGx1DhDrejOR04yD 1U12e4LqDS49jPugKF+U9Wl4h1kaI67WO+WhfnSdCt+QQ0EX6NjBitEh1mGNx6lieJZO d/xoXJqktmEy9P2qf9W2A9N0jNFc8EIeuUBfYNYYANKEyPDMXocldlpcU62zuQUrMn0D wQAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050019; x=1734654819; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BkBpGiJJV1xZfjJsAMeOkH46KtRGtX/VgJPGRtgwU6w=; b=qUz+cTN75smvlPxkyqkJcECM5wE0E7z1TgkO9fP7UXifhI/PU1Jj+H31Iqnfi9NGhA +vGwe+yVC9NcJH/3GdcmBQ+B67SxJMbQCVGifM9xSJiH5oi0XDkTLXUIcMKLCj+C06Rd sjQsyjfjZYQ/wRKNlf7MlD4A1oT/e3ILPHJ26q6+6fPYNDyBgSWLLGIapIyR1REI4HSC s9cRHfjyjj/Pn98njKDOSv3fyICyyh+y+kYMDzNaSuSeOifsx8hv6ZJrGXIC5Z3iD211 iQ1HASUTqpAXfWPLkcibUjURlI/So53O9LrJjZ1prrmMIntmVX1Ua2VGTqnFZLV1mC9s QcnQ== X-Forwarded-Encrypted: i=1; AJvYcCX6fU0vCr3yfBc4wHj3CnwAeq1mfTUSCr47NTCte808jcz447GySW8sOYL54etOp+u+i+Ag/xcOh3Z/kw==@lists.infradead.org X-Gm-Message-State: AOJu0Yx+DKuY2UdisCHPJHrEQagHIcEtOwT1JfLcdZO7YboFsxsZ9VEf lrs9jyias7+hfRlBL7wmyqAyD9cvO7vvdo/jT8vsusdU/nPlLWdyXCk4WCdC3v0= X-Gm-Gg: ASbGncsdLDbsex8tIDfLjkdwwWT/l50jmRxMewC/jSrW4KegZ0ADOnZ8RZmqoLxQkUf CWVqmFJKYzlxNJY03QFnXOwfWe4jr0TRx5cYHTKPlyTFjtYXirisPDgwTgWoMNGqWiV8RXyL7Z8 lxkEWMCfDEItrjQYpAcu8oainmvFG6QKGCCuk60Ao1pEA56zJKlRJCz/7iMmvJr/LRUQ9BqvJzs sxDb5oAm7W36JsZ5NqX9roeUzu78n6Xt4DkleJaQlxonsW7lGeyODEAMDW+bvA+kM8a6xNd X-Google-Smtp-Source: AGHT+IEmO14yRzV89oAAj+86B3/3giiM5XjE+fq4YvWiIgXAskruD2olv5GrMtWghrbv8f8V9rlHTQ== X-Received: by 2002:a17:90b:1810:b0:2ee:ab29:1482 with SMTP id 98e67ed59e1d1-2f28fb68bbcmr1241837a91.16.1734050019164; Thu, 12 Dec 2024 16:33:39 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:38 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:33:02 -0800 Subject: [PATCH v2 12/16] perf tools: loongarch: Use syscall table MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-12-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6826; i=charlie@rivosinc.com; h=from:subject:message-id; bh=vnr7cWoZFfQ0KvHH41RaqWCLqYQBec4e5YesLO6WOkY=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w4HTye2XcxtrZ6/5XW1/pLfSpiWjrXlBk6B+w4br7 DEsIbYdpSwMYhwMsmKKLDzXGphb7+iXHRUtmwAzh5UJZAgDF6cATETsN8MfzqMn9+TkLWL+ImUd xxD7bN3Prven/tfWNv4V7Q0r90/QZfin5P/Xmv/m57/LV6u62Gypl79zQ5Vjh+edycdmFSVn+/W wAgA= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163339_790879_3D5F5A88 X-CRM114-Status: GOOD ( 15.19 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org loongarch uses a syscall table, use that in perf instead of using unistd.h. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 5 +-- tools/perf/Makefile.perf | 2 +- tools/perf/arch/loongarch/Makefile | 22 ----------- tools/perf/arch/loongarch/entry/syscalls/Kbuild | 2 + .../loongarch/entry/syscalls/Makefile.syscalls | 3 ++ .../arch/loongarch/entry/syscalls/mksyscalltbl | 45 ---------------------- tools/perf/arch/loongarch/include/syscall_table.h | 2 + tools/perf/util/syscalltbl.c | 4 -- 8 files changed, 10 insertions(+), 75 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index aefcbed7cdfac7c2a5d8db5cb111513f2d7c74ed..84ed266ce54f5291af5c59c02ccb06bfe17d840f 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,12 +31,12 @@ $(call detected_var,SRCARCH) ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE := 1 - ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390 mips loongarch)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390 mips)) NO_SYSCALL_TABLE := 0 endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated @@ -75,7 +75,6 @@ ifeq ($(SRCARCH),arm64) endif ifeq ($(SRCARCH),loongarch) - CFLAGS += -I$(OUTPUT)arch/loongarch/include/generated LIBUNWIND_LIBS = -lunwind -lunwind-loongarch64 endif diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 6a287f15fa1da5e8957558ee0a73b297d347f00d..7fefeea1799231af61e77c9372318e025bed078a 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/loongarch/Makefile b/tools/perf/arch/loongarch/Makefile index 52544d59245bab5a0fb2baa1e962b2ad4bf25332..087e099fb453a9236db34878077a51f711881ce0 100644 --- a/tools/perf/arch/loongarch/Makefile +++ b/tools/perf/arch/loongarch/Makefile @@ -1,25 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 PERF_HAVE_JITDUMP := 1 HAVE_KVM_STAT_SUPPORT := 1 - -# -# Syscall table generation for perf -# - -out := $(OUTPUT)arch/loongarch/include/generated/asm -header := $(out)/syscalls.c -incpath := $(srctree)/tools -sysdef := $(srctree)/tools/arch/loongarch/include/uapi/asm/unistd.h -sysprf := $(srctree)/tools/perf/arch/loongarch/entry/syscalls/ -systbl := $(sysprf)/mksyscalltbl - -# Create output directory if not already present -$(shell [ -d '$(out)' ] || mkdir -p '$(out)') - -$(header): $(sysdef) $(systbl) - $(Q)$(SHELL) '$(systbl)' '$(CC)' '$(HOSTCC)' $(incpath) $(sysdef) > $@ - -clean:: - $(call QUIET_CLEAN, loongarch) $(RM) $(header) - -archheaders: $(header) diff --git a/tools/perf/arch/loongarch/entry/syscalls/Kbuild b/tools/perf/arch/loongarch/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..9a41e3572c3afd4f202321fd9e492714540e8fd3 --- /dev/null +++ b/tools/perf/arch/loongarch/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/loongarch/entry/syscalls/Makefile.syscalls b/tools/perf/arch/loongarch/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..47d32da2aed8d67a7ac026271600e84723031a6b --- /dev/null +++ b/tools/perf/arch/loongarch/entry/syscalls/Makefile.syscalls @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_64 += diff --git a/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl b/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl deleted file mode 100755 index c10ad3580aef25e48ff0682eca4217cbafdfa333..0000000000000000000000000000000000000000 --- a/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# -# Generate system call table for perf. Derived from -# powerpc script. -# -# Author(s): Ming Wang -# Author(s): Huacai Chen -# Copyright (C) 2020-2023 Loongson Technology Corporation Limited - -gcc=$1 -hostcc=$2 -incpath=$3 -input=$4 - -if ! test -r $input; then - echo "Could not read input file" >&2 - exit 1 -fi - -create_sc_table() -{ - local sc nr max_nr - - while read sc nr; do - printf "%s\n" " [$nr] = \"$sc\"," - max_nr=$nr - done - - echo "#define SYSCALLTBL_LOONGARCH_MAX_ID $max_nr" -} - -create_table() -{ - echo "#include \"$input\"" - echo "static const char *const syscalltbl_loongarch[] = {" - create_sc_table - echo "};" -} - -$gcc -E -dM -x c -I $incpath/include/uapi $input \ - |awk '$2 ~ "__NR" && $3 !~ "__NR3264_" { - sub("^#define __NR(3264)?_", ""); - print | "sort -k2 -n"}' \ - |create_table diff --git a/tools/perf/arch/loongarch/include/syscall_table.h b/tools/perf/arch/loongarch/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..9d0646d3455cdaf1a3db8c8565af8eba9a8df8c6 --- /dev/null +++ b/tools/perf/arch/loongarch/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index b7c0a4b9245a94b3b245fea59af79081b1f91081..3001386e13a502be5279aa6e4742af0b96202b35 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -30,10 +30,6 @@ static const char *const *syscalltbl_native = syscalltbl_powerpc_32; #include const int syscalltbl_native_max_id = SYSCALLTBL_MIPS_N64_MAX_ID; static const char *const *syscalltbl_native = syscalltbl_mips_n64; -#elif defined(__loongarch__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_LOONGARCH_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_loongarch; #elif defined(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID; From patchwork Fri Dec 13 00:33:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906349 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19E1DE7717F for ; Fri, 13 Dec 2024 02:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ieIzw4gmmuz6BK3S3+OGpQQ75TbWvxesPFfFysc7sgs=; b=K5ssEo9W8zkrmb uBaShsIX+nvdoy52RWO5PXVZRXgDD9hjganRxlK8bnK6EgsV+bE5cYcJS7o/QKN5iwqGvd2Dbgotr hEksqq1bivCCkvsTXfSbxnHKSc7ZtajU2IVN9vBDdk36uE//wSjP7jpaAr+YYL6FIocb9u0xA8Uas dDqJixHfTSOvTZsINh+x5Su7JVrJ3Km9BQmxpMq9P4dtf64U7HadQ2yt/+jdAiJoQPMcm67Y3+BUu vXj0LVEa3zw0x7S1nKNypkeJjAT73llS7rmBR7pM0idhFSmii1J2/Xta12c4Nd+eqrZryriQvhIcz YD19GOJDOHctKAI4y1iA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLuyp-00000002Sai-3DEn; Fri, 13 Dec 2024 02:00:35 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtck-00000002IGn-2gbe for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:44 +0000 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2ee8e8e29f6so950701a91.0 for ; Thu, 12 Dec 2024 16:33:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050022; x=1734654822; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=S2idtNdPI7nInDelrf+RzTQSMc2p9eCa1XxS9I9D/38=; b=y1PTd5IRdwWYWn7xOSGZ6rg+LnB4samF+uhPQID3/b/WiK9l3ZxrUhW3HVnLnTh+J9 fKqIwybN79gQ2qzoaCwsyaXjbyQYWXrIxLTcpYs0PjZOUsGxtI36z88ghrMgutsI6apb VwCV9c04mxKhUoKwUB0tcBx6tSwSKPN8EAlzctOqe5INFkg7YQE4vIX7UTaTULE1k0/k WVM42IHXnbG2OzaRh7/i70EwNYh0ChKz0dkhe4YUamuT5LKFRyjd/EzrV5qldBXZ/Cim fxBA0ihtSrUpseGjxc1rXUCC1TR6hK7wYT40Rmf7Fe1mUCBa6NaBmVxU0tQUDNyGvFET FOrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050022; x=1734654822; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S2idtNdPI7nInDelrf+RzTQSMc2p9eCa1XxS9I9D/38=; b=ZyY5JsQw4lNwmXYpCLFrAR2lG28VH/erESxCY47aG48HnqHir1e4Y9dhWbTf0RzOmQ fgcBd2HxJr0LUyZmPbQTVHmijNp+f0gEhZhkCBohdsgJm18Rsv3t/1nYWB0lZQ4O/Pxy G5MzoMFs7nqJN5sE8zP++xO/pGn0dIXARDvEcX5tikhCFWkGhPpUyR0khZoydBxAzsQT GABh4q8t6cHxWqH/ri2Yc/xakezSyEPoBcC+n4fHAstyO+5YTKaU5VeSPRvUeTbz/Vlz EVnGPwL95VzRMcIwEkGeJ4iRX7nYNO3uSXIkjzZHcqk64PkXHtZGGGt3UefO3XSAXnDW NMZg== X-Forwarded-Encrypted: i=1; AJvYcCU9Ox/j0yN0eD+HLwI76jxKr+CMvhtFjNNBGM3zZr2NcuQW9yOMlKxq8sjetN0WlGgcXSjOQx0d9aOXow==@lists.infradead.org X-Gm-Message-State: AOJu0YzF4+KhrAUNEELtuF1CPRh88V6LGCjvsgkfh56Z3+/O6Bnr7CFe a4/zXxsNdb9IOrVYV1aGAPcyqVvKQzWadzkHzPDABCk01u+YWeP70cszsk3I5Ms= X-Gm-Gg: ASbGncu/G+I0nGe/pN8xbJ8gZiJLCOxGbOSXF57n6Fia95hj3DHAiuPKMF7cpOpgoOu d7YkMiRcSS0DY0etVd4NdRrRVsJzj6Gqx7/S5o0cspS4Yyc7fzOKTElrCl0n6wHtQ2tEzJw2AQy vXPpM63FE2g6c+mAKjMVGxAZzCZRXEQWuygXfcGelhutx0p3f0eujLTgS6ADwXW56X/XRZ5nhPr 4nqlLGxWBvXskjHq0G1tX30sHtRaGKI/Pom+ngf31iAAPGdCxx44eguVWnhkd6ex9qS/wys X-Google-Smtp-Source: AGHT+IF6BURL1n4KGxBBXYaFHFvEAEgkwIEbZP9XzYad/neAWQoyVE5vKYzrvukdADh1RKZudrbbcA== X-Received: by 2002:a17:90b:2f8d:b0:2ee:cd83:8fe7 with SMTP id 98e67ed59e1d1-2f2901b268bmr1191557a91.35.1734050021702; Thu, 12 Dec 2024 16:33:41 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:40 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:33:03 -0800 Subject: [PATCH v2 13/16] perf tools: mips: Use generic syscall scripts MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-13-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5531; i=charlie@rivosinc.com; h=from:subject:message-id; bh=8jL6WlIkbrQRkhOaXlyZOazSVy7Wwmif0Dswgn5tqQU=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0wwFOt/4g6/kMAhbTf/8p13DiuffjIdMmf8fMKR5qZ SlxdVkdpSwMYhwMsmKKLDzXGphb7+iXHRUtmwAzh5UJZAgDF6cATGSvFiPD212lr27ftpdsPifR Ef5Q+pvhdVM5l8BJ7wXVKuY0xcw9zPC/sO3c7qj53Gbyb47WB7C1z36z1awvRqT10478lo3GiT8 ZAA== X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163342_672856_BE328E48 X-CRM114-Status: GOOD ( 14.74 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Use the generic scripts to generate headers from the syscall table for mips. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 5 ++-- tools/perf/Makefile.perf | 2 +- tools/perf/arch/mips/entry/syscalls/Kbuild | 2 ++ .../arch/mips/entry/syscalls/Makefile.syscalls | 5 ++++ tools/perf/arch/mips/entry/syscalls/mksyscalltbl | 32 ---------------------- tools/perf/arch/mips/include/syscall_table.h | 2 ++ tools/perf/util/syscalltbl.c | 4 --- 7 files changed, 12 insertions(+), 40 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 84ed266ce54f5291af5c59c02ccb06bfe17d840f..09c4bb713648a9ca3c5223910bd7634fe8234e52 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,12 +31,12 @@ $(call detected_var,SRCARCH) ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE := 1 - ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390 mips)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390)) NO_SYSCALL_TABLE := 0 endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated @@ -83,7 +83,6 @@ ifeq ($(ARCH),s390) endif ifeq ($(ARCH),mips) - CFLAGS += -I$(OUTPUT)arch/mips/include/generated LIBUNWIND_LIBS = -lunwind -lunwind-mips endif diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 7fefeea1799231af61e77c9372318e025bed078a..b5a5f04a373e174269fe5ae8a7e8707e0b7e5835 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/mips/entry/syscalls/Kbuild b/tools/perf/arch/mips/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..9a41e3572c3afd4f202321fd9e492714540e8fd3 --- /dev/null +++ b/tools/perf/arch/mips/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/mips/entry/syscalls/Makefile.syscalls b/tools/perf/arch/mips/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..9ee914bdfb05860fdd37a49f1ced03fcf2c9ed78 --- /dev/null +++ b/tools/perf/arch/mips/entry/syscalls/Makefile.syscalls @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_64 += n64 + +syscalltbl = $(srctree)/tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl diff --git a/tools/perf/arch/mips/entry/syscalls/mksyscalltbl b/tools/perf/arch/mips/entry/syscalls/mksyscalltbl deleted file mode 100644 index c0d93f959c4e1b8c12edcb5624bbc131231df7e3..0000000000000000000000000000000000000000 --- a/tools/perf/arch/mips/entry/syscalls/mksyscalltbl +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# -# Generate system call table for perf. Derived from -# s390 script. -# -# Author(s): Hendrik Brueckner -# Changed by: Tiezhu Yang - -SYSCALL_TBL=$1 - -if ! test -r $SYSCALL_TBL; then - echo "Could not read input file" >&2 - exit 1 -fi - -create_table() -{ - local max_nr nr abi sc discard - - echo 'static const char *const syscalltbl_mips_n64[] = {' - while read nr abi sc discard; do - printf '\t[%d] = "%s",\n' $nr $sc - max_nr=$nr - done - echo '};' - echo "#define SYSCALLTBL_MIPS_N64_MAX_ID $max_nr" -} - -grep -E "^[[:digit:]]+[[:space:]]+(n64)" $SYSCALL_TBL \ - |sort -k1 -n \ - |create_table diff --git a/tools/perf/arch/mips/include/syscall_table.h b/tools/perf/arch/mips/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..b53e31c15805319a01719c22d489c4037378b02b --- /dev/null +++ b/tools/perf/arch/mips/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 3001386e13a502be5279aa6e4742af0b96202b35..675702d686d0d1b53dd3ee2017cc9695686b9c63 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -26,10 +26,6 @@ static const char *const *syscalltbl_native = syscalltbl_powerpc_64; #include const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_32_MAX_ID; static const char *const *syscalltbl_native = syscalltbl_powerpc_32; -#elif defined(__mips__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_MIPS_N64_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_mips_n64; #elif defined(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID; From patchwork Fri Dec 13 00:33:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906352 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F64CE77180 for ; Fri, 13 Dec 2024 02:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lGy6hUyVTj0Xc78EuXdk8WtrI3HoezvUq2R4Gk9A3wM=; b=HVnzt8kQHi/R81 NtEHnaCIB4JKzBoXz+CiXRBTOr0ocs3K63axJveX96ujjH88lcy3RSiXq+cq4VkZsoJOYLRt832jf Zs5FeNzJyZIQJVa0vws48LYTK8Zq9t5kct0Lry3YSKYDQwqrRzsvsSF2KGdqwz42NkG54daCqNwiG LdV6HKP5cEkz2p7gbV3av5LaspCu6Zj4ssqwhv4ORge0nUjTK6fHiJMYY36TZC/4h6E9EEt+0JpmB xRik+ZNHeISseu3aiBPfBgKOMOGxIBcHfoS8cIlIT0fS7+PtFnR0fPhcfflgALpOFIHmLRdv5FQYe eoWfP1LJO5ncDn3gZDfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLuyq-00000002Sap-1Iff; Fri, 13 Dec 2024 02:00:36 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcn-00000002IIc-1eeK for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:46 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-21683192bf9so12014015ad.3 for ; Thu, 12 Dec 2024 16:33:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050024; x=1734654824; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=4vXJvJ3mIUcBb12Ttbo2EsIEKGGovy2mgOHG3jKO+Yc=; b=vOgd4Sd8giCJsw9HE8Kwr2N8379iU2KHpN20uKu19xEPwu59bxII5V34JH7I0bqUhl U7eA6dB8NcYGL0R+88IoKQkWdL4r6HVdHe3KMxF7VGxF5tuR0Dl4DkBXBF9gI4M3BcOD Qv6vhc/+VoT3iNSCqAOC3yiANmTuWQcZs+0URI44E+JWEAJiqpHEdg/D3cRLeLUGLVjH y3S7w0edlbXsAP/xx76/xX+gjj7yZyLC4GWwQs0B/PooP0/ho3lZ/QkdfS7yk98vd1gz PKapgjkZ9AguuHhGKGL6dcB66dMl58Y4JC3sujuQmE+c4sVSnVJx1WK/YIReREelL/6P WzgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050024; x=1734654824; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4vXJvJ3mIUcBb12Ttbo2EsIEKGGovy2mgOHG3jKO+Yc=; b=pPrqTwRZ2dsMOAxQXTbQUvUNY+8Bt17SnS/6b8WKLQmP7oyHklW1LNfePGjQ8jE/kH 9zPwDcjrGURIakTMyKs4Ooe//yW63Qx+3ei/IxngnRNyPC5/LkcX1lv0JhRGyV2Q6vfZ xsysd7stvZmzM0lyrjPdZxR8zyuEykzLI3hUGn7fbHljAWnV83qLwM5DO/0qY9UdgPE0 bQZYSbdmVC8HBHg9uE5X8m7zMWuRM1vmpg1N+Vsv3f1mTsCBAjfvYvdkoMu/4v4oOZw+ cqVuK1ycFYnj4Uk4XTQSqnL0xVhZoFQUe8Xxt0z0LvcP/7M+1s6cStYUxkhkzgbuf7pQ mrvg== X-Forwarded-Encrypted: i=1; AJvYcCURxhVrH3pIyNAPKxcj+B+BYpphhshGAf+PmW1V6ma2njICDjL3/V8CSl7jT1ULSrNV2ECSiQ7mp2WUrg==@lists.infradead.org X-Gm-Message-State: AOJu0YwgNIUgbv67cBdWs1erjrequI2VuOjY0SegfLPjYK51j7Aw5ZWJ lKQm3pbX8BhNvZVBR0SsBXkD+jybxc0gBWh5AO7yqet2LTrq6HGLpNZqq+dBr4s= X-Gm-Gg: ASbGncsXjt2spz/7zaFNz/xWgj3br1Og8JCLpZMBlHm46I+CkulYpRK+kH1IkQHpIvd EfzwFLs2Xb3j1ZcAKTCtqPgYQIwY7jF/VFxCdtmi4plC6VL6p8oC1XNafu+XZiVwzDxWLhjhDKg y2wZPMs4tZ5lKDwxRpoQUowAkxCUJGqdYK/XMIou+u0afguLX+Maj0SiAm98dXlkE9R9EtQICjP 5l37i+t41HJAKGosK5ayiLs4WGLOBMTnl4ebEv1vOnT0huz2oHdd1ZWP3hkAnMQTUKWTR5O X-Google-Smtp-Source: AGHT+IEzsJkrkvZjhcNTbfFitMp64ScIhwN+0t5UI0qHMQ0Vghn8zjM6v3okefS/Uc0Xl6xQ7mXg8g== X-Received: by 2002:a17:902:e748:b0:215:577b:ab77 with SMTP id d9443c01a7336-21892a40509mr9643405ad.39.1734050024248; Thu, 12 Dec 2024 16:33:44 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:43 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:33:04 -0800 Subject: [PATCH v2 14/16] perf tools: powerpc: Use generic syscall table scripts MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-14-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=7324; i=charlie@rivosinc.com; h=from:subject:message-id; bh=B7CjLdEjn+XJO5k/0LWt6HVgppvF+ZXnE1rzsG8ipcY=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w4GX73doXq5eeV7tGl9x8OZjcYUrnHq9ZbqWFux+K TiBUa2vo5SFQYyDQVZMkYXnWgNz6x39sqOiZRNg5rAygQxh4OIUgIncPsvwh9M95YtH4/mf1uEx hWLZrTZlRcwnqoPurAi3v5b48EbRRIa/Anz1poKbNXQKme79bpA03xMa2XFC/9IepenbLf49n9H EDwA= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163345_465180_9549C5F8 X-CRM114-Status: GOOD ( 16.71 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Use the generic scripts to generate headers from the syscall table instead of the custom ones for powerpc. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 5 ++- tools/perf/Makefile.perf | 2 +- tools/perf/arch/powerpc/Makefile | 25 -------------- tools/perf/arch/powerpc/entry/syscalls/Kbuild | 3 ++ .../arch/powerpc/entry/syscalls/Makefile.syscalls | 6 ++++ .../perf/arch/powerpc/entry/syscalls/mksyscalltbl | 39 ---------------------- tools/perf/arch/powerpc/include/syscall_table.h | 8 +++++ tools/perf/util/syscalltbl.c | 8 ----- 8 files changed, 20 insertions(+), 76 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 09c4bb713648a9ca3c5223910bd7634fe8234e52..1ca8c9814cbffbc4bbed3b40e0d6e53f0f9b77f1 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,12 +31,12 @@ $(call detected_var,SRCARCH) ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE := 1 - ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390)) + ifeq ($(SRCARCH),s390) NO_SYSCALL_TABLE := 0 endif # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated @@ -49,7 +49,6 @@ endif # Additional ARCH settings for ppc ifeq ($(SRCARCH),powerpc) - CFLAGS += -I$(OUTPUT)arch/powerpc/include/generated LIBUNWIND_LIBS := -lunwind -lunwind-ppc64 endif diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index b5a5f04a373e174269fe5ae8a7e8707e0b7e5835..45bccc88e0087b57e4d9549e281cdbafc152a2fd 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile index dc8f4fb8e324ab6679d78b5fee3636ba7d2ff7c0..a295a80ea078199547e816d18531820bfdba7961 100644 --- a/tools/perf/arch/powerpc/Makefile +++ b/tools/perf/arch/powerpc/Makefile @@ -1,28 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 HAVE_KVM_STAT_SUPPORT := 1 PERF_HAVE_JITDUMP := 1 - -# -# Syscall table generation for perf -# - -out := $(OUTPUT)arch/powerpc/include/generated/asm -header32 := $(out)/syscalls_32.c -header64 := $(out)/syscalls_64.c -sysprf := $(srctree)/tools/perf/arch/powerpc/entry/syscalls -sysdef := $(sysprf)/syscall.tbl -systbl := $(sysprf)/mksyscalltbl - -# Create output directory if not already present -$(shell [ -d '$(out)' ] || mkdir -p '$(out)') - -$(header64): $(sysdef) $(systbl) - $(Q)$(SHELL) '$(systbl)' '64' $(sysdef) > $@ - -$(header32): $(sysdef) $(systbl) - $(Q)$(SHELL) '$(systbl)' '32' $(sysdef) > $@ - -clean:: - $(call QUIET_CLEAN, powerpc) $(RM) $(header32) $(header64) - -archheaders: $(header32) $(header64) diff --git a/tools/perf/arch/powerpc/entry/syscalls/Kbuild b/tools/perf/arch/powerpc/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..84c6599b4ea6a160217a3496449b205f2263f0fb --- /dev/null +++ b/tools/perf/arch/powerpc/entry/syscalls/Kbuild @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_32.h +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/powerpc/entry/syscalls/Makefile.syscalls b/tools/perf/arch/powerpc/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..f7e87a61401c14a1d3a8a04fe2c8ecc8bedcc1b0 --- /dev/null +++ b/tools/perf/arch/powerpc/entry/syscalls/Makefile.syscalls @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 += spu nospu +syscall_abis_64 += spu nospu + +syscalltbl = $(srctree)/tools/perf/arch/powerpc/entry/syscalls/syscall.tbl diff --git a/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl b/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl deleted file mode 100755 index 0eb316fe6dd1175a86035f76f9f3cf7501c376bd..0000000000000000000000000000000000000000 --- a/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# -# Generate system call table for perf. Derived from -# s390 script. -# -# Copyright IBM Corp. 2017 -# Author(s): Hendrik Brueckner -# Changed by: Ravi Bangoria - -wordsize=$1 -SYSCALL_TBL=$2 - -if ! test -r $SYSCALL_TBL; then - echo "Could not read input file" >&2 - exit 1 -fi - -create_table() -{ - local wordsize=$1 - local max_nr nr abi sc discard - max_nr=-1 - nr=0 - - echo "static const char *const syscalltbl_powerpc_${wordsize}[] = {" - while read nr abi sc discard; do - if [ "$max_nr" -lt "$nr" ]; then - printf '\t[%d] = "%s",\n' $nr $sc - max_nr=$nr - fi - done - echo '};' - echo "#define SYSCALLTBL_POWERPC_${wordsize}_MAX_ID $max_nr" -} - -grep -E "^[[:digit:]]+[[:space:]]+(common|spu|nospu|${wordsize})" $SYSCALL_TBL \ - |sort -k1 -n \ - |create_table ${wordsize} diff --git a/tools/perf/arch/powerpc/include/syscall_table.h b/tools/perf/arch/powerpc/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..7ff51b783000d727ec48be960730b81ecdb05575 --- /dev/null +++ b/tools/perf/arch/powerpc/include/syscall_table.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include + +#if __BITS_PER_LONG == 64 +#include +#else +#include +#endif diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 675702d686d0d1b53dd3ee2017cc9695686b9c63..8869fed1a58946c590484816354d8c74aff52ee3 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -18,14 +18,6 @@ #include const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID; static const char *const *syscalltbl_native = syscalltbl_s390_64; -#elif defined(__powerpc64__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_64_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_powerpc_64; -#elif defined(__powerpc__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_32_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_powerpc_32; #elif defined(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID; From patchwork Fri Dec 13 00:33:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906350 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDE6FE77182 for ; Fri, 13 Dec 2024 02:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QD/3y7A0E5P+5wL1J9JCfcDz4WOai0/xJhGltVzCbz0=; b=gxvEPCeCmvdGrm ByjWFVZRNyhHGBAzjykOg0NKlmBZpZCKPGku30TpCOADtUHWyrug5dZ0RItW3OYNzKzzJn9e5HRAy Xg7Jr2S8kClNzA7W0XsRXIjaXgu+FfS97SQVsqVwsvljhDLUHFawh6wGQ12lfIoyqpt7x/+d5AqUJ lR+m4XoH5HYak0mJZAiUF5GH04OPGf1mHLxRx+S6mpgSbeqCrxzXgnsZC2lWHNJ4cPIbJR0WjQRDb jHHUOZS4g80Zyy3KrL21uzwYjvI6H0ooSTPOtbQYdhKJo5e8icXSd+khciSNa9GH2a8+f4NobGEFm PQTDSEqLH/3Qa84EctbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLuyr-00000002Sbs-225b; Fri, 13 Dec 2024 02:00:37 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcp-00000002IJl-1JQ3 for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:48 +0000 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2ef87d24c2dso945202a91.1 for ; Thu, 12 Dec 2024 16:33:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050027; x=1734654827; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+pka+oHLhYgtgvKTbIDY/zAibUvBwaOFa9npTDjnf8A=; b=p7im8EJ6sZwZufJDEvTd4xkyCv1l7GmAXR46y9GOvRDVZMR55SFJieMBiwCiWdeUs5 4JgugG0QrDEq8waQ63A+Kxb3add2aM7lWz4qKq2IewQIDQASS0mz61WSgup/i2G98y6P 7DZRVtV4nJsUkcT7kuGxBGbPPwiiCZVZ21LjWII+6cU05jvsfs2lr7MZpijDhCnc0AY3 5da8x7Jdnx/lAryKy3I/hxRPo2cR2QLNCPkOfsCywbPJQicm1IPHND0lXipHWq5lPm43 1HLySRKWm+47Ph5/CYQYkE0M3X7lRK0+1hqQlgt4F6fpueptgV4Zy0s34qq/NxEz0i2O p95g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050027; x=1734654827; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+pka+oHLhYgtgvKTbIDY/zAibUvBwaOFa9npTDjnf8A=; b=jivarC5DinGHv2n6TdKMBgR1hUBbZ5usSLIkyLhqPIHHFeJP3hoFdN/rV1BAR6NjWj DDU4IJf1j2daypi19LbL2mjFA2+szr+I2dKnEpOALpacrNulqgjI+6h182FWrHKM+X7b eWu8EZE/mLoXGroT6uHni3y1AMR4zjEwlYXSszG/KNCvPMQjFvjYb9vcLpwvetzl67WO RYNHnis4RE4SXlgKJ9vpsaL442pxPrVIsKhCt0seVd4R4/dZ7amwO1ygK/LupBiMnINc +WiQdCbTNdd36N7pfCX5aLiasprJzfZPx8WWSLKJy86Y652ISg09K7IKF+CWRCqktzmi t76A== X-Forwarded-Encrypted: i=1; AJvYcCXCWWTT5XSQR8WvsvCmI3s8C/767zncDmLyhRTOyl+KlrpZzzJxDYXd5GJQPWxvlf34Fe6YmcwpP2xWbQ==@lists.infradead.org X-Gm-Message-State: AOJu0YxoaM26KfT4aLnNcSpb15ZKf3lZS5M719U8mvaEbg3W720CzcfT LEsxDl3c3pUP38ZRtrJ1A51Rz0Ah6q4f4cs5eJSO6VCRb7J6h0AI3MqT37oydJo= X-Gm-Gg: ASbGncvFu1B/VdXdyYUr7nMCuxO3epJNf35DkxQKOQYe4EVPOLSd6ChYYhRd3NsKNjk 141EaQmZYptlwLerCDX/K7YELfJCGKqJl0+6VtvRQcyr7c+0qyUVF/wffg2EBveXYmDH3ACrEsH U6nxqCIC5bwb5joqxTh4k/1FzmUzRBFiLbOyTM2e0YBJFVOwgigfU6h5lkn+q8rmHVHdw3yT7GV SM4ARgCGdjj31OYahuQfHSVVgnLXu4sXbuuT9CeGLvteCKdsGxObv99c99r8gEi4hQrJ25M X-Google-Smtp-Source: AGHT+IHzZ3bXJ0cy5rr0lWYKZxXGVM8gv6U7Mp7+XdqikZu489dXujvjckGU7RMBQANT1p4rUrKCWA== X-Received: by 2002:a17:90b:2883:b0:2ee:8e75:4ae1 with SMTP id 98e67ed59e1d1-2f28fd69b42mr995910a91.21.1734050026769; Thu, 12 Dec 2024 16:33:46 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:45 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:33:05 -0800 Subject: [PATCH v2 15/16] perf tools: s390: Use generic syscall table scripts MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-15-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6382; i=charlie@rivosinc.com; h=from:subject:message-id; bh=SdqrBFVai22Ulnc/RZqlr6Emdw7FO8UY/I4PiNM6pQc=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w0GZf58rer42WZlmnpVUf5zmPq/zH4esfL1TEPe5W KXAyb87SlkYxDgYZMUUWXiuNTC33tEvOypaNgFmDisTyBAGLk4BmEiUDiPDXt7Zm4+6HwhXUnz6 oYjVdV3G7tM7j2xSneg9p3OqyGHJHEaGF36SiV2n5hp/y2R0edgx6fuOKTc4AiZsF1b56PnvV7c lHwA= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163347_365355_040AB7C5 X-CRM114-Status: GOOD ( 15.41 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Use the generic scripts to generate headers from the syscall table instead of the custom ones for s390. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 8 ++---- tools/perf/Makefile.perf | 2 +- tools/perf/arch/s390/Makefile | 21 -------------- tools/perf/arch/s390/entry/syscalls/Kbuild | 2 ++ .../arch/s390/entry/syscalls/Makefile.syscalls | 5 ++++ tools/perf/arch/s390/entry/syscalls/mksyscalltbl | 32 ---------------------- tools/perf/arch/s390/include/syscall_table.h | 2 ++ tools/perf/util/syscalltbl.c | 6 +--- 8 files changed, 13 insertions(+), 65 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 1ca8c9814cbffbc4bbed3b40e0d6e53f0f9b77f1..c62622b4eb3dcbdfbd49ad371f15b92bfa4a6c43 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,12 +31,8 @@ $(call detected_var,SRCARCH) ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE := 1 - ifeq ($(SRCARCH),s390) - NO_SYSCALL_TABLE := 0 - endif - # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc s390)) NO_SYSCALL_TABLE := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated @@ -78,7 +74,7 @@ ifeq ($(SRCARCH),loongarch) endif ifeq ($(ARCH),s390) - CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated + CFLAGS += -fPIC endif ifeq ($(ARCH),mips) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 45bccc88e0087b57e4d9549e281cdbafc152a2fd..1f3262c1f9d44261be0315c693837cfdfb3071de 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc s390)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile index c431c21b11ef824535c1b9fb6ca4246d666fc97b..0033698a65ce5d5d7ebcc280399957561dd9d2c6 100644 --- a/tools/perf/arch/s390/Makefile +++ b/tools/perf/arch/s390/Makefile @@ -1,24 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only HAVE_KVM_STAT_SUPPORT := 1 PERF_HAVE_JITDUMP := 1 - -# -# Syscall table generation for perf -# - -out := $(OUTPUT)arch/s390/include/generated/asm -header := $(out)/syscalls_64.c -sysprf := $(srctree)/tools/perf/arch/s390/entry/syscalls -sysdef := $(sysprf)/syscall.tbl -systbl := $(sysprf)/mksyscalltbl - -# Create output directory if not already present -$(shell [ -d '$(out)' ] || mkdir -p '$(out)') - -$(header): $(sysdef) $(systbl) - $(Q)$(SHELL) '$(systbl)' $(sysdef) > $@ - -clean:: - $(call QUIET_CLEAN, s390) $(RM) $(header) - -archheaders: $(header) diff --git a/tools/perf/arch/s390/entry/syscalls/Kbuild b/tools/perf/arch/s390/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..9a41e3572c3afd4f202321fd9e492714540e8fd3 --- /dev/null +++ b/tools/perf/arch/s390/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/s390/entry/syscalls/Makefile.syscalls b/tools/perf/arch/s390/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..9762d7abf17c3f79a6213e7306a5f7b56e833a78 --- /dev/null +++ b/tools/perf/arch/s390/entry/syscalls/Makefile.syscalls @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_64 += renameat rlimit memfd_secret + +syscalltbl = $(srctree)/tools/perf/arch/s390/entry/syscalls/syscall.tbl diff --git a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl b/tools/perf/arch/s390/entry/syscalls/mksyscalltbl deleted file mode 100755 index 52eb88a77c94727aeb8c15427cdd43dfe5f9f2bd..0000000000000000000000000000000000000000 --- a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# -# Generate system call table for perf -# -# Copyright IBM Corp. 2017, 2018 -# Author(s): Hendrik Brueckner -# - -SYSCALL_TBL=$1 - -if ! test -r $SYSCALL_TBL; then - echo "Could not read input file" >&2 - exit 1 -fi - -create_table() -{ - local max_nr nr abi sc discard - - echo 'static const char *const syscalltbl_s390_64[] = {' - while read nr abi sc discard; do - printf '\t[%d] = "%s",\n' $nr $sc - max_nr=$nr - done - echo '};' - echo "#define SYSCALLTBL_S390_64_MAX_ID $max_nr" -} - -grep -E "^[[:digit:]]+[[:space:]]+(common|64)" $SYSCALL_TBL \ - |sort -k1 -n \ - |create_table diff --git a/tools/perf/arch/s390/include/syscall_table.h b/tools/perf/arch/s390/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..b53e31c15805319a01719c22d489c4037378b02b --- /dev/null +++ b/tools/perf/arch/s390/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 8869fed1a58946c590484816354d8c74aff52ee3..210f61b0a7a264a427ebb602185d3a9da2f426f4 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -14,11 +14,7 @@ #include #include "string2.h" -#if defined(__s390x__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_s390_64; -#elif defined(GENERIC_SYSCALL_TABLE) +#if defined(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID; static const char *const *syscalltbl_native = syscalltbl; From patchwork Fri Dec 13 00:33:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2D28E77180 for ; Fri, 13 Dec 2024 02:00:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kecoWhD8Mznn0bRoAX9J4lpTAE/trgDD9CT/z7QFM84=; b=awjj01f7BQjsC6 3O6MAs5s6vyNnddhgjFVgzUlqV7p05HbrMLcNk6rCL6fK1i7C8rTB49GF93Wn80EgXmLhonAAXkI0 52qReNRkMph02wJZNCu1ne9v+MclpomkjsZBuA7qNh/FkRpGZfZW3Y/mTwZKxvmV0LMm8/bY2UX4i YGxAZlHKkvEm/Qaf+2gIUXRlycVHLsvc1dg5yn+PRLZRW7y4oGaNo4sY+hchzMVdJOTDkdfT4yvd1 DkWp9c3/gMHcDGJdvVmr13a+xm2MR32hP/5RKzcRyxrAnddGoU+EvZR6kY6TNWCpiBNMa2thysA1h 7lGlcaJW1z/NcxKzoIvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLuys-00000002Scq-2kq6; Fri, 13 Dec 2024 02:00:38 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcs-00000002ILm-23PI for linux-riscv@lists.infradead.org; Fri, 13 Dec 2024 00:33:51 +0000 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-7fd17f231a7so743833a12.0 for ; Thu, 12 Dec 2024 16:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050029; x=1734654829; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5RXgVD1sMOEByzIW12GoGJoIzmAElVem9Exw+HJ9s4M=; b=bIArj2e2OUZCozjPRuEwcrCYvApY1AIo3kSQtWggJw4Hyt/vm9qKFy2KFZpseJkYBx HVtLSXtw2MIlpnSBIN68l1Br1on8A1+sehSoVo1SuRH9EgcxymczjQCphnGoTXzgTWr9 K2lbx+JVL0+svUtiyq+DWdwXALTj/NKePWfRvahwci9jKB5lG2JLw62Htwiws7wCHQIH NFoQmiF/Mv1zJwtNymsDv8Ww+hyM92le8FNWiV5dKrYs4ilphI9txdAtF1/QNQC2vjvf VBicIy8PtiiiX0ajfKSw+ZkX4A5QUHOnT+s+4pK0slVVmoOV05JNl8rGQ6lfgQuMPlAM 1Y7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050029; x=1734654829; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5RXgVD1sMOEByzIW12GoGJoIzmAElVem9Exw+HJ9s4M=; b=DQdpjxkI1bnqIwGRFDmXOiZJc8rC9pUTOGCT6sFFxBWaWvEvtW+SSRsGyKl9rCe4BG Ac/erwQH92H0Z8WifakaeVRH/FfPRsCfKxWGzYga89n1sE7HLMsbsrXxQsyyP23qmIyf dOpCfWbl70mp/AAUZr3FXv0osvV6tC2YCIlLw+3XLG11Gy7cR+ZuOdoHpriWOu+NYFq+ RPPbKU/oPkTTqKR13jsf1tyfPz5wBGeU4WbvJSS0lBSA+hl0aDBYmQ/QjHDFePlsJPVa SQXXkgWYjv506FBJE1x2oUR6GEEDVhgqt28/4UZ2W+ScluEA5wf1h2dXBkYHVHQNVRTT X9Ng== X-Forwarded-Encrypted: i=1; AJvYcCXK2O6D/5rFPKk4kgjGmazp3AB7ZGMuZM6Z1x2sL9kguxiCRMYkXrnEZ3zCzFC9M01yWGYHGSapOUE0LQ==@lists.infradead.org X-Gm-Message-State: AOJu0Yw+STuyARsyFXw83uhM2BWjuN91hg/Ahhn9klpyARRDTTX8yTzQ wwj4UMBbkwm+S6/z6P6WNe+Xp24LmxXvDA8zKXR0eilRihWEnsmCZJi8ngAgG5U= X-Gm-Gg: ASbGncs2Pv0ReA2kO8AfHyGKerC62PvUZH06LGnTwsz95/LrsIi7yUtK7CqbaEAvXoJ payD1tm8fV/1Km/6P8SLHPn3QKRayFjSmHjlI2ai1bEjcUsGLWQbtJL8RsQPKkXu7HBkqvj5qE1 tUI1cV8FRB6jdGixga5TKKbfLbTN6x7294ynQjtLMFPK3S8LIbwpg3tacbhNbO0tBV6exqgLbul Bztritulqt9m97d0bTpABfxEhTczcDSIYhhk9f8RLSl2FiwK8hrx2oHHXgQ2DxuC5C68g8e X-Google-Smtp-Source: AGHT+IFnqqMr5PLSI8GtF+i6M0/uFmU5w1Zg6QUUWZTPMqn5/Gio1RnoUEX7mkk6GPckIUrbakXX6w== X-Received: by 2002:a17:90b:54c7:b0:2ee:c9b6:c26a with SMTP id 98e67ed59e1d1-2f28fb68ef6mr1016562a91.11.1734050029367; Thu, 12 Dec 2024 16:33:49 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:48 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:33:06 -0800 Subject: [PATCH v2 16/16] perf tools: Remove dependency on libaudit MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-16-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=17750; i=charlie@rivosinc.com; h=from:subject:message-id; bh=Zgzl3XVxzAmW8jRrQNJSTtYzkCtc8Muf7dPcDIyBdyo=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w8H7J1c1KAvwfbDq9Z7oPNX9Rqbbxl1es5mawsJ8p fkD9rR2lLIwiHEwyIopsvBca2BuvaNfdlS0bALMHFYmkCEMXJwCMBGzLoZ/ql/lz2uZSMSq7k58 aZjoKbn+QEb9rZ0f4i7dWqZj8WsNH8M/W5+pmYwzDp02fnXPrnlneF157N9LD/yWNpRmh0X/SHd lBwA= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163350_540955_63D02031 X-CRM114-Status: GOOD ( 20.84 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org All architectures now support HAVE_SYSCALL_TABLE_SUPPORT, so the flag is no longer needed. With the removal of the flag, the related GENERIC_SYSCALL_TABLE can also be removed. libaudit was only used as a fallback for when HAVE_SYSCALL_TABLE_SUPPORT was not defined, so libaudit is also no longer needed for any architecture. Signed-off-by: Charlie Jenkins --- Documentation/admin-guide/workload-tracing.rst | 2 +- tools/build/feature/Makefile | 4 -- tools/build/feature/test-libaudit.c | 11 ------ tools/perf/Documentation/perf-check.txt | 1 - tools/perf/Makefile.config | 31 +-------------- tools/perf/Makefile.perf | 14 ------- tools/perf/builtin-check.c | 1 - tools/perf/builtin-help.c | 2 - tools/perf/builtin-trace.c | 30 --------------- tools/perf/perf.c | 6 +-- tools/perf/tests/make | 7 +--- tools/perf/util/env.c | 4 +- tools/perf/util/generate-cmdlist.sh | 4 +- tools/perf/util/syscalltbl.c | 53 -------------------------- 14 files changed, 10 insertions(+), 160 deletions(-) diff --git a/Documentation/admin-guide/workload-tracing.rst b/Documentation/admin-guide/workload-tracing.rst index b2e254ec8ee846afe78eede74a825b51c6ab119b..6be38c1b9c5bb4be899fd261c6d2911abcf959dc 100644 --- a/Documentation/admin-guide/workload-tracing.rst +++ b/Documentation/admin-guide/workload-tracing.rst @@ -83,7 +83,7 @@ scripts/ver_linux is a good way to check if your system already has the necessary tools:: sudo apt-get build-essentials flex bison yacc - sudo apt install libelf-dev systemtap-sdt-dev libaudit-dev libslang2-dev libperl-dev libdw-dev + sudo apt install libelf-dev systemtap-sdt-dev libslang2-dev libperl-dev libdw-dev cscope is a good tool to browse kernel sources. Let's install it now:: diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 043dfd00fce72d8f651ccd9b3265a0183f500e5c..e0b63e9d0251abe6d5eafc6d2f26b940918b16ee 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -13,7 +13,6 @@ FILES= \ test-gtk2.bin \ test-gtk2-infobar.bin \ test-hello.bin \ - test-libaudit.bin \ test-libbfd.bin \ test-libbfd-buildid.bin \ test-disassembler-four-args.bin \ @@ -228,9 +227,6 @@ $(OUTPUT)test-libunwind-debug-frame-arm.bin: $(OUTPUT)test-libunwind-debug-frame-aarch64.bin: $(BUILD) -lelf -llzma -lunwind-aarch64 -$(OUTPUT)test-libaudit.bin: - $(BUILD) -laudit - $(OUTPUT)test-libslang.bin: $(BUILD) -lslang diff --git a/tools/build/feature/test-libaudit.c b/tools/build/feature/test-libaudit.c deleted file mode 100644 index f5b0863fa1ec240795339428d8deed98a946d405..0000000000000000000000000000000000000000 --- a/tools/build/feature/test-libaudit.c +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include - -extern int printf(const char *format, ...); - -int main(void) -{ - printf("error message: %s\n", audit_errno_to_name(0)); - - return audit_open(); -} diff --git a/tools/perf/Documentation/perf-check.txt b/tools/perf/Documentation/perf-check.txt index 31741499e7867c9b712227f31a2958fd641d474a..e6d2ceeb2ca7de850f41b1baa0375b6f984bb08f 100644 --- a/tools/perf/Documentation/perf-check.txt +++ b/tools/perf/Documentation/perf-check.txt @@ -51,7 +51,6 @@ feature:: dwarf_getlocations / HAVE_LIBDW_SUPPORT dwarf-unwind / HAVE_DWARF_UNWIND_SUPPORT auxtrace / HAVE_AUXTRACE_SUPPORT - libaudit / HAVE_LIBAUDIT_SUPPORT libbfd / HAVE_LIBBFD_SUPPORT libcapstone / HAVE_LIBCAPSTONE_SUPPORT libcrypto / HAVE_LIBCRYPTO_SUPPORT diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index c62622b4eb3dcbdfbd49ad371f15b92bfa4a6c43..732961687177da414fb250dc1f6815d186a2343f 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -28,20 +28,7 @@ include $(srctree)/tools/scripts/Makefile.arch $(call detected_var,SRCARCH) -ifneq ($(NO_SYSCALL_TABLE),1) - NO_SYSCALL_TABLE := 1 - - # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc s390)) - NO_SYSCALL_TABLE := 0 - CFLAGS += -DGENERIC_SYSCALL_TABLE - CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated - endif - - ifneq ($(NO_SYSCALL_TABLE),1) - CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT - endif -endif +CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated # Additional ARCH settings for ppc ifeq ($(SRCARCH),powerpc) @@ -755,21 +742,7 @@ ifndef NO_LIBUNWIND endif ifneq ($(NO_LIBTRACEEVENT),1) - ifeq ($(NO_SYSCALL_TABLE),0) - $(call detected,CONFIG_TRACE) - else - ifndef NO_LIBAUDIT - $(call feature_check,libaudit) - ifneq ($(feature-libaudit), 1) - $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev) - NO_LIBAUDIT := 1 - else - CFLAGS += -DHAVE_LIBAUDIT_SUPPORT - EXTLIBS += -laudit - $(call detected,CONFIG_TRACE) - endif - endif - endif + $(call detected,CONFIG_TRACE) endif ifndef NO_LIBCRYPTO diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 1f3262c1f9d44261be0315c693837cfdfb3071de..ab2d075ff3a23350a5eea12508cf0376f1d9f4e8 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -59,8 +59,6 @@ include ../scripts/utilities.mak # # Define NO_LIBNUMA if you do not want numa perf benchmark # -# Define NO_LIBAUDIT if you do not want libaudit support -# # Define NO_LIBBIONIC if you do not want bionic support # # Define NO_LIBCRYPTO if you do not want libcrypto (openssl) support @@ -119,10 +117,6 @@ include ../scripts/utilities.mak # # Define LIBBPF_DYNAMIC to enable libbpf dynamic linking. # -# Define NO_SYSCALL_TABLE=1 to disable the use of syscall id to/from name tables -# generated from the kernel .tbl or unistd.h files and use, if available, libaudit -# for doing the conversions to/from strings/id. -# # Define NO_LIBPFM4 to disable libpfm4 events extension. # # Define NO_LIBDEBUGINFOD if you do not want support debuginfod @@ -310,10 +304,7 @@ ifeq ($(filter feature-dump,$(MAKECMDGOALS)),feature-dump) FEATURE_TESTS := all endif endif -# architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc s390)) include $(srctree)/tools/perf/scripts/Makefile.syscalls -endif include Makefile.config endif @@ -1098,11 +1089,6 @@ endif $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' $(call QUIET_INSTALL, perf-iostat) \ $(INSTALL) $(OUTPUT)perf-iostat -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' -ifndef NO_LIBAUDIT - $(call QUIET_INSTALL, strace/groups) \ - $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(STRACE_GROUPS_INSTDIR_SQ)'; \ - $(INSTALL) trace/strace/groups/* -m 644 -t '$(DESTDIR_SQ)$(STRACE_GROUPS_INSTDIR_SQ)' -endif ifndef NO_LIBPERL $(call QUIET_INSTALL, perl-scripts) \ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \ diff --git a/tools/perf/builtin-check.c b/tools/perf/builtin-check.c index 2346536a5ee14f91ecd10bd130a64676e871e1b2..7aed7b9f4f5270527ee1d36327eb6a01f196a46a 100644 --- a/tools/perf/builtin-check.c +++ b/tools/perf/builtin-check.c @@ -31,7 +31,6 @@ struct feature_status supported_features[] = { FEATURE_STATUS("dwarf_getlocations", HAVE_LIBDW_SUPPORT), FEATURE_STATUS("dwarf-unwind", HAVE_DWARF_UNWIND_SUPPORT), FEATURE_STATUS("auxtrace", HAVE_AUXTRACE_SUPPORT), - FEATURE_STATUS("libaudit", HAVE_LIBAUDIT_SUPPORT), FEATURE_STATUS("libbfd", HAVE_LIBBFD_SUPPORT), FEATURE_STATUS("libcapstone", HAVE_LIBCAPSTONE_SUPPORT), FEATURE_STATUS("libcrypto", HAVE_LIBCRYPTO_SUPPORT), diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 0854d3cd9f6a304cd9cb50ad430d5706d91df0e9..7be6fb6df595923c15ae51747d5bf17d867ae785 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c @@ -447,9 +447,7 @@ int cmd_help(int argc, const char **argv) #ifdef HAVE_LIBELF_SUPPORT "probe", #endif -#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT) "trace", -#endif NULL }; const char *builtin_help_usage[] = { "perf help [--all] [--man|--web|--info] [command]", diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 6a1a128fe645014d0347ad4ec3e0c9e77ec59aee..0fddf34458db4fe4896d25f427f2ae29cb3aa15f 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2069,30 +2069,11 @@ static int trace__read_syscall_info(struct trace *trace, int id) const char *name = syscalltbl__name(trace->sctbl, id); int err; -#ifdef HAVE_SYSCALL_TABLE_SUPPORT if (trace->syscalls.table == NULL) { trace->syscalls.table = calloc(trace->sctbl->syscalls.max_id + 1, sizeof(*sc)); if (trace->syscalls.table == NULL) return -ENOMEM; } -#else - if (id > trace->sctbl->syscalls.max_id || (id == 0 && trace->syscalls.table == NULL)) { - // When using libaudit we don't know beforehand what is the max syscall id - struct syscall *table = realloc(trace->syscalls.table, (id + 1) * sizeof(*sc)); - - if (table == NULL) - return -ENOMEM; - - // Need to memset from offset 0 and +1 members if brand new - if (trace->syscalls.table == NULL) - memset(table, 0, (id + 1) * sizeof(*sc)); - else - memset(table + trace->sctbl->syscalls.max_id + 1, 0, (id - trace->sctbl->syscalls.max_id) * sizeof(*sc)); - - trace->syscalls.table = table; - trace->sctbl->syscalls.max_id = id; - } -#endif sc = trace->syscalls.table + id; if (sc->nonexistent) return -EEXIST; @@ -2439,18 +2420,7 @@ static struct syscall *trace__syscall_info(struct trace *trace, err = -EINVAL; -#ifdef HAVE_SYSCALL_TABLE_SUPPORT if (id > trace->sctbl->syscalls.max_id) { -#else - if (id >= trace->sctbl->syscalls.max_id) { - /* - * With libaudit we don't know beforehand what is the max_id, - * so we let trace__read_syscall_info() figure that out as we - * go on reading syscalls. - */ - err = trace__read_syscall_info(trace, id); - if (err) -#endif goto out_cant_read; } diff --git a/tools/perf/perf.c b/tools/perf/perf.c index a2987f2cfe1a3958f53239ed1a4eec3f87d7466a..f0617cc41f5fe638986e5d8316a6b3056c2c4bc5 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -84,7 +84,7 @@ static struct cmd_struct commands[] = { #endif { "kvm", cmd_kvm, 0 }, { "test", cmd_test, 0 }, -#if defined(HAVE_LIBTRACEEVENT) && (defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)) +#if defined(HAVE_LIBTRACEEVENT) { "trace", cmd_trace, 0 }, #endif { "inject", cmd_inject, 0 }, @@ -514,10 +514,6 @@ int main(int argc, const char **argv) fprintf(stderr, "trace command not available: missing libtraceevent devel package at build time.\n"); goto out; -#elif !defined(HAVE_LIBAUDIT_SUPPORT) && !defined(HAVE_SYSCALL_TABLE_SUPPORT) - fprintf(stderr, - "trace command not available: missing audit-libs devel package at build time.\n"); - goto out; #else setup_path(); argv[0] = "trace"; diff --git a/tools/perf/tests/make b/tools/perf/tests/make index a7fcbd589752a90459815bd21075528c6dfa4d94..0ee94caf9ec19820a94a87dd46a7ccf1cefb844a 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -86,7 +86,6 @@ make_no_libdw_dwarf_unwind := NO_LIBDW_DWARF_UNWIND=1 make_no_backtrace := NO_BACKTRACE=1 make_no_libcapstone := NO_CAPSTONE=1 make_no_libnuma := NO_LIBNUMA=1 -make_no_libaudit := NO_LIBAUDIT=1 make_no_libbionic := NO_LIBBIONIC=1 make_no_auxtrace := NO_AUXTRACE=1 make_no_libbpf := NO_LIBBPF=1 @@ -97,7 +96,6 @@ make_no_libllvm := NO_LIBLLVM=1 make_with_babeltrace:= LIBBABELTRACE=1 make_with_coresight := CORESIGHT=1 make_no_sdt := NO_SDT=1 -make_no_syscall_tbl := NO_SYSCALL_TABLE=1 make_no_libpfm4 := NO_LIBPFM4=1 make_with_gtk2 := GTK2=1 make_refcnt_check := EXTRA_CFLAGS="-DREFCNT_CHECKING=1" @@ -122,10 +120,10 @@ make_static := LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX3 # all the NO_* variable combined make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_GTK2=1 make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_BACKTRACE=1 -make_minimal += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 +make_minimal += NO_LIBNUMA=1 NO_LIBBIONIC=1 make_minimal += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 make_minimal += NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 -make_minimal += NO_LIBCAP=1 NO_SYSCALL_TABLE=1 NO_CAPSTONE=1 +make_minimal += NO_LIBCAP=1 NO_CAPSTONE=1 # $(run) contains all available tests run := make_pure @@ -158,7 +156,6 @@ run += make_no_libdw_dwarf_unwind run += make_no_backtrace run += make_no_libcapstone run += make_no_libnuma -run += make_no_libaudit run += make_no_libbionic run += make_no_auxtrace run += make_no_libbpf diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c index e2843ca2edd92ea5fa1c020ae92b183c496e975e..e9a694350671910d537de599071dbe7fcc18ced4 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c @@ -474,13 +474,13 @@ const char *perf_env__arch(struct perf_env *env) const char *perf_env__arch_strerrno(struct perf_env *env __maybe_unused, int err __maybe_unused) { -#if defined(HAVE_SYSCALL_TABLE_SUPPORT) && defined(HAVE_LIBTRACEEVENT) +#if defined(HAVE_LIBTRACEEVENT) if (env->arch_strerrno == NULL) env->arch_strerrno = arch_syscalls__strerrno_function(perf_env__arch(env)); return env->arch_strerrno ? env->arch_strerrno(err) : "no arch specific strerrno function"; #else - return "!(HAVE_SYSCALL_TABLE_SUPPORT && HAVE_LIBTRACEEVENT)"; + return "!HAVE_LIBTRACEEVENT"; #endif } diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh index 1b5140e5ce9975fac87b2674dc694f9d4e439a5f..6a73c903d69050df69267a8aeaeeac1ed170efe1 100755 --- a/tools/perf/util/generate-cmdlist.sh +++ b/tools/perf/util/generate-cmdlist.sh @@ -38,7 +38,7 @@ do done echo "#endif /* HAVE_LIBELF_SUPPORT */" -echo "#if defined(HAVE_LIBTRACEEVENT) && (defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT))" +echo "#if defined(HAVE_LIBTRACEEVENT)" sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt | sort | while read cmd @@ -51,7 +51,7 @@ do p }' "Documentation/perf-$cmd.txt" done -echo "#endif /* HAVE_LIBTRACEEVENT && (HAVE_LIBAUDIT_SUPPORT || HAVE_SYSCALL_TABLE_SUPPORT) */" +echo "#endif /* HAVE_LIBTRACEEVENT */" echo "#ifdef HAVE_LIBTRACEEVENT" sed -n -e 's/^perf-\([^ ]*\)[ ].* traceevent.*/\1/p' command-list.txt | diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 210f61b0a7a264a427ebb602185d3a9da2f426f4..7e24e4164da9c7d60352b77b5724e6e8dac034f4 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -9,21 +9,12 @@ #include #include #include - -#ifdef HAVE_SYSCALL_TABLE_SUPPORT #include #include "string2.h" -#if defined(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID; static const char *const *syscalltbl_native = syscalltbl; -#else -const int syscalltbl_native_max_id = 0; -static const char *const syscalltbl_native[] = { - [0] = "unknown", -}; -#endif struct syscall { int id; @@ -131,47 +122,3 @@ int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_g *idx = -1; return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); } - -#else /* HAVE_SYSCALL_TABLE_SUPPORT */ - -#include - -struct syscalltbl *syscalltbl__new(void) -{ - struct syscalltbl *tbl = zalloc(sizeof(*tbl)); - if (tbl) - tbl->audit_machine = audit_detect_machine(); - return tbl; -} - -void syscalltbl__delete(struct syscalltbl *tbl) -{ - free(tbl); -} - -const char *syscalltbl__name(const struct syscalltbl *tbl, int id) -{ - return audit_syscall_to_name(id, tbl->audit_machine); -} - -int syscalltbl__id(struct syscalltbl *tbl, const char *name) -{ - return audit_name_to_syscall(name, tbl->audit_machine); -} - -int syscalltbl__id_at_idx(struct syscalltbl *tbl __maybe_unused, int idx) -{ - return idx; -} - -int syscalltbl__strglobmatch_next(struct syscalltbl *tbl __maybe_unused, - const char *syscall_glob __maybe_unused, int *idx __maybe_unused) -{ - return -1; -} - -int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_glob, int *idx) -{ - return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); -} -#endif /* HAVE_SYSCALL_TABLE_SUPPORT */