Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 747a9b0a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
  ...
parents 32250e4a c3660884
Loading
Loading
Loading
Loading
+27 −18
Original line number Original line Diff line number Diff line
@@ -12,20 +12,20 @@ help:
	@echo '  cgroup                 - cgroup tools'
	@echo '  cgroup                 - cgroup tools'
	@echo '  cpupower               - a tool for all things x86 CPU power'
	@echo '  cpupower               - a tool for all things x86 CPU power'
	@echo '  firewire               - the userspace part of nosy, an IEEE-1394 traffic sniffer'
	@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 '  hv                     - tools used when in Hyper-V clients'
	@echo '  iio                    - IIO tools'
	@echo '  iio                    - IIO tools'
	@echo '  lguest                 - a minimal 32-bit x86 hypervisor'
	@echo '  lguest                 - a minimal 32-bit x86 hypervisor'
	@echo '  net                    - misc networking tools'
	@echo '  perf                   - Linux performance measurement and analysis tool'
	@echo '  perf                   - Linux performance measurement and analysis tool'
	@echo '  selftests              - various kernel selftests'
	@echo '  selftests              - various kernel selftests'
	@echo '  spi                    - spi tools'
	@echo '  spi                    - spi tools'
	@echo '  tmon                   - thermal monitoring and tuning tool'
	@echo '  turbostat              - Intel CPU idle stats and freq reporting tool'
	@echo '  turbostat              - Intel CPU idle stats and freq reporting tool'
	@echo '  usb                    - USB testing tools'
	@echo '  usb                    - USB testing tools'
	@echo '  virtio                 - vhost test module'
	@echo '  virtio                 - vhost test module'
	@echo '  net        - misc networking tools'
	@echo '  vm                     - misc vm tools'
	@echo '  vm                     - misc vm tools'
	@echo '  x86_energy_perf_policy - Intel energy policy tool'
	@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 ''
	@echo 'You can do:'
	@echo 'You can do:'
	@echo ' $$ make -C tools/ <tool>_install'
	@echo ' $$ make -C tools/ <tool>_install'
@@ -128,6 +128,12 @@ liblockdep_clean:
libapi_clean:
libapi_clean:
	$(call descend,lib/api,clean)
	$(call descend,lib/api,clean)


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

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

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


@@ -143,9 +149,12 @@ tmon_clean:
freefall_clean:
freefall_clean:
	$(call descend,laptop/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 \
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 \
		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 \
		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
.PHONY: FORCE
+5 −0
Original line number Original line Diff line number Diff line
@@ -125,6 +125,10 @@
# include "test-get_cpuid.c"
# include "test-get_cpuid.c"
#undef main
#undef main


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

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


	return 0;
	return 0;
}
}
+19 −1
Original line number Original line Diff line number Diff line
#include <asm/unistd.h>
#include <linux/bpf.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)
int main(void)
{
{
	union bpf_attr attr;
	union bpf_attr attr;


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


	attr = attr;
	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));
}
}
+747 −6

File changed.

Preview size limit exceeded, changes collapsed.

+9 −9
Original line number Original line Diff line number Diff line
@@ -6,6 +6,12 @@ BPF_EXTRAVERSION = 1


MAKEFLAGS += --no-print-directory
MAKEFLAGS += --no-print-directory


ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree))
endif


# Makefiles suck: This macro sets a default value of $(2) for the
# Makefiles suck: This macro sets a default value of $(2) for the
# variable named by $(1), unless the variable has been set by
# variable named by $(1), unless the variable has been set by
@@ -31,7 +37,8 @@ INSTALL = install
DESTDIR ?=
DESTDIR ?=
DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'
DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'


LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
include $(srctree)/tools/scripts/Makefile.arch

ifeq ($(LP64), 1)
ifeq ($(LP64), 1)
  libdir_relative = lib64
  libdir_relative = lib64
else
else
@@ -57,13 +64,6 @@ ifndef VERBOSE
  VERBOSE = 0
  VERBOSE = 0
endif
endif


ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree))
endif

FEATURE_USER = .libbpf
FEATURE_USER = .libbpf
FEATURE_TESTS = libelf libelf-getphdrnum libelf-mmap bpf
FEATURE_TESTS = libelf libelf-getphdrnum libelf-mmap bpf
FEATURE_DISPLAY = libelf bpf
FEATURE_DISPLAY = libelf bpf
@@ -192,7 +192,7 @@ config-clean:
	$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
	$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null


clean:
clean:
	$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d \
	$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd \
		$(RM) LIBBPF-CFLAGS
		$(RM) LIBBPF-CFLAGS
	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf


Loading