aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/scripts/syscalltbl.sh
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-03-18 22:07:37 -0700
committerNamhyung Kim <namhyung@kernel.org>2025-03-20 22:58:20 -0700
commit16ab5c708d9980464a0e034f6eccdece8cbe2dae (patch)
tree728731645e115acaa3df45b7689da6699f346b3d /tools/perf/scripts/syscalltbl.sh
parentperf syscalltbl: Use lookup table containing multiple architectures (diff)
downloadwireguard-linux-16ab5c708d9980464a0e034f6eccdece8cbe2dae.tar.xz
wireguard-linux-16ab5c708d9980464a0e034f6eccdece8cbe2dae.zip
perf build: Remove Makefile.syscalls
Now a single beauty file is generated and used by all architectures, remove the per-architecture Makefiles, Kbuild files and previous generator script. Note: there was conversation with Charlie Jenkins <charlie@rivosinc.com> and they'd written an alternate approach to support multiple architectures: https://lore.kernel.org/all/20250114-perf_syscall_arch_runtime-v1-1-5b304e408e11@rivosinc.com/ It would have been better to have helped Charlie fix their series (my apologies) but they agreed that the approach taken here was likely best for longer term maintainability: https://lore.kernel.org/lkml/Z6Jk_UN9i69QGqUj@ghost/ Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-by: Howard Chu <howardchu95@gmail.com> Reviewed-by: Charlie Jenkins <charlie@rivosinc.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Arnaldo Carvalho de Melo <acme@kernel.org> Link: https://lore.kernel.org/r/20250319050741.269828-11-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to '')
-rwxr-xr-xtools/perf/scripts/syscalltbl.sh76
1 files changed, 0 insertions, 76 deletions
diff --git a/tools/perf/scripts/syscalltbl.sh b/tools/perf/scripts/syscalltbl.sh
deleted file mode 100755
index a39b3013b103..000000000000
--- a/tools/perf/scripts/syscalltbl.sh
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/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"
-
-sorted_table=$(mktemp /tmp/syscalltbl.XXXXXX)
-grep -E "^[0-9]+[[:space:]]+$abis" "$infile" | sort -n > $sorted_table
-
-echo "static const char *const syscall_num_to_name[] = {" > $outfile
-# the params are: nr abi name entry compat
-# use _ for intentionally unused variables according to SC2034
-while read nr _ name _ _; do
- echo " [$nr] = \"$name\"," >> $outfile
-done < $sorted_table
-echo "};" >> $outfile
-
-echo "static const uint16_t syscall_sorted_names[] = {" >> $outfile
-
-# When sorting by name, add a suffix of 0s upto 20 characters so that system
-# calls that differ with a numerical suffix don't sort before those
-# without. This default behavior of sort differs from that of strcmp used at
-# runtime. Use sed to strip the trailing 0s suffix afterwards.
-grep -E "^[0-9]+[[:space:]]+$abis" "$infile" | awk '{printf $3; for (i = length($3); i < 20; i++) { printf "0"; }; print " " $1}'| sort | sed 's/\([a-zA-Z1-9]\+\)0\+ \([0-9]\+\)/\1 \2/' > $sorted_table
-while read name nr; do
- echo " $nr, /* $name */" >> $outfile
-done < $sorted_table
-echo "};" >> $outfile
-
-rm -f $sorted_table