]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf syscalltbl: Remove struct syscalltbl
authorIan Rogers <irogers@google.com>
Wed, 19 Mar 2025 05:07:32 +0000 (22:07 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 21 Mar 2025 05:57:57 +0000 (22:57 -0700)
commit5c2938fe789c1876a35a1fbc24da3800b33adf26
tree5785226022d3013e7aca6d4be1f0f95af1bcd4ff
parent3d94b8441c1c4faca8c9f6aaa04d6d886b6e08c6
perf syscalltbl: Remove struct syscalltbl

The syscalltbl held entries of system call name and number pairs,
generated from a native syscalltbl at start up. As there are gaps in
the system call number there is a notion of index into the
table. Going forward we want the system call table to be identifiable
by a machine type, for example, i386 vs x86-64. Change the interface
to the syscalltbl so (1) a (currently unused machine type of EM_HOST)
is passed (2) the index to syscall number and system call name mapping
is computed at build time.

Two tables are used for this, an array of system call number to name,
an array of system call numbers sorted by the system call name. The
sorted array doesn't store strings in part to save memory and
relocations. The index notion is carried forward and is an index into
the sorted array of system call numbers, the data structures are
opaque (held only in syscalltbl.c), and so the number of indices for a
machine type is exposed as a new API.

The arrays are computed in the syscalltbl.sh script and so no start-up
time computation and storage is necessary.

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-6-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-trace.c
tools/perf/scripts/syscalltbl.sh
tools/perf/util/syscalltbl.c
tools/perf/util/syscalltbl.h