mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-11-27 13:13:14 +00:00
Add utilities to help checking capabilities of the running procss. Make
perf link with libcap, if it is available. If no libcap-dev[el], assume
no capabilities.
Committer testing:
$ make O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/home/acme/git/perf/tools/perf'
BUILD: Doing 'make -j8' parallel build
Auto-detecting system features:
<SNIP>
... libbfd: [ on ]
... libcap: [ OFF ]
... libelf: [ on ]
<SNIP>
Makefile.config:833: No libcap found, disables capability support, please install libcap-devel/libcap-dev
<SNIP>
$ grep libcap /tmp/build/perf/FEATURE-DUMP
feature-libcap=0
$ cat /tmp/build/perf/feature/test-libcap.make.output
test-libcap.c:2:10: fatal error: sys/capability.h: No such file or directory
2 | #include <sys/capability.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
$
Now install libcap-devel and try again:
$ make O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/home/acme/git/perf/tools/perf'
BUILD: Doing 'make -j8' parallel build
Warning: Kernel ABI header at 'tools/include/linux/bits.h' differs from latest version at 'include/linux/bits.h'
diff -u tools/include/linux/bits.h include/linux/bits.h
Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
Auto-detecting system features:
<SNIP>
... libbfd: [ on ]
... libcap: [ on ]
... libelf: [ on ]
<SNIP>>
CC /tmp/build/perf/jvmti/libjvmti.o
<SNIP>>
$ grep libcap /tmp/build/perf/FEATURE-DUMP
feature-libcap=1
$ cat /tmp/build/perf/feature/test-libcap.make.output
$ ldd /tmp/build/perf/feature/test-libcap.make.bin
ldd: /tmp/build/perf/feature/test-libcap.make.bin: No such file or directory
$ ldd /tmp/build/perf/feature/test-libcap.bin
linux-vdso.so.1 (0x00007ffc35bfe000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007ff9c62ff000)
libc.so.6 => /lib64/libc.so.6 (0x00007ff9c6139000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff9c6326000)
$
Signed-off-by: Igor Lubashev <ilubashe@akamai.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: James Morris <jmorris@namei.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
[ split from a larger patch ]
Link: http://lkml.kernel.org/r/8a1e76cf5c7c9796d0d4d240fbaa85305298aafa.1565188228.git.ilubashe@akamai.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
||
|---|---|---|
| .. | ||
| .gitignore | ||
| Makefile | ||
| test-all.c | ||
| test-backtrace.c | ||
| test-bionic.c | ||
| test-bpf.c | ||
| test-clang.cpp | ||
| test-compile.c | ||
| test-cplus-demangle.c | ||
| test-cxx.cpp | ||
| test-disassembler-four-args.c | ||
| test-dwarf_getlocations.c | ||
| test-dwarf.c | ||
| test-eventfd.c | ||
| test-fortify-source.c | ||
| test-get_cpuid.c | ||
| test-get_current_dir_name.c | ||
| test-gettid.c | ||
| test-glibc.c | ||
| test-gtk2-infobar.c | ||
| test-gtk2.c | ||
| test-hello.c | ||
| test-jvmti-cmlr.c | ||
| test-jvmti.c | ||
| test-libaio.c | ||
| test-libaudit.c | ||
| test-libbabeltrace.c | ||
| test-libbfd.c | ||
| test-libcap.c | ||
| test-libcrypto.c | ||
| test-libdw-dwarf-unwind.c | ||
| test-libelf-gelf_getnote.c | ||
| test-libelf-getphdrnum.c | ||
| test-libelf-getshdrstrndx.c | ||
| test-libelf-mmap.c | ||
| test-libelf.c | ||
| test-libnuma.c | ||
| test-libopencsd.c | ||
| test-libperl.c | ||
| test-libpython-version.c | ||
| test-libpython.c | ||
| test-libslang-include-subdir.c | ||
| test-libslang.c | ||
| test-libunwind-aarch64.c | ||
| test-libunwind-arm.c | ||
| test-libunwind-debug-frame-aarch64.c | ||
| test-libunwind-debug-frame-arm.c | ||
| test-libunwind-debug-frame.c | ||
| test-libunwind-x86_64.c | ||
| test-libunwind-x86.c | ||
| test-libunwind.c | ||
| test-libzstd.c | ||
| test-llvm-version.cpp | ||
| test-llvm.cpp | ||
| test-lzma.c | ||
| test-numa_num_possible_cpus.c | ||
| test-pthread-attr-setaffinity-np.c | ||
| test-pthread-barrier.c | ||
| test-reallocarray.c | ||
| test-sched_getcpu.c | ||
| test-sdt.c | ||
| test-setns.c | ||
| test-stackprotector-all.c | ||
| test-sync-compare-and-swap.c | ||
| test-timerfd.c | ||
| test-zlib.c | ||