Skip to content

Commit 747a9b0

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar: "Tooling fixes, the biggest patch is one that decouples the kernel's list.h from tooling list.h" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) perf tools: Fallback to srcdir/Documentation/tips.txt perf ui/tui: Print helpline message as is perf tools: Set and pass DOCDIR to builtin-report.c perf tools: Add file_only config option to strlist perf tools: Add more usage tips perf record: Add --buildid-all option tools subcmd: Add missing NORETURN define for parse-options.h tools: Fix formatting of the "make -C tools" help message tools: Make list.h self-sufficient perf tools: Fix mmap2 event allocation in synthesize code perf stat: Fix recort_usage typo perf test: Reset err after using it hold errcode in hist testcases perf test: Fix false TEST_OK result for 'perf test hist' tools build: Add BPF feature check to test-all perf bpf: Fix build breakage due to libbpf tools: Move Makefile.arch from perf/config to tools/scripts perf tools: Fix PowerPC native building perf tools: Fix phony build target for build-test perf tools: Add -lutil in python lib list for broken python-config perf tools: Add missing sources to perf's MANIFEST ...
2 parents 32250e4 + c366088 commit 747a9b0

File tree

28 files changed

+918
-66
lines changed

28 files changed

+918
-66
lines changed

tools/Makefile

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ include scripts/Makefile.include
88
help:
99
@echo 'Possible targets:'
1010
@echo ''
11-
@echo ' acpi - ACPI tools'
12-
@echo ' cgroup - cgroup tools'
13-
@echo ' cpupower - a tool for all things x86 CPU power'
14-
@echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
15-
@echo ' hv - tools used when in Hyper-V clients'
16-
@echo ' iio - IIO tools'
17-
@echo ' lguest - a minimal 32-bit x86 hypervisor'
18-
@echo ' perf - Linux performance measurement and analysis tool'
19-
@echo ' selftests - various kernel selftests'
20-
@echo ' spi - spi tools'
21-
@echo ' turbostat - Intel CPU idle stats and freq reporting tool'
22-
@echo ' usb - USB testing tools'
23-
@echo ' virtio - vhost test module'
24-
@echo ' net - misc networking tools'
25-
@echo ' vm - misc vm tools'
11+
@echo ' acpi - ACPI tools'
12+
@echo ' cgroup - cgroup tools'
13+
@echo ' cpupower - a tool for all things x86 CPU power'
14+
@echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
15+
@echo ' freefall - laptop accelerometer program for disk protection'
16+
@echo ' hv - tools used when in Hyper-V clients'
17+
@echo ' iio - IIO tools'
18+
@echo ' lguest - a minimal 32-bit x86 hypervisor'
19+
@echo ' net - misc networking tools'
20+
@echo ' perf - Linux performance measurement and analysis tool'
21+
@echo ' selftests - various kernel selftests'
22+
@echo ' spi - spi tools'
23+
@echo ' tmon - thermal monitoring and tuning tool'
24+
@echo ' turbostat - Intel CPU idle stats and freq reporting tool'
25+
@echo ' usb - USB testing tools'
26+
@echo ' virtio - vhost test module'
27+
@echo ' vm - misc vm tools'
2628
@echo ' x86_energy_perf_policy - Intel energy policy tool'
27-
@echo ' tmon - thermal monitoring and tuning tool'
28-
@echo ' freefall - laptop accelerometer program for disk protection'
2929
@echo ''
3030
@echo 'You can do:'
3131
@echo ' $$ make -C tools/ <tool>_install'
@@ -128,6 +128,12 @@ liblockdep_clean:
128128
libapi_clean:
129129
$(call descend,lib/api,clean)
130130

131+
libbpf_clean:
132+
$(call descend,lib/bpf,clean)
133+
134+
libsubcmd_clean:
135+
$(call descend,lib/subcmd,clean)
136+
131137
perf_clean:
132138
$(call descend,$(@:_clean=),clean)
133139

@@ -143,9 +149,12 @@ tmon_clean:
143149
freefall_clean:
144150
$(call descend,laptop/freefall,clean)
145151

152+
build_clean:
153+
$(call descend,build,clean)
154+
146155
clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean lguest_clean \
147156
perf_clean selftests_clean turbostat_clean spi_clean usb_clean virtio_clean \
148157
vm_clean net_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
149-
freefall_clean
158+
freefall_clean build_clean libbpf_clean libsubcmd_clean liblockdep_clean
150159

151160
.PHONY: FORCE

tools/build/feature/test-all.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@
125125
# include "test-get_cpuid.c"
126126
#undef main
127127

128+
#define main main_test_bpf
129+
# include "test-bpf.c"
130+
#undef main
131+
128132
int main(int argc, char *argv[])
129133
{
130134
main_test_libpython();
@@ -153,6 +157,7 @@ int main(int argc, char *argv[])
153157
main_test_pthread_attr_setaffinity_np();
154158
main_test_lzma();
155159
main_test_get_cpuid();
160+
main_test_bpf();
156161

157162
return 0;
158163
}

tools/build/feature/test-bpf.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1+
#include <asm/unistd.h>
12
#include <linux/bpf.h>
3+
#include <unistd.h>
4+
5+
#ifndef __NR_bpf
6+
# if defined(__i386__)
7+
# define __NR_bpf 357
8+
# elif defined(__x86_64__)
9+
# define __NR_bpf 321
10+
# elif defined(__aarch64__)
11+
# define __NR_bpf 280
12+
# error __NR_bpf not defined. libbpf does not support your arch.
13+
# endif
14+
#endif
215

316
int main(void)
417
{
518
union bpf_attr attr;
619

20+
/* Check fields in attr */
721
attr.prog_type = BPF_PROG_TYPE_KPROBE;
822
attr.insn_cnt = 0;
923
attr.insns = 0;
@@ -14,5 +28,9 @@ int main(void)
1428
attr.kern_version = 0;
1529

1630
attr = attr;
17-
return 0;
31+
/*
32+
* Test existence of __NR_bpf and BPF_PROG_LOAD.
33+
* This call should fail if we run the testcase.
34+
*/
35+
return syscall(__NR_bpf, BPF_PROG_LOAD, attr, sizeof(attr));
1836
}

0 commit comments

Comments
 (0)