From: Ian Rogers <irogers@google.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Leo Yan <leo.yan@linaro.org>,
John Garry <john.garry@huawei.com>, Will Deacon <will@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH] perf arm: Fix off-by-one directory paths.
Date: Tue, 4 May 2021 13:52:00 -0700 [thread overview]
Message-ID: <CAP-5=fU4q8hYn+h4JAAEtK6e6N3=tFC6hq9Ja-YjZR2_o6omiA@mail.gmail.com> (raw)
In-Reply-To: <CAM9d7chEbYU6mnCsAo7+rGH7PCtJy8NT7BedLBT8Lda8fbjy5A@mail.gmail.com>
On Tue, May 4, 2021 at 12:43 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> Hi Ian,
>
> On Tue, May 4, 2021 at 12:12 PM Ian Rogers <irogers@google.com> wrote:
> >
> > Relative path include works in the regular build due to -I paths but may
> > fail in other situations.
>
> Right, can we simply change them all to have a relative path from the
> $(srctree)/tools/perf ? I think it'd be cleaner and easier to maintain.
It'd be a larger change but I agree it would be cleaner. I had a
related problem here:
https://lore.kernel.org/lkml/20210307223024.4081067-1-irogers@google.com/
Relying less on include path order, especially confusing in the ARM vs
ARM64 case where both arch directories are necessary, and on linker
tricks like weak I think would make the build cleaner and easier to
understand. Not calling C and header files the same name would also I
think reduce confusion. The cost would likely be more #ifs.
Given that is a larger refactor I think we can merge this while
working out a better plan.
Thanks,
Ian
> Thanks,
> Namhyung
>
> >
> > Signed-off-by: Ian Rogers <irogers@google.com>
> > ---
> > tools/perf/arch/arm/util/auxtrace.c | 8 +++----
> > tools/perf/arch/arm/util/cs-etm.c | 24 ++++++++++-----------
> > tools/perf/arch/arm/util/perf_regs.c | 2 +-
> > tools/perf/arch/arm/util/pmu.c | 2 +-
> > tools/perf/arch/arm/util/unwind-libdw.c | 6 +++---
> > tools/perf/arch/arm/util/unwind-libunwind.c | 4 ++--
> > 6 files changed, 23 insertions(+), 23 deletions(-)
> >
> > diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c
> > index b187bddbd01a..7ed57222465e 100644
> > --- a/tools/perf/arch/arm/util/auxtrace.c
> > +++ b/tools/perf/arch/arm/util/auxtrace.c
> > @@ -8,10 +8,10 @@
> > #include <linux/coresight-pmu.h>
> > #include <linux/zalloc.h>
> >
> > -#include "../../util/auxtrace.h"
> > -#include "../../util/debug.h"
> > -#include "../../util/evlist.h"
> > -#include "../../util/pmu.h"
> > +#include "../../../util/auxtrace.h"
> > +#include "../../../util/debug.h"
> > +#include "../../../util/evlist.h"
> > +#include "../../../util/pmu.h"
> > #include "cs-etm.h"
> > #include "arm-spe.h"
> >
> > diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
> > index d942f118d32c..67c7fb8d7eb0 100644
> > --- a/tools/perf/arch/arm/util/cs-etm.c
> > +++ b/tools/perf/arch/arm/util/cs-etm.c
> > @@ -16,19 +16,19 @@
> > #include <linux/zalloc.h>
> >
> > #include "cs-etm.h"
> > -#include "../../util/debug.h"
> > -#include "../../util/record.h"
> > -#include "../../util/auxtrace.h"
> > -#include "../../util/cpumap.h"
> > -#include "../../util/event.h"
> > -#include "../../util/evlist.h"
> > -#include "../../util/evsel.h"
> > -#include "../../util/perf_api_probe.h"
> > -#include "../../util/evsel_config.h"
> > -#include "../../util/pmu.h"
> > -#include "../../util/cs-etm.h"
> > +#include "../../../util/debug.h"
> > +#include "../../../util/record.h"
> > +#include "../../../util/auxtrace.h"
> > +#include "../../../util/cpumap.h"
> > +#include "../../../util/event.h"
> > +#include "../../../util/evlist.h"
> > +#include "../../../util/evsel.h"
> > +#include "../../../util/perf_api_probe.h"
> > +#include "../../../util/evsel_config.h"
> > +#include "../../../util/pmu.h"
> > +#include "../../../util/cs-etm.h"
> > #include <internal/lib.h> // page_size
> > -#include "../../util/session.h"
> > +#include "../../../util/session.h"
> >
> > #include <errno.h>
> > #include <stdlib.h>
> > diff --git a/tools/perf/arch/arm/util/perf_regs.c b/tools/perf/arch/arm/util/perf_regs.c
> > index 2864e2e3776d..2833e101a7c6 100644
> > --- a/tools/perf/arch/arm/util/perf_regs.c
> > +++ b/tools/perf/arch/arm/util/perf_regs.c
> > @@ -1,5 +1,5 @@
> > // SPDX-License-Identifier: GPL-2.0
> > -#include "../../util/perf_regs.h"
> > +#include "../../../util/perf_regs.h"
> >
> > const struct sample_reg sample_reg_masks[] = {
> > SMPL_REG_END
> > diff --git a/tools/perf/arch/arm/util/pmu.c b/tools/perf/arch/arm/util/pmu.c
> > index bbc297a7e2e3..b8b23b9dc598 100644
> > --- a/tools/perf/arch/arm/util/pmu.c
> > +++ b/tools/perf/arch/arm/util/pmu.c
> > @@ -10,7 +10,7 @@
> > #include <linux/string.h>
> >
> > #include "arm-spe.h"
> > -#include "../../util/pmu.h"
> > +#include "../../../util/pmu.h"
> >
> > struct perf_event_attr
> > *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused)
> > diff --git a/tools/perf/arch/arm/util/unwind-libdw.c b/tools/perf/arch/arm/util/unwind-libdw.c
> > index 36ba4c69c3c5..b7692cb0c733 100644
> > --- a/tools/perf/arch/arm/util/unwind-libdw.c
> > +++ b/tools/perf/arch/arm/util/unwind-libdw.c
> > @@ -1,8 +1,8 @@
> > // SPDX-License-Identifier: GPL-2.0
> > #include <elfutils/libdwfl.h>
> > -#include "../../util/unwind-libdw.h"
> > -#include "../../util/perf_regs.h"
> > -#include "../../util/event.h"
> > +#include "../../../util/unwind-libdw.h"
> > +#include "../../../util/perf_regs.h"
> > +#include "../../../util/event.h"
> >
> > bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg)
> > {
> > diff --git a/tools/perf/arch/arm/util/unwind-libunwind.c b/tools/perf/arch/arm/util/unwind-libunwind.c
> > index 3a550225dfaf..438906bf0014 100644
> > --- a/tools/perf/arch/arm/util/unwind-libunwind.c
> > +++ b/tools/perf/arch/arm/util/unwind-libunwind.c
> > @@ -3,8 +3,8 @@
> > #include <errno.h>
> > #include <libunwind.h>
> > #include "perf_regs.h"
> > -#include "../../util/unwind.h"
> > -#include "../../util/debug.h"
> > +#include "../../../util/unwind.h"
> > +#include "../../../util/debug.h"
> >
> > int libunwind__arch_reg_id(int regnum)
> > {
> > --
> > 2.31.1.607.g51e8a6a459-goog
> >
prev parent reply other threads:[~2021-05-04 20:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-04 19:12 [PATCH] perf arm: Fix off-by-one directory paths Ian Rogers
2021-05-04 19:43 ` Namhyung Kim
2021-05-04 20:52 ` Ian Rogers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAP-5=fU4q8hYn+h4JAAEtK6e6N3=tFC6hq9Ja-YjZR2_o6omiA@mail.gmail.com' \
--to=irogers@google.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=john.garry@huawei.com \
--cc=jolsa@redhat.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).