public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Ian Rogers <irogers@google.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/2] Revert "perf tools: Fix arm64 build by generating unistd_64.h"
Date: Fri, 5 Dec 2025 16:21:47 +0000	[thread overview]
Message-ID: <20251205162147.GR724103@e132581.arm.com> (raw)
In-Reply-To: <CAP-5=fV-d_X1uFYACEOJOxOY43+fj9aEm0_bp7NGSo9kZVMJ4Q@mail.gmail.com>

On Thu, Dec 04, 2025 at 10:19:59AM -0800, Ian Rogers wrote:
> On Thu, Dec 4, 2025 at 8:53 AM Leo Yan <leo.yan@arm.com> wrote:
> >
> > This reverts:
> >
> > commit 8988c4b91945 ("perf tools: Fix in-source libperf build")
> > commit bfb713ea53c7 ("perf tools: Fix arm64 build by generating unistd_64.h")
> >
> > Since we now have a static unistd_64.h for the arm64 build, there is no
> > need to generate unistd_64.h in libperf.  Revert all patches related to
> > generating unistd_64.h.
> 
> Could we generate the file and then compare the two? We do something
> like this for empty-pmu-events.c here:
> https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/pmu-events/Build?h=perf-tools-next#n49
> 
> Similarly, could we get rid of the unistd_64.h generation and just add
> a build time validation test? Generating the file is painful in many
> ways, as this series testifies.

Thanks for suggestions!

I had a question: why we need to maintain unistd.h particually in
./tools folder?  This header is a standard C header and should be
provided by toolchain instead.  Due to multiple copies, it is a bit mess
the programs might include unpurposed one.

I went through the history and found:

  commit 34b009cfde2b ("tools include: Grab copies of arm64 dependent unistd.h files")

It introduces the header unistd.h for generating system call table.

Afterwards,

  commit cb8197db8c09 ("perf tools arm64: Use syscall table")

unistd.h headers are not used to generate syscall table anymore.  Since
then, syscall tables are maintained in
tools/perf/arch/*/entry/syscalls/syscall*.tbl for each arch.

To verify this, I did a quick try with removing x86 and arm64 headers:

  tools/arch/arm64/include/uapi/asm/unistd.h
  tools/arch/x86/include/uapi/asm/unistd.h
  tools/arch/x86/include/uapi/asm/unistd_32.h
  tools/arch/x86/include/uapi/asm/unistd_64.h

I run the linux-tools-container-builds and confirmed all x86 and arm64
building tests pass and did not see any failure.

For a neat fix, I think we can remove all unistd.h headers:

  $ ls tools/arch/*/include/uapi/asm/unistd*
  tools/arch/arc/include/uapi/asm/unistd.h
  tools/arch/hexagon/include/uapi/asm/unistd.h
  tools/arch/riscv/include/uapi/asm/unistd.h
  tools/arch/x86/include/uapi/asm/unistd_64.h
  tools/arch/arm64/include/uapi/asm/unistd.h
  tools/arch/loongarch/include/uapi/asm/unistd.h
  tools/arch/x86/include/uapi/asm/unistd_32.h
  tools/arch/x86/include/uapi/asm/unistd.h

Any concern?  I would get maintainers's confirmation before proceeding.

Thanks,
Leo

  reply	other threads:[~2025-12-05 16:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 16:53 [PATCH 0/2] tools build: Fix arm64's unistd_64.h dependency Leo Yan
2025-12-04 16:53 ` [PATCH 1/2] tools headers: Add arm64's unistd_64.h Leo Yan
2025-12-04 16:53 ` [PATCH 2/2] Revert "perf tools: Fix arm64 build by generating unistd_64.h" Leo Yan
2025-12-04 18:19   ` Ian Rogers
2025-12-05 16:21     ` Leo Yan [this message]
2025-12-05 17:16       ` Ian Rogers
2025-12-09 10:49         ` Leo Yan
2025-12-09 16:37           ` Ian Rogers

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=20251205162147.GR724103@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@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