From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
To: James Clark <james.clark@linaro.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
arnd@linaro.org
Cc: Ingo Molnar <mingo@kernel.org>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf tools: Fix arm64 build by generating unistd_64.h
Date: Wed, 23 Apr 2025 16:46:40 +0530 [thread overview]
Message-ID: <9eefa69e-72a1-4cfb-9f7e-349532f9fb7c@oracle.com> (raw)
In-Reply-To: <20250417-james-perf-fix-gen-syscall-v1-1-1d268c923901@linaro.org>
Hi James,
On 17/04/25 19:25, James Clark wrote:
> Since pulling in the kernel changes in commit 22f72088ffe6 ("tools
> headers: Update the syscall table with the kernel sources"), arm64 is
> no longer using a generic syscall header and generates one from the
> syscall table. Therefore we must also generate the syscall header for
> arm64 before building Perf.
>
> Add it as a dependency to libperf which uses one syscall number. Perf
> uses more, but as libperf is a dependency of Perf it will be generated
> for both.
>
> Future platforms that need this will have to add their own syscall-y
> targets in libperf manually. Unfortunately the arch specific files that
> do this (e.g. arch/arm64/include/asm/Kbuild) can't easily be imported
> into the Perf build. But Perf only needs a subset of the generated files
> anyway, so redefining them is probably the correct thing to do.
>
> Fixes: 22f72088ffe6 ("tools headers: Update the syscall table with the kernel sources")
> Signed-off-by: James Clark <james.clark@linaro.org>
> ---
> tools/lib/perf/Makefile | 12 +++++++++++-
> tools/perf/Makefile.config | 1 +
> 2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile
> index ffcfd777c451..1a19b5013f45 100644
> --- a/tools/lib/perf/Makefile
> +++ b/tools/lib/perf/Makefile
> @@ -42,6 +42,7 @@ libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
> TEST_ARGS := $(if $(V),-v)
>
> INCLUDES = \
> +-I$(OUTPUT)/../arch/$(SRCARCH)/include/generated/uapi \
> -I$(srctree)/tools/lib/perf/include \
> -I$(srctree)/tools/lib/ \
> -I$(srctree)/tools/include \
> @@ -99,7 +100,16 @@ $(LIBAPI)-clean:
> $(call QUIET_CLEAN, libapi)
> $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
>
> -$(LIBPERF_IN): FORCE
> +uapi-asm := $(OUTPUT)/../arch/$(SRCARCH)/include/generated/uapi/asm
> +ifeq ($(SRCARCH),arm64)
> + syscall-y := $(uapi-asm)/unistd_64.h
> +endif
> +uapi-asm-generic:
> + $(if $(syscall-y),\
> + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-headers obj=$(uapi-asm) \
> + generic=include/uapi/asm-generic $(syscall-y),)
> +
> +$(LIBPERF_IN): uapi-asm-generic FORCE
> $(Q)$(MAKE) $(build)=libperf
>
> $(LIBPERF_A): $(LIBPERF_IN)
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index eea95c6c0c71..a52482654d4b 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -29,6 +29,7 @@ include $(srctree)/tools/scripts/Makefile.arch
> $(call detected_var,SRCARCH)
>
> CFLAGS += -I$(OUTPUT)arch/$(SRCARCH)/include/generated
> +CFLAGS += -I$(OUTPUT)arch/$(SRCARCH)/include/generated/uapi
>
Thanks for fixing this.
This patch fixes the perf build failure on mainline ARM64.
Tested-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Regards,
Harshit
> # Additional ARCH settings for ppc
> ifeq ($(SRCARCH),powerpc)
>
> ---
> base-commit: 2b70702917337a8d6d07f03eed961e0119091647
> change-id: 20250414-james-perf-fix-gen-syscall-a8d9b4367d07
>
> Best regards,
next prev parent reply other threads:[~2025-04-23 11:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 13:55 [PATCH] perf tools: Fix arm64 build by generating unistd_64.h James Clark
2025-04-23 11:16 ` Harshit Mogalapalli [this message]
2025-04-24 10:28 ` Leo Yan
2025-04-28 13:23 ` Thorsten Leemhuis
2025-04-29 7:42 ` James Clark
2025-04-29 7:52 ` James Clark
2025-04-29 8:02 ` Thorsten Leemhuis
2025-04-29 9:21 ` James Clark
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=9eefa69e-72a1-4cfb-9f7e-349532f9fb7c@oracle.com \
--to=harshit.m.mogalapalli@oracle.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=arnd@linaro.org \
--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=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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).