From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Namhyung Kim <namhyung@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Igor Lubashev <ilubashe@akamai.com>,
Nick Desaulniers <ndesaulniers@google.com>,
Alexios Zavras <alexios.zavras@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Wei Li <liwei391@huawei.com>,
Kan Liang <kan.liang@linux.intel.com>,
Andi Kleen <ak@linux.intel.com>,
LKML <linux-kernel@vger.kernel.org>,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 1/3] tools: fix off-by 1 relative directory includes
Date: Fri, 6 Mar 2020 17:13:31 -0300 [thread overview]
Message-ID: <20200306201331.GC13774@kernel.org> (raw)
In-Reply-To: <CAP-5=fUAjMxGDWfev_q6vKhe1M5D1UdXhPK6x5Y9bxUbrJ-tNw@mail.gmail.com>
Em Fri, Mar 06, 2020 at 08:47:51AM -0800, Ian Rogers escreveu:
> On Fri, Mar 6, 2020 at 1:34 AM Jiri Olsa <jolsa@redhat.com> wrote:
> >
> > On Thu, Mar 05, 2020 at 11:11:08PM -0800, Ian Rogers wrote:
> > > This is currently working due to extra include paths in the build.
> >
> > if you're fixing this, why not remove that extra include path then?
>
> TL;DR it is complicated, but the include paths are all currently
> necessary I believe and doing this way is necessary due to how header
> files may be copied out of the kernel.
TL;DR response: yeah, lets make incremental fixes to this, like applying
this patch :)
- Arnaldo
> The current build uses multiple -Is to ensure the correct version of a
> file is included, for example there are 27 files called bitops.h and
> 29 called bitsperlong.h. In
> Google we're using libraries and bazel build files:
> https://docs.bazel.build/versions/master/be/c-cpp.html#cc_library
> and there's no way to say if you depend on this library then you need
> this include path. We've tried to make perf this way but having tied
> ourselves in knots we decided instead to emulate the include path
> behaviour by rewriting includes when we import code using copybara:
> https://github.com/google/copybara
> We are able when doing this to prioritize the include paths we rewrite
> so that a local directory version of a header is preferred over say
> one in tools/lib/perf and perhaps tools/perf. Having full include
> paths isn't really an option upstream as the same header file may be
> copied into a libc project that has a different directory layout.
> As we have absolute include paths at the time of building we need
> relative include paths to be correct. Upstream -Is allow the build to
> find the file but it is a bit of a quirk of the C preprocessor, so
> fixing these off-by 1s feels like value add both for us and upstream.
> For upstream to do anything different I think is going to be a
> significant rewrite of how the Makefile build works and I'm not sure
> what the result would look like.
>
> Thanks!
> Ian
>
> > jirka
> >
--
- Arnaldo
next prev parent reply other threads:[~2020-03-06 20:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 7:11 [PATCH 0/3] perf tool: build related fixes Ian Rogers
2020-03-06 7:11 ` [PATCH 1/3] tools: fix off-by 1 relative directory includes Ian Rogers
2020-03-06 9:33 ` Jiri Olsa
2020-03-06 16:47 ` Ian Rogers
2020-03-06 20:13 ` Arnaldo Carvalho de Melo [this message]
2020-03-06 11:41 ` Arnaldo Carvalho de Melo
2020-03-07 7:36 ` [tip: perf/urgent] tools: Fix " tip-bot2 for Ian Rogers
2020-03-06 7:11 ` [PATCH 2/3] libperf: avoid redefining _GNU_SOURCE in test Ian Rogers
2020-03-06 11:38 ` Arnaldo Carvalho de Melo
2020-03-06 17:54 ` Ian Rogers
2020-03-06 7:11 ` [PATCH 3/3] tools/perf: build fixes for arch_errno_names.sh Ian Rogers
2020-03-06 11:40 ` Arnaldo Carvalho de Melo
2020-04-29 19:16 ` Ian Rogers
2020-05-14 15:04 ` Arnaldo Carvalho de Melo
2020-05-14 17:54 ` Ian Rogers
2020-05-15 13:50 ` Arnaldo Carvalho de Melo
2020-03-06 9:35 ` [PATCH 0/3] perf tool: build related fixes Jiri Olsa
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=20200306201331.GC13774@kernel.org \
--to=arnaldo.melo@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexios.zavras@intel.com \
--cc=eranian@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilubashe@akamai.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liwei391@huawei.com \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.