Re: [PATCH v1] perf arm: Fix include path

From: Leo Yan
Date: Mon May 08 2023 - 22:59:07 EST


Hi Ian,

On Mon, May 08, 2023 at 02:31:28PM -0700, Ian Rogers wrote:
> Change "../cs-etm.h" to just "cs-etm.h" as ../cs-etm.h doesn't exist.
>
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> ---
> tools/perf/arch/arm/util/pmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/arch/arm/util/pmu.c b/tools/perf/arch/arm/util/pmu.c
> index 860a8b42b4b5..46154c226fbb 100644
> --- a/tools/perf/arch/arm/util/pmu.c
> +++ b/tools/perf/arch/arm/util/pmu.c
> @@ -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".

> +#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:

Reviewed-by: Leo Yan <leo.yan@xxxxxxxxxx>

Thanks for code improvement!

> struct perf_event_attr
> *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused)
> --
> 2.40.1.521.gf1e218fcd8-goog
>