Re: [PATCH] perf: fix perf_event.h header usage

Previous thread: [RFC][PATCH 00/18] sched: Reduce runqueue lock contention -v4 by Peter Zijlstra on Tuesday, January 4, 2011 - 7:59 am. (16 messages)

Next thread: [PATCH] fix miscompiling with GCC 4.5 -finline-functions by Dzianis Kahanovich on Tuesday, January 4, 2011 - 8:17 am. (1 message)
From: Stephane Eranian
Date: Tuesday, January 4, 2011 - 7:30 am

This patch fixes the usage of the perf_event.h header file
between command modules and the supporting code in util.

It is necessary to ensure that ALL files use the SAME
perf_event.h header from the kernel source tree.

There were a couple of #include <linux/perf_event.h> mixed
with #include "../../perf_event.h".

This caused issues on some distros because of mismatch
in the layout of struct perf_event_attr. That eventually
led perf stat to segfault.

Signed-off-by: Stephane Eranian <eranian@google.com>
---

diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 863d78d..a0ccd69 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -3,7 +3,7 @@
 
 #include <linux/list.h>
 #include <stdbool.h>
-#include <linux/perf_event.h>
+#include "../../../include/linux/perf_event.h"
 #include "types.h"
 #include "xyarray.h"
  
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index 1c9043c..b82cafb 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -4,7 +4,7 @@
  * Parse symbolic events/counts passed in as options:
  */
 
-#include <linux/perf_event.h>
+#include "../../../include/linux/perf_event.h"
 
 struct list_head;
 struct perf_evsel;
--

From: Arnaldo Carvalho de Melo
Date: Tuesday, January 4, 2011 - 8:44 am

Thanks, applying.

- Arnaldo
--

From: Robert Richter
Date: Tuesday, January 4, 2011 - 9:47 am

Isn't this valid for all <linux/*.h> header files?

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center

--

Previous thread: [RFC][PATCH 00/18] sched: Reduce runqueue lock contention -v4 by Peter Zijlstra on Tuesday, January 4, 2011 - 7:59 am. (16 messages)

Next thread: [PATCH] fix miscompiling with GCC 4.5 -finline-functions by Dzianis Kahanovich on Tuesday, January 4, 2011 - 8:17 am. (1 message)