Permalink
Browse files

Add support for new kernel include structures

Newer kernel versions use the uapi include direcory for user space
APIs. The Makefile incorrectly used the old location on such kernels,
which lead to compilation errors. This changeset introduces a check
for the new perf_event.h header location before probing the old one.
  • Loading branch information...
1 parent a897226 commit 5fff1187cdb1f204aac9137379b660cd45087eab @andysan committed Mar 19, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 Makefile
View
@@ -6,7 +6,10 @@ KERNEL_SRC=/lib/modules/$(KERNEL_RELEASE)/source
# Check if perf_event there is a perf_event.h available in the source
# of the running kernel. In that case, assume that it's newer and use
# that.
-ifneq ($(wildcard $(KERNEL_SRC)/include/linux/perf_event.h),)
+ifneq ($(wildcard $(KERNEL_SRC)/include/uapi/linux/perf_event.h),)
+ PERF_EVENT_H=$(KERNEL_SRC)/include/uapi/linux/perf_event.h
+ CONFIG+=-DPERFH=\"$(PERF_EVENT_H)\"
+else ifneq ($(wildcard $(KERNEL_SRC)/include/linux/perf_event.h),)
PERF_EVENT_H=$(KERNEL_SRC)/include/linux/perf_event.h
CONFIG+=-DPERFH=\"$(PERF_EVENT_H)\"
else

0 comments on commit 5fff118

Please sign in to comment.