Skip to contentSkip to conversation

perf arm: Fix include path

PATCH Superseded Ian Rogers 2 participants 2 messages May 8, 2023 – May 9, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf arm: Fix include path

Change "../cs-etm.h" to just "cs-etm.h" as ../cs-etm.h doesn't exist.

---
 tools/perf/arch/arm/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/arch/arm/util/pmu.c +1 -1
index 860a8b42b4b5..46154c226fbb 100644
@@ -12,7 +12,7 @@
 #include "arm-spe.h"
 #include "hisi-ptt.h"
 #include "../../../util/pmu.h"
-#include "../cs-etm.h"
+#include "cs-etm.h"
 
 struct perf_event_attr
 *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused)
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
Reviewed-by on v1 1/1
#1 lore raw

Hi Ian,

Quoted 12 lines · Ian Rogers

Change "../cs-etm.h" to just "cs-etm.h" as ../cs-etm.h doesn't exist.

---
 tools/perf/arch/arm/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/arch/arm/util/pmu.c +0 -0
index 860a8b42b4b5..46154c226fbb 100644

tools/perf/arch/arm/util/pmu.c line 15

Quoted 4 lines
tools/perf/arch/arm/util/pmu.c +0 -1
@@ -12,7 +12,7 @@
 #include "arm-spe.h"
 #include "hisi-ptt.h"
 #include "../../../util/pmu.h"
-#include "../cs-etm.h"

This code is a bit tricky. Here it deliberately uses "../cs-etm.h" to avoid including the header file in the same folder, alternatively, the compiler option "-I/home/leoy/Work/linux/tools/perf/util/include" will lead the C file to include "tools/perf/util/include/../cs-etm.h".

tools/perf/arch/arm/util/pmu.c line 15

Quoted 1 line
tools/perf/arch/arm/util/pmu.c +1 -0
+#include "cs-etm.h"

So with this change, perf will fail to build actually :)

We need to change to:

  #include "../../../util/cs-etm.h"

With above change:

Thanks for code improvement!

Quoted 5 lines
tools/perf/arch/arm/util/pmu.c +0 -0
 struct perf_event_attr
 *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused)
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog