linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/9] tools/include: Sync uapi/drm/i915_drm.h with the kernel sources
Date: Tue, 09 Apr 2024 13:14:09 +0300	[thread overview]
Message-ID: <87pluy972m.fsf@intel.com> (raw)
In-Reply-To: <ZhTwPLliHXKPAJUQ@gmail.com>

On Tue, 09 Apr 2024, Ingo Molnar <mingo@kernel.org> wrote:
> * Jani Nikula <jani.nikula@linux.intel.com> wrote:
>
>> On Mon, 08 Apr 2024, Namhyung Kim <namhyung@kernel.org> wrote:
>> > To pick up changes from:
>> >
>> >    b112364867499 ("drm/i915: Add GuC submission interface version query")
>> >    5cf0fbf763741 ("drm/i915: Add some boring kerneldoc")
>> >
>> > This should be used to beautify DRM syscall arguments and it addresses
>> > these tools/perf build warnings:
>> >
>> >   Warning: Kernel ABI header differences:
>> >     diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
>> 
>> All these years and I never realized there are header copies
>> there. But... why copies?
>
> It's better than all the alternatives we tried so far:
>
>  - Symbolic links and direct #includes: this was the original approach but 
>    was pushed back on from the kernel side, when tooling modified the 
>    headers and broke them accidentally for kernel builds.
>
>  - Duplicate self-defined ABI headers like glibc: double the maintenance 
>    burden, double the chance for mistakes, plus there's no tech-driven 
>    notification mechanism to look at new kernel side changes.
>
> What we are doing now is a third option:
>
>  - A software-enforced copy-on-write mechanism of kernel headers to 
>    tooling, driven by non-fatal warnings on the tooling side build when 
>    kernel headers get modified:
>
>     Warning: Kernel ABI header differences:
>       diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
>       diff -u tools/include/uapi/linux/fs.h include/uapi/linux/fs.h
>       diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
>       ...
>
>    The tooling policy is to always pick up the kernel side headers as-is, 
>    and integate them into the tooling build. The warnings above serve as a 
>    notification to tooling maintainers that there's changes on the kernel 
>    side.
>
> We've been using this for many years now, and it might seem hacky, but 
> works surprisingly well.
>
> Does this make sense to you?

Yes, although there are probably pieces of the puzzle I'm missing.
Thanks for the explanation! (That might work almost as-is copied to
tools/include/uapi/README. ;)

It's also kind of funny to find this kind of back alleys of the kernel
repo I've never wandered to before.

BR,
Jani.

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-04-09 10:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 18:55 [PATCHSET 0/9] Sync tools headers with the kernel source Namhyung Kim
2024-04-08 18:55 ` [PATCH 1/9] tools/include: Sync uapi/drm/i915_drm.h with the kernel sources Namhyung Kim
2024-04-09  7:26   ` Jani Nikula
2024-04-09  7:37     ` Ingo Molnar
2024-04-09 10:14       ` Jani Nikula [this message]
2024-04-09 15:58         ` Namhyung Kim
2024-04-09 17:00           ` Arnaldo Carvalho de Melo
2024-04-08 18:55 ` [PATCH 2/9] tools/include: Sync uapi/linux/fs.h " Namhyung Kim
2024-04-09 10:04   ` Jan Kara
2024-04-09 10:10     ` Christian Brauner
2024-04-08 18:55 ` [PATCH 3/9] tools/include: Sync uapi/linux/kvm.h and asm/kvm.h " Namhyung Kim
2024-04-08 18:55 ` [PATCH 4/9] tools/include: Sync uapi/sound/asound.h " Namhyung Kim
2024-04-08 18:55 ` [PATCH 5/9] tools/include: Sync x86 CPU feature headers " Namhyung Kim
2024-04-08 18:55 ` [PATCH 6/9] tools/include: Sync x86 asm/irq_vectors.h " Namhyung Kim
2024-04-08 18:55 ` [PATCH 7/9] tools/include: Sync x86 asm/msr-index.h " Namhyung Kim
2024-04-08 18:55 ` [PATCH 8/9] tools/include: Sync asm-generic/bitops/fls.h " Namhyung Kim
2024-04-08 18:55 ` [PATCH 9/9] tools/include: Sync arm64 asm/cputype.h " Namhyung Kim
2024-04-08 19:13 ` [PATCHSET 0/9] Sync tools headers with the kernel source Arnaldo Carvalho de Melo
2024-04-09  7:40   ` Ingo Molnar
2024-04-09 13:58     ` Arnaldo Carvalho de Melo
2024-04-09 15:51       ` Namhyung Kim
2024-04-09  7:15 ` Geert Uytterhoeven
2024-04-09 13:47   ` Arnaldo Carvalho de Melo
2024-04-09 15:54     ` Namhyung Kim

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=87pluy972m.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mingo@kernel.org \
    --cc=mripard@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tzimmermann@suse.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 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).