Skip to contentSkip to conversation

perf evsel: Fix a build failure on cross compilation

PATCH In review Namhyung Kim 2 participants 2 messages Jun 21, 2012 – Jun 29, 2012 perf events

lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

PATCH 1/1 perf evsel: Fix a build failure on cross compilation

From: Namhyung Kim <[email protected]>

The commit c410431cefefd ("perf tools: Reconstruct event with modifiers from perf_event_attr") added the line, but it's broken since it needs to go up 3 directories to get to the kernel root directory, not 2.

However host gcc contains /usr/local/include in its search path, so that it can find the perf_event.h in /usr/include. This why we didn't notice the problem yet. But when I tried to cross compile it appears like:

CC util/evsel.o
util/evsel.c:18:44: error: ../../include/linux/perf_event.h: No such file or directory
make: *** [util/evsel.o] Error 1

Looking at the source, it isn't needed at all as evsel.h already included the perf_event.h. So simply remove it would solve the problem.

---
 tools/perf/util/evsel.c |    1 -
 1 file changed, 1 deletion(-)
tools/perf/util/evsel.c +0 -1
index 876f639d69ed..3d1f6968f175 100644
@@ -15,7 +15,6 @@
 #include "cpumap.h"
 #include "thread_map.h"
 #include "target.h"
-#include "../../include/linux/perf_event.h"
 
 #define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))
 #define GROUP_FD(group_fd, cpu) (*(int *)xyarray__entry(group_fd, cpu, 0))
Signature · 1 line
1.7.10.2
#1 lore raw
Commit-ID:  35a468732289372aab506d7cf73f98f0379888ae
Gitweb:     http://git.kernel.org/tip/35a468732289372aab506d7cf73f98f0379888ae
Author:     Namhyung Kim <[email protected]>
AuthorDate: Thu, 21 Jun 2012 17:52:52 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 25 Jun 2012 14:55:24 -0300

perf evsel: Fix a build failure on cross compilation

The commit c410431cefefd ("perf tools: Reconstruct event with modifiers from perf_event_attr") added the line, but it's broken since it needs to go up 3 directories to get to the kernel root directory, not 2.

However host gcc contains /usr/local/include in its search path, so that it can find the perf_event.h in /usr/include. This why we didn't notice the problem yet. But when I tried to cross compile it appears like:

CC util/evsel.o
util/evsel.c:18:44: error: ../../include/linux/perf_event.h: No such file or directory
make: *** [util/evsel.o] Error 1

Looking at the source, it isn't needed at all as evsel.h already included the perf_event.h. So simply remove it would solve the problem.

---
 tools/perf/util/evsel.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
tools/perf/util/evsel.c +0 -1
index 876f639..3d1f696 100644
@@ -15,7 +15,6 @@
 #include "cpumap.h"
 #include "thread_map.h"
 #include "target.h"
-#include "../../include/linux/perf_event.h"
 
 #define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))
 #define GROUP_FD(group_fd, cpu) (*(int *)xyarray__entry(group_fd, cpu, 0))