tools: Add copy of perf_event.h to tools/include/linux/

We shouldn't use headers from the kernel sources directly, instead we
should use the system's headers or in cases where that isn't possible,
like with perf_event.h, where the introduction of kernel features such
as perf_event_attr.{write_backwards,sample_max_stack} and
PERF_EVENT_IOC_PAUSE_OUTPUT take some time to become available in
/usr/include/linux/perf_event.h we need a copy.

Do it and check for source code drift, emitting a warning when changes
are detected.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-v6aks5un3s5pehory6f42nrl@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent e083a21f
This diff is collapsed.
...@@ -54,6 +54,7 @@ tools/include/linux/hash.h ...@@ -54,6 +54,7 @@ tools/include/linux/hash.h
tools/include/linux/kernel.h tools/include/linux/kernel.h
tools/include/linux/list.h tools/include/linux/list.h
tools/include/linux/log2.h tools/include/linux/log2.h
tools/include/uapi/linux/perf_event.h
tools/include/linux/poison.h tools/include/linux/poison.h
tools/include/linux/rbtree.h tools/include/linux/rbtree.h
tools/include/linux/rbtree_augmented.h tools/include/linux/rbtree_augmented.h
...@@ -66,7 +67,6 @@ include/asm-generic/bitops/const_hweight.h ...@@ -66,7 +67,6 @@ include/asm-generic/bitops/const_hweight.h
include/asm-generic/bitops/fls64.h include/asm-generic/bitops/fls64.h
include/asm-generic/bitops/__fls.h include/asm-generic/bitops/__fls.h
include/asm-generic/bitops/fls.h include/asm-generic/bitops/fls.h
include/linux/perf_event.h
include/linux/list.h include/linux/list.h
include/linux/hash.h include/linux/hash.h
include/linux/stringify.h include/linux/stringify.h
...@@ -79,7 +79,6 @@ arch/*/lib/memset*.S ...@@ -79,7 +79,6 @@ arch/*/lib/memset*.S
arch/*/include/asm/*features.h arch/*/include/asm/*features.h
include/linux/poison.h include/linux/poison.h
include/linux/hw_breakpoint.h include/linux/hw_breakpoint.h
include/uapi/linux/perf_event.h
include/uapi/linux/bpf.h include/uapi/linux/bpf.h
include/uapi/linux/bpf_common.h include/uapi/linux/bpf_common.h
include/uapi/linux/const.h include/uapi/linux/const.h
......
...@@ -345,6 +345,9 @@ export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX AWK ...@@ -345,6 +345,9 @@ export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX AWK
include $(srctree)/tools/build/Makefile.include include $(srctree)/tools/build/Makefile.include
$(PERF_IN): prepare FORCE $(PERF_IN): prepare FORCE
@(test -f ../../include/uapi/linux/perf_event.h && ( \
(diff -B ../include/uapi/linux/perf_event.h ../../include/uapi/linux/perf_event.h >/dev/null) \
|| echo "Warning: tools/include/uapi/linux/perf_event.h differs from kernel" >&2 )) || true
$(Q)$(MAKE) $(build)=perf $(Q)$(MAKE) $(build)=perf
$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST) $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
......
...@@ -206,6 +206,7 @@ endif ...@@ -206,6 +206,7 @@ endif
CFLAGS += -I$(src-perf)/util/include CFLAGS += -I$(src-perf)/util/include
CFLAGS += -I$(src-perf)/arch/$(ARCH)/include CFLAGS += -I$(src-perf)/arch/$(ARCH)/include
CFLAGS += -I$(srctree)/tools/include/uapi
CFLAGS += -I$(srctree)/tools/include/ CFLAGS += -I$(srctree)/tools/include/
CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi
CFLAGS += -I$(srctree)/arch/$(ARCH)/include CFLAGS += -I$(srctree)/arch/$(ARCH)/include
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment