Skip to content

Commit 3cc550f

Browse files
charlie-rivosacmel
authored andcommitted
perf tools: Remove dependency on libaudit
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 <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Guo Ren <[email protected]> Cc: Günther Noack <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Garry <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mickaël Salaün <[email protected]> Cc: Mike Leach <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 00d1bfa commit 3cc550f

File tree

15 files changed

+11
-164
lines changed

15 files changed

+11
-164
lines changed

Documentation/admin-guide/workload-tracing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ scripts/ver_linux is a good way to check if your system already has
8383
the necessary tools::
8484

8585
sudo apt-get build-essentials flex bison yacc
86-
sudo apt install libelf-dev systemtap-sdt-dev libaudit-dev libslang2-dev libperl-dev libdw-dev
86+
sudo apt install libelf-dev systemtap-sdt-dev libslang2-dev libperl-dev libdw-dev
8787

8888
cscope is a good tool to browse kernel sources. Let's install it now::
8989

tools/build/feature/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ FILES= \
1313
test-gtk2.bin \
1414
test-gtk2-infobar.bin \
1515
test-hello.bin \
16-
test-libaudit.bin \
1716
test-libbfd.bin \
1817
test-libbfd-buildid.bin \
1918
test-disassembler-four-args.bin \
@@ -232,9 +231,6 @@ $(OUTPUT)test-libunwind-debug-frame-arm.bin:
232231
$(OUTPUT)test-libunwind-debug-frame-aarch64.bin:
233232
$(BUILD) -lelf -llzma -lunwind-aarch64
234233

235-
$(OUTPUT)test-libaudit.bin:
236-
$(BUILD) -laudit
237-
238234
$(OUTPUT)test-libslang.bin:
239235
$(BUILD) -lslang
240236

tools/build/feature/test-libaudit.c

Lines changed: 0 additions & 11 deletions
This file was deleted.

tools/perf/Documentation/perf-check.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ feature::
5151
dwarf_getlocations / HAVE_LIBDW_SUPPORT
5252
dwarf-unwind / HAVE_DWARF_UNWIND_SUPPORT
5353
auxtrace / HAVE_AUXTRACE_SUPPORT
54-
libaudit / HAVE_LIBAUDIT_SUPPORT
5554
libbfd / HAVE_LIBBFD_SUPPORT
5655
libcapstone / HAVE_LIBCAPSTONE_SUPPORT
5756
libcrypto / HAVE_LIBCRYPTO_SUPPORT
@@ -67,7 +66,6 @@ feature::
6766
libunwind / HAVE_LIBUNWIND_SUPPORT
6867
lzma / HAVE_LZMA_SUPPORT
6968
numa_num_possible_cpus / HAVE_LIBNUMA_SUPPORT
70-
syscall_table / HAVE_SYSCALL_TABLE_SUPPORT
7169
zlib / HAVE_ZLIB_SUPPORT
7270
zstd / HAVE_ZSTD_SUPPORT
7371

tools/perf/Makefile.config

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,7 @@ include $(srctree)/tools/scripts/Makefile.arch
2828

2929
$(call detected_var,SRCARCH)
3030

31-
ifneq ($(NO_SYSCALL_TABLE),1)
32-
NO_SYSCALL_TABLE := 1
33-
34-
# architectures that use the generic syscall table scripts
35-
ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),)
36-
NO_SYSCALL_TABLE := 0
37-
CFLAGS += -DGENERIC_SYSCALL_TABLE
38-
CFLAGS += -I$(OUTPUT)arch/$(SRCARCH)/include/generated
39-
endif
40-
41-
ifneq ($(NO_SYSCALL_TABLE),1)
42-
CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
43-
endif
44-
endif
31+
CFLAGS += -I$(OUTPUT)arch/$(SRCARCH)/include/generated
4532

4633
# Additional ARCH settings for ppc
4734
ifeq ($(SRCARCH),powerpc)
@@ -776,21 +763,7 @@ ifndef NO_LIBUNWIND
776763
endif
777764

778765
ifneq ($(NO_LIBTRACEEVENT),1)
779-
ifeq ($(NO_SYSCALL_TABLE),0)
780-
$(call detected,CONFIG_TRACE)
781-
else
782-
ifndef NO_LIBAUDIT
783-
$(call feature_check,libaudit)
784-
ifneq ($(feature-libaudit), 1)
785-
$(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev)
786-
NO_LIBAUDIT := 1
787-
else
788-
CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
789-
EXTLIBS += -laudit
790-
$(call detected,CONFIG_TRACE)
791-
endif
792-
endif
793-
endif
766+
$(call detected,CONFIG_TRACE)
794767
endif
795768

796769
ifndef NO_LIBCRYPTO

tools/perf/Makefile.perf

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ include ../scripts/utilities.mak
5959
#
6060
# Define NO_LIBNUMA if you do not want numa perf benchmark
6161
#
62-
# Define NO_LIBAUDIT if you do not want libaudit support
63-
#
6462
# Define NO_LIBBIONIC if you do not want bionic support
6563
#
6664
# Define NO_LIBCRYPTO if you do not want libcrypto (openssl) support
@@ -119,10 +117,6 @@ include ../scripts/utilities.mak
119117
#
120118
# Define LIBBPF_DYNAMIC to enable libbpf dynamic linking.
121119
#
122-
# Define NO_SYSCALL_TABLE=1 to disable the use of syscall id to/from name tables
123-
# generated from the kernel .tbl or unistd.h files and use, if available, libaudit
124-
# for doing the conversions to/from strings/id.
125-
#
126120
# Define NO_LIBPFM4 to disable libpfm4 events extension.
127121
#
128122
# Define NO_LIBDEBUGINFOD if you do not want support debuginfod
@@ -310,11 +304,7 @@ ifeq ($(filter feature-dump,$(MAKECMDGOALS)),feature-dump)
310304
FEATURE_TESTS := all
311305
endif
312306
endif
313-
# architectures that use the generic syscall table
314-
generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc s390
315-
ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),)
316307
include $(srctree)/tools/perf/scripts/Makefile.syscalls
317-
endif
318308
include Makefile.config
319309
endif
320310

@@ -1102,11 +1092,6 @@ endif
11021092
$(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
11031093
$(call QUIET_INSTALL, perf-iostat) \
11041094
$(INSTALL) $(OUTPUT)perf-iostat -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
1105-
ifndef NO_LIBAUDIT
1106-
$(call QUIET_INSTALL, strace/groups) \
1107-
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(STRACE_GROUPS_INSTDIR_SQ)'; \
1108-
$(INSTALL) trace/strace/groups/* -m 644 -t '$(DESTDIR_SQ)$(STRACE_GROUPS_INSTDIR_SQ)'
1109-
endif
11101095
ifndef NO_LIBPERL
11111096
$(call QUIET_INSTALL, perl-scripts) \
11121097
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \

tools/perf/builtin-check.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ struct feature_status supported_features[] = {
3131
FEATURE_STATUS("dwarf_getlocations", HAVE_LIBDW_SUPPORT),
3232
FEATURE_STATUS("dwarf-unwind", HAVE_DWARF_UNWIND_SUPPORT),
3333
FEATURE_STATUS("auxtrace", HAVE_AUXTRACE_SUPPORT),
34-
FEATURE_STATUS("libaudit", HAVE_LIBAUDIT_SUPPORT),
3534
FEATURE_STATUS("libbfd", HAVE_LIBBFD_SUPPORT),
3635
FEATURE_STATUS("libcapstone", HAVE_LIBCAPSTONE_SUPPORT),
3736
FEATURE_STATUS("libcrypto", HAVE_LIBCRYPTO_SUPPORT),
@@ -47,7 +46,6 @@ struct feature_status supported_features[] = {
4746
FEATURE_STATUS("libunwind", HAVE_LIBUNWIND_SUPPORT),
4847
FEATURE_STATUS("lzma", HAVE_LZMA_SUPPORT),
4948
FEATURE_STATUS("numa_num_possible_cpus", HAVE_LIBNUMA_SUPPORT),
50-
FEATURE_STATUS("syscall_table", HAVE_SYSCALL_TABLE_SUPPORT),
5149
FEATURE_STATUS("zlib", HAVE_ZLIB_SUPPORT),
5250
FEATURE_STATUS("zstd", HAVE_ZSTD_SUPPORT),
5351

tools/perf/builtin-help.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,7 @@ int cmd_help(int argc, const char **argv)
447447
#ifdef HAVE_LIBELF_SUPPORT
448448
"probe",
449449
#endif
450-
#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)
451450
"trace",
452-
#endif
453451
NULL };
454452
const char *builtin_help_usage[] = {
455453
"perf help [--all] [--man|--web|--info] [command]",

tools/perf/builtin-trace.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,30 +2073,11 @@ static int trace__read_syscall_info(struct trace *trace, int id)
20732073
const char *name = syscalltbl__name(trace->sctbl, id);
20742074
int err;
20752075

2076-
#ifdef HAVE_SYSCALL_TABLE_SUPPORT
20772076
if (trace->syscalls.table == NULL) {
20782077
trace->syscalls.table = calloc(trace->sctbl->syscalls.max_id + 1, sizeof(*sc));
20792078
if (trace->syscalls.table == NULL)
20802079
return -ENOMEM;
20812080
}
2082-
#else
2083-
if (id > trace->sctbl->syscalls.max_id || (id == 0 && trace->syscalls.table == NULL)) {
2084-
// When using libaudit we don't know beforehand what is the max syscall id
2085-
struct syscall *table = realloc(trace->syscalls.table, (id + 1) * sizeof(*sc));
2086-
2087-
if (table == NULL)
2088-
return -ENOMEM;
2089-
2090-
// Need to memset from offset 0 and +1 members if brand new
2091-
if (trace->syscalls.table == NULL)
2092-
memset(table, 0, (id + 1) * sizeof(*sc));
2093-
else
2094-
memset(table + trace->sctbl->syscalls.max_id + 1, 0, (id - trace->sctbl->syscalls.max_id) * sizeof(*sc));
2095-
2096-
trace->syscalls.table = table;
2097-
trace->sctbl->syscalls.max_id = id;
2098-
}
2099-
#endif
21002081
sc = trace->syscalls.table + id;
21012082
if (sc->nonexistent)
21022083
return -EEXIST;
@@ -2447,18 +2428,7 @@ static struct syscall *trace__syscall_info(struct trace *trace,
24472428

24482429
err = -EINVAL;
24492430

2450-
#ifdef HAVE_SYSCALL_TABLE_SUPPORT
24512431
if (id > trace->sctbl->syscalls.max_id) {
2452-
#else
2453-
if (id >= trace->sctbl->syscalls.max_id) {
2454-
/*
2455-
* With libaudit we don't know beforehand what is the max_id,
2456-
* so we let trace__read_syscall_info() figure that out as we
2457-
* go on reading syscalls.
2458-
*/
2459-
err = trace__read_syscall_info(trace, id);
2460-
if (err)
2461-
#endif
24622432
goto out_cant_read;
24632433
}
24642434

tools/perf/perf.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static struct cmd_struct commands[] = {
8484
#endif
8585
{ "kvm", cmd_kvm, 0 },
8686
{ "test", cmd_test, 0 },
87-
#if defined(HAVE_LIBTRACEEVENT) && (defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT))
87+
#if defined(HAVE_LIBTRACEEVENT)
8888
{ "trace", cmd_trace, 0 },
8989
#endif
9090
{ "inject", cmd_inject, 0 },
@@ -514,10 +514,6 @@ int main(int argc, const char **argv)
514514
fprintf(stderr,
515515
"trace command not available: missing libtraceevent devel package at build time.\n");
516516
goto out;
517-
#elif !defined(HAVE_LIBAUDIT_SUPPORT) && !defined(HAVE_SYSCALL_TABLE_SUPPORT)
518-
fprintf(stderr,
519-
"trace command not available: missing audit-libs devel package at build time.\n");
520-
goto out;
521517
#else
522518
setup_path();
523519
argv[0] = "trace";

0 commit comments

Comments
 (0)