Skip to content

Commit

Permalink
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…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
  ...
  • Loading branch information
torvalds committed Jan 14, 2016
2 parents 32250e4 + c366088 commit 747a9b0
Show file tree
Hide file tree
Showing 28 changed files with 918 additions and 66 deletions.
45 changes: 27 additions & 18 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ include scripts/Makefile.include
help:
@echo 'Possible targets:'
@echo ''
@echo ' acpi - ACPI tools'
@echo ' cgroup - cgroup tools'
@echo ' cpupower - a tool for all things x86 CPU power'
@echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
@echo ' hv - tools used when in Hyper-V clients'
@echo ' iio - IIO tools'
@echo ' lguest - a minimal 32-bit x86 hypervisor'
@echo ' perf - Linux performance measurement and analysis tool'
@echo ' selftests - various kernel selftests'
@echo ' spi - spi tools'
@echo ' turbostat - Intel CPU idle stats and freq reporting tool'
@echo ' usb - USB testing tools'
@echo ' virtio - vhost test module'
@echo ' net - misc networking tools'
@echo ' vm - misc vm tools'
@echo ' acpi - ACPI tools'
@echo ' cgroup - cgroup tools'
@echo ' cpupower - a tool for all things x86 CPU power'
@echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
@echo ' freefall - laptop accelerometer program for disk protection'
@echo ' hv - tools used when in Hyper-V clients'
@echo ' iio - IIO tools'
@echo ' lguest - a minimal 32-bit x86 hypervisor'
@echo ' net - misc networking tools'
@echo ' perf - Linux performance measurement and analysis tool'
@echo ' selftests - various kernel selftests'
@echo ' spi - spi tools'
@echo ' tmon - thermal monitoring and tuning tool'
@echo ' turbostat - Intel CPU idle stats and freq reporting tool'
@echo ' usb - USB testing tools'
@echo ' virtio - vhost test module'
@echo ' vm - misc vm tools'
@echo ' x86_energy_perf_policy - Intel energy policy tool'
@echo ' tmon - thermal monitoring and tuning tool'
@echo ' freefall - laptop accelerometer program for disk protection'
@echo ''
@echo 'You can do:'
@echo ' $$ make -C tools/ <tool>_install'
Expand Down Expand Up @@ -128,6 +128,12 @@ liblockdep_clean:
libapi_clean:
$(call descend,lib/api,clean)

libbpf_clean:
$(call descend,lib/bpf,clean)

libsubcmd_clean:
$(call descend,lib/subcmd,clean)

perf_clean:
$(call descend,$(@:_clean=),clean)

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

build_clean:
$(call descend,build,clean)

clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean lguest_clean \
perf_clean selftests_clean turbostat_clean spi_clean usb_clean virtio_clean \
vm_clean net_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
freefall_clean
freefall_clean build_clean libbpf_clean libsubcmd_clean liblockdep_clean

.PHONY: FORCE
5 changes: 5 additions & 0 deletions tools/build/feature/test-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@
# include "test-get_cpuid.c"
#undef main

#define main main_test_bpf
# include "test-bpf.c"
#undef main

int main(int argc, char *argv[])
{
main_test_libpython();
Expand Down Expand Up @@ -153,6 +157,7 @@ int main(int argc, char *argv[])
main_test_pthread_attr_setaffinity_np();
main_test_lzma();
main_test_get_cpuid();
main_test_bpf();

return 0;
}
20 changes: 19 additions & 1 deletion tools/build/feature/test-bpf.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
#include <asm/unistd.h>
#include <linux/bpf.h>
#include <unistd.h>

#ifndef __NR_bpf
# if defined(__i386__)
# define __NR_bpf 357
# elif defined(__x86_64__)
# define __NR_bpf 321
# elif defined(__aarch64__)
# define __NR_bpf 280
# error __NR_bpf not defined. libbpf does not support your arch.
# endif
#endif

int main(void)
{
union bpf_attr attr;

/* Check fields in attr */
attr.prog_type = BPF_PROG_TYPE_KPROBE;
attr.insn_cnt = 0;
attr.insns = 0;
Expand All @@ -14,5 +28,9 @@ int main(void)
attr.kern_version = 0;

attr = attr;
return 0;
/*
* Test existence of __NR_bpf and BPF_PROG_LOAD.
* This call should fail if we run the testcase.
*/
return syscall(__NR_bpf, BPF_PROG_LOAD, attr, sizeof(attr));
}
Loading

0 comments on commit 747a9b0

Please sign in to comment.