mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
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 <charlie@rivosinc.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Christian Brauner <brauner@kernel.org> Cc: Guo Ren <guoren@kernel.org> Cc: Günther Noack <gnoack@google.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: John Garry <john.g.garry@oracle.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Leo Yan <leo.yan@linux.dev> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mickaël Salaün <mic@digikod.net> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20250108-perf_syscalltbl-v6-16-7543b5293098@rivosinc.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
00d1bfae1b
commit
3cc550f5bb
15 changed files with 11 additions and 164 deletions
|
@ -83,7 +83,7 @@ scripts/ver_linux is a good way to check if your system already has
|
||||||
the necessary tools::
|
the necessary tools::
|
||||||
|
|
||||||
sudo apt-get build-essentials flex bison yacc
|
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::
|
cscope is a good tool to browse kernel sources. Let's install it now::
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ FILES= \
|
||||||
test-gtk2.bin \
|
test-gtk2.bin \
|
||||||
test-gtk2-infobar.bin \
|
test-gtk2-infobar.bin \
|
||||||
test-hello.bin \
|
test-hello.bin \
|
||||||
test-libaudit.bin \
|
|
||||||
test-libbfd.bin \
|
test-libbfd.bin \
|
||||||
test-libbfd-buildid.bin \
|
test-libbfd-buildid.bin \
|
||||||
test-disassembler-four-args.bin \
|
test-disassembler-four-args.bin \
|
||||||
|
@ -232,9 +231,6 @@ $(OUTPUT)test-libunwind-debug-frame-arm.bin:
|
||||||
$(OUTPUT)test-libunwind-debug-frame-aarch64.bin:
|
$(OUTPUT)test-libunwind-debug-frame-aarch64.bin:
|
||||||
$(BUILD) -lelf -llzma -lunwind-aarch64
|
$(BUILD) -lelf -llzma -lunwind-aarch64
|
||||||
|
|
||||||
$(OUTPUT)test-libaudit.bin:
|
|
||||||
$(BUILD) -laudit
|
|
||||||
|
|
||||||
$(OUTPUT)test-libslang.bin:
|
$(OUTPUT)test-libslang.bin:
|
||||||
$(BUILD) -lslang
|
$(BUILD) -lslang
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
|
||||||
#include <libaudit.h>
|
|
||||||
|
|
||||||
extern int printf(const char *format, ...);
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
printf("error message: %s\n", audit_errno_to_name(0));
|
|
||||||
|
|
||||||
return audit_open();
|
|
||||||
}
|
|
|
@ -51,7 +51,6 @@ feature::
|
||||||
dwarf_getlocations / HAVE_LIBDW_SUPPORT
|
dwarf_getlocations / HAVE_LIBDW_SUPPORT
|
||||||
dwarf-unwind / HAVE_DWARF_UNWIND_SUPPORT
|
dwarf-unwind / HAVE_DWARF_UNWIND_SUPPORT
|
||||||
auxtrace / HAVE_AUXTRACE_SUPPORT
|
auxtrace / HAVE_AUXTRACE_SUPPORT
|
||||||
libaudit / HAVE_LIBAUDIT_SUPPORT
|
|
||||||
libbfd / HAVE_LIBBFD_SUPPORT
|
libbfd / HAVE_LIBBFD_SUPPORT
|
||||||
libcapstone / HAVE_LIBCAPSTONE_SUPPORT
|
libcapstone / HAVE_LIBCAPSTONE_SUPPORT
|
||||||
libcrypto / HAVE_LIBCRYPTO_SUPPORT
|
libcrypto / HAVE_LIBCRYPTO_SUPPORT
|
||||||
|
@ -67,7 +66,6 @@ feature::
|
||||||
libunwind / HAVE_LIBUNWIND_SUPPORT
|
libunwind / HAVE_LIBUNWIND_SUPPORT
|
||||||
lzma / HAVE_LZMA_SUPPORT
|
lzma / HAVE_LZMA_SUPPORT
|
||||||
numa_num_possible_cpus / HAVE_LIBNUMA_SUPPORT
|
numa_num_possible_cpus / HAVE_LIBNUMA_SUPPORT
|
||||||
syscall_table / HAVE_SYSCALL_TABLE_SUPPORT
|
|
||||||
zlib / HAVE_ZLIB_SUPPORT
|
zlib / HAVE_ZLIB_SUPPORT
|
||||||
zstd / HAVE_ZSTD_SUPPORT
|
zstd / HAVE_ZSTD_SUPPORT
|
||||||
|
|
||||||
|
|
|
@ -28,20 +28,7 @@ include $(srctree)/tools/scripts/Makefile.arch
|
||||||
|
|
||||||
$(call detected_var,SRCARCH)
|
$(call detected_var,SRCARCH)
|
||||||
|
|
||||||
ifneq ($(NO_SYSCALL_TABLE),1)
|
|
||||||
NO_SYSCALL_TABLE := 1
|
|
||||||
|
|
||||||
# architectures that use the generic syscall table scripts
|
|
||||||
ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),)
|
|
||||||
NO_SYSCALL_TABLE := 0
|
|
||||||
CFLAGS += -DGENERIC_SYSCALL_TABLE
|
|
||||||
CFLAGS += -I$(OUTPUT)arch/$(SRCARCH)/include/generated
|
CFLAGS += -I$(OUTPUT)arch/$(SRCARCH)/include/generated
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(NO_SYSCALL_TABLE),1)
|
|
||||||
CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Additional ARCH settings for ppc
|
# Additional ARCH settings for ppc
|
||||||
ifeq ($(SRCARCH),powerpc)
|
ifeq ($(SRCARCH),powerpc)
|
||||||
|
@ -776,21 +763,7 @@ ifndef NO_LIBUNWIND
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(NO_LIBTRACEEVENT),1)
|
ifneq ($(NO_LIBTRACEEVENT),1)
|
||||||
ifeq ($(NO_SYSCALL_TABLE),0)
|
|
||||||
$(call detected,CONFIG_TRACE)
|
$(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
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef NO_LIBCRYPTO
|
ifndef NO_LIBCRYPTO
|
||||||
|
|
|
@ -59,8 +59,6 @@ include ../scripts/utilities.mak
|
||||||
#
|
#
|
||||||
# Define NO_LIBNUMA if you do not want numa perf benchmark
|
# 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_LIBBIONIC if you do not want bionic support
|
||||||
#
|
#
|
||||||
# Define NO_LIBCRYPTO if you do not want libcrypto (openssl) 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 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_LIBPFM4 to disable libpfm4 events extension.
|
||||||
#
|
#
|
||||||
# Define NO_LIBDEBUGINFOD if you do not want support debuginfod
|
# Define NO_LIBDEBUGINFOD if you do not want support debuginfod
|
||||||
|
@ -310,11 +304,7 @@ ifeq ($(filter feature-dump,$(MAKECMDGOALS)),feature-dump)
|
||||||
FEATURE_TESTS := all
|
FEATURE_TESTS := all
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
# architectures that use the generic syscall table
|
|
||||||
generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc s390
|
|
||||||
ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),)
|
|
||||||
include $(srctree)/tools/perf/scripts/Makefile.syscalls
|
include $(srctree)/tools/perf/scripts/Makefile.syscalls
|
||||||
endif
|
|
||||||
include Makefile.config
|
include Makefile.config
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -1102,11 +1092,6 @@ endif
|
||||||
$(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
|
$(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
|
||||||
$(call QUIET_INSTALL, perf-iostat) \
|
$(call QUIET_INSTALL, perf-iostat) \
|
||||||
$(INSTALL) $(OUTPUT)perf-iostat -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
|
$(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
|
ifndef NO_LIBPERL
|
||||||
$(call QUIET_INSTALL, perl-scripts) \
|
$(call QUIET_INSTALL, perl-scripts) \
|
||||||
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
|
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
|
||||||
|
|
|
@ -31,7 +31,6 @@ struct feature_status supported_features[] = {
|
||||||
FEATURE_STATUS("dwarf_getlocations", HAVE_LIBDW_SUPPORT),
|
FEATURE_STATUS("dwarf_getlocations", HAVE_LIBDW_SUPPORT),
|
||||||
FEATURE_STATUS("dwarf-unwind", HAVE_DWARF_UNWIND_SUPPORT),
|
FEATURE_STATUS("dwarf-unwind", HAVE_DWARF_UNWIND_SUPPORT),
|
||||||
FEATURE_STATUS("auxtrace", HAVE_AUXTRACE_SUPPORT),
|
FEATURE_STATUS("auxtrace", HAVE_AUXTRACE_SUPPORT),
|
||||||
FEATURE_STATUS("libaudit", HAVE_LIBAUDIT_SUPPORT),
|
|
||||||
FEATURE_STATUS("libbfd", HAVE_LIBBFD_SUPPORT),
|
FEATURE_STATUS("libbfd", HAVE_LIBBFD_SUPPORT),
|
||||||
FEATURE_STATUS("libcapstone", HAVE_LIBCAPSTONE_SUPPORT),
|
FEATURE_STATUS("libcapstone", HAVE_LIBCAPSTONE_SUPPORT),
|
||||||
FEATURE_STATUS("libcrypto", HAVE_LIBCRYPTO_SUPPORT),
|
FEATURE_STATUS("libcrypto", HAVE_LIBCRYPTO_SUPPORT),
|
||||||
|
@ -47,7 +46,6 @@ struct feature_status supported_features[] = {
|
||||||
FEATURE_STATUS("libunwind", HAVE_LIBUNWIND_SUPPORT),
|
FEATURE_STATUS("libunwind", HAVE_LIBUNWIND_SUPPORT),
|
||||||
FEATURE_STATUS("lzma", HAVE_LZMA_SUPPORT),
|
FEATURE_STATUS("lzma", HAVE_LZMA_SUPPORT),
|
||||||
FEATURE_STATUS("numa_num_possible_cpus", HAVE_LIBNUMA_SUPPORT),
|
FEATURE_STATUS("numa_num_possible_cpus", HAVE_LIBNUMA_SUPPORT),
|
||||||
FEATURE_STATUS("syscall_table", HAVE_SYSCALL_TABLE_SUPPORT),
|
|
||||||
FEATURE_STATUS("zlib", HAVE_ZLIB_SUPPORT),
|
FEATURE_STATUS("zlib", HAVE_ZLIB_SUPPORT),
|
||||||
FEATURE_STATUS("zstd", HAVE_ZSTD_SUPPORT),
|
FEATURE_STATUS("zstd", HAVE_ZSTD_SUPPORT),
|
||||||
|
|
||||||
|
|
|
@ -447,9 +447,7 @@ int cmd_help(int argc, const char **argv)
|
||||||
#ifdef HAVE_LIBELF_SUPPORT
|
#ifdef HAVE_LIBELF_SUPPORT
|
||||||
"probe",
|
"probe",
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)
|
|
||||||
"trace",
|
"trace",
|
||||||
#endif
|
|
||||||
NULL };
|
NULL };
|
||||||
const char *builtin_help_usage[] = {
|
const char *builtin_help_usage[] = {
|
||||||
"perf help [--all] [--man|--web|--info] [command]",
|
"perf help [--all] [--man|--web|--info] [command]",
|
||||||
|
|
|
@ -2073,30 +2073,11 @@ static int trace__read_syscall_info(struct trace *trace, int id)
|
||||||
const char *name = syscalltbl__name(trace->sctbl, id);
|
const char *name = syscalltbl__name(trace->sctbl, id);
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
#ifdef HAVE_SYSCALL_TABLE_SUPPORT
|
|
||||||
if (trace->syscalls.table == NULL) {
|
if (trace->syscalls.table == NULL) {
|
||||||
trace->syscalls.table = calloc(trace->sctbl->syscalls.max_id + 1, sizeof(*sc));
|
trace->syscalls.table = calloc(trace->sctbl->syscalls.max_id + 1, sizeof(*sc));
|
||||||
if (trace->syscalls.table == NULL)
|
if (trace->syscalls.table == NULL)
|
||||||
return -ENOMEM;
|
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;
|
sc = trace->syscalls.table + id;
|
||||||
if (sc->nonexistent)
|
if (sc->nonexistent)
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
|
@ -2447,18 +2428,7 @@ static struct syscall *trace__syscall_info(struct trace *trace,
|
||||||
|
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
|
|
||||||
#ifdef HAVE_SYSCALL_TABLE_SUPPORT
|
|
||||||
if (id > trace->sctbl->syscalls.max_id) {
|
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;
|
goto out_cant_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ static struct cmd_struct commands[] = {
|
||||||
#endif
|
#endif
|
||||||
{ "kvm", cmd_kvm, 0 },
|
{ "kvm", cmd_kvm, 0 },
|
||||||
{ "test", cmd_test, 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 },
|
{ "trace", cmd_trace, 0 },
|
||||||
#endif
|
#endif
|
||||||
{ "inject", cmd_inject, 0 },
|
{ "inject", cmd_inject, 0 },
|
||||||
|
@ -514,10 +514,6 @@ int main(int argc, const char **argv)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"trace command not available: missing libtraceevent devel package at build time.\n");
|
"trace command not available: missing libtraceevent devel package at build time.\n");
|
||||||
goto out;
|
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
|
#else
|
||||||
setup_path();
|
setup_path();
|
||||||
argv[0] = "trace";
|
argv[0] = "trace";
|
||||||
|
|
|
@ -86,7 +86,6 @@ make_no_libdw_dwarf_unwind := NO_LIBDW_DWARF_UNWIND=1
|
||||||
make_no_backtrace := NO_BACKTRACE=1
|
make_no_backtrace := NO_BACKTRACE=1
|
||||||
make_no_libcapstone := NO_CAPSTONE=1
|
make_no_libcapstone := NO_CAPSTONE=1
|
||||||
make_no_libnuma := NO_LIBNUMA=1
|
make_no_libnuma := NO_LIBNUMA=1
|
||||||
make_no_libaudit := NO_LIBAUDIT=1
|
|
||||||
make_no_libbionic := NO_LIBBIONIC=1
|
make_no_libbionic := NO_LIBBIONIC=1
|
||||||
make_no_auxtrace := NO_AUXTRACE=1
|
make_no_auxtrace := NO_AUXTRACE=1
|
||||||
make_no_libbpf := NO_LIBBPF=1
|
make_no_libbpf := NO_LIBBPF=1
|
||||||
|
@ -97,7 +96,6 @@ make_no_libllvm := NO_LIBLLVM=1
|
||||||
make_with_babeltrace:= LIBBABELTRACE=1
|
make_with_babeltrace:= LIBBABELTRACE=1
|
||||||
make_with_coresight := CORESIGHT=1
|
make_with_coresight := CORESIGHT=1
|
||||||
make_no_sdt := NO_SDT=1
|
make_no_sdt := NO_SDT=1
|
||||||
make_no_syscall_tbl := NO_SYSCALL_TABLE=1
|
|
||||||
make_no_libpfm4 := NO_LIBPFM4=1
|
make_no_libpfm4 := NO_LIBPFM4=1
|
||||||
make_with_gtk2 := GTK2=1
|
make_with_gtk2 := GTK2=1
|
||||||
make_refcnt_check := EXTRA_CFLAGS="-DREFCNT_CHECKING=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
|
# all the NO_* variable combined
|
||||||
make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_GTK2=1
|
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_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_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_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) contains all available tests
|
||||||
run := make_pure
|
run := make_pure
|
||||||
|
@ -158,7 +156,6 @@ run += make_no_libdw_dwarf_unwind
|
||||||
run += make_no_backtrace
|
run += make_no_backtrace
|
||||||
run += make_no_libcapstone
|
run += make_no_libcapstone
|
||||||
run += make_no_libnuma
|
run += make_no_libnuma
|
||||||
run += make_no_libaudit
|
|
||||||
run += make_no_libbionic
|
run += make_no_libbionic
|
||||||
run += make_no_auxtrace
|
run += make_no_auxtrace
|
||||||
run += make_no_libbpf
|
run += make_no_libbpf
|
||||||
|
|
|
@ -480,19 +480,19 @@ const char *perf_env__arch(struct perf_env *env)
|
||||||
return normalize_arch(arch_name);
|
return normalize_arch(arch_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_SYSCALL_TABLE_SUPPORT) && defined(HAVE_LIBTRACEEVENT)
|
#if defined(HAVE_LIBTRACEEVENT)
|
||||||
#include "trace/beauty/arch_errno_names.c"
|
#include "trace/beauty/arch_errno_names.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *perf_env__arch_strerrno(struct perf_env *env __maybe_unused, int err __maybe_unused)
|
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)
|
if (env->arch_strerrno == NULL)
|
||||||
env->arch_strerrno = arch_syscalls__strerrno_function(perf_env__arch(env));
|
env->arch_strerrno = arch_syscalls__strerrno_function(perf_env__arch(env));
|
||||||
|
|
||||||
return env->arch_strerrno ? env->arch_strerrno(err) : "no arch specific strerrno function";
|
return env->arch_strerrno ? env->arch_strerrno(err) : "no arch specific strerrno function";
|
||||||
#else
|
#else
|
||||||
return "!(HAVE_SYSCALL_TABLE_SUPPORT && HAVE_LIBTRACEEVENT)";
|
return "!HAVE_LIBTRACEEVENT";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ do
|
||||||
done
|
done
|
||||||
echo "#endif /* HAVE_LIBELF_SUPPORT */"
|
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 |
|
sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
|
||||||
sort |
|
sort |
|
||||||
while read cmd
|
while read cmd
|
||||||
|
@ -51,7 +51,7 @@ do
|
||||||
p
|
p
|
||||||
}' "Documentation/perf-$cmd.txt"
|
}' "Documentation/perf-$cmd.txt"
|
||||||
done
|
done
|
||||||
echo "#endif /* HAVE_LIBTRACEEVENT && (HAVE_LIBAUDIT_SUPPORT || HAVE_SYSCALL_TABLE_SUPPORT) */"
|
echo "#endif /* HAVE_LIBTRACEEVENT */"
|
||||||
|
|
||||||
echo "#ifdef HAVE_LIBTRACEEVENT"
|
echo "#ifdef HAVE_LIBTRACEEVENT"
|
||||||
sed -n -e 's/^perf-\([^ ]*\)[ ].* traceevent.*/\1/p' command-list.txt |
|
sed -n -e 's/^perf-\([^ ]*\)[ ].* traceevent.*/\1/p' command-list.txt |
|
||||||
|
|
|
@ -10,20 +10,12 @@
|
||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
#include <linux/zalloc.h>
|
#include <linux/zalloc.h>
|
||||||
|
|
||||||
#ifdef HAVE_SYSCALL_TABLE_SUPPORT
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "string2.h"
|
#include "string2.h"
|
||||||
|
|
||||||
#if defined(GENERIC_SYSCALL_TABLE)
|
|
||||||
#include <syscall_table.h>
|
#include <syscall_table.h>
|
||||||
const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID;
|
const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID;
|
||||||
static const char *const *syscalltbl_native = syscalltbl;
|
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 {
|
struct syscall {
|
||||||
int id;
|
int id;
|
||||||
|
@ -131,47 +123,3 @@ int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_g
|
||||||
*idx = -1;
|
*idx = -1;
|
||||||
return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx);
|
return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* HAVE_SYSCALL_TABLE_SUPPORT */
|
|
||||||
|
|
||||||
#include <libaudit.h>
|
|
||||||
|
|
||||||
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 */
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#define __PERF_SYSCALLTBL_H
|
#define __PERF_SYSCALLTBL_H
|
||||||
|
|
||||||
struct syscalltbl {
|
struct syscalltbl {
|
||||||
int audit_machine;
|
|
||||||
struct {
|
struct {
|
||||||
int max_id;
|
int max_id;
|
||||||
int nr_entries;
|
int nr_entries;
|
||||||
|
|
Loading…
Add table
Reference in a new issue