linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
To: Likhitha Korrapati <likhitha@linux.ibm.com>,
	acme@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com,
	irogers@google.com, namhyung@kernel.org
Cc: linux-perf-users@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	maddy@linux.ibm.com, atrajeev@linux.ibm.com
Subject: Re: [PATCH] tools/perf/arch/powerpc/util: Fix is_compat_mode build break in ppc64
Date: Mon, 24 Mar 2025 17:51:17 +0530	[thread overview]
Message-ID: <37a5a63f-9a75-4196-bf5e-2106bccab18f@linux.ibm.com> (raw)
In-Reply-To: <20250321100726.699956-1-likhitha@linux.ibm.com>


On 21/03/25 3:37 pm, Likhitha Korrapati wrote:
> Commit 54f9aa1092457 ("tools/perf/powerpc/util: Add support to
> handle compatible mode PVR for perf json events") introduced
> to select proper JSON events in case of compat mode using
> auxiliary vector. But this caused a compilation error in ppc64
> Big Endian.
>
> arch/powerpc/util/header.c: In function 'is_compat_mode':
> arch/powerpc/util/header.c:20:21: error: cast to pointer from
> integer of different size [-Werror=int-to-pointer-cast]
>     20 |         if (!strcmp((char *)platform, (char *)base_platform))
>        |                     ^
> arch/powerpc/util/header.c:20:39: error: cast to pointer from
> integer of different size [-Werror=int-to-pointer-cast]
>     20 |         if (!strcmp((char *)platform, (char *)base_platform))
>        |
>
> Commit saved the getauxval(AT_BASE_PLATFORM) and getauxval(AT_PLATFORM)
> return values in u64 which causes the compilation error.
>
> Patch fixes this issue by changing u64 to "unsigned long".
>
> Fixes: 54f9aa1092457 ("tools/perf/powerpc/util: Add support to handle compatible mode PVR for perf json events")
> Signed-off-by: Likhitha Korrapati <likhitha@linux.ibm.com>
> ---
>   tools/perf/arch/powerpc/util/header.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/arch/powerpc/util/header.c b/tools/perf/arch/powerpc/util/header.c
> index c7df534dbf8f..0be74f048f96 100644
> --- a/tools/perf/arch/powerpc/util/header.c
> +++ b/tools/perf/arch/powerpc/util/header.c
> @@ -14,8 +14,8 @@
>   
>   static bool is_compat_mode(void)
>   {
> -	u64 base_platform = getauxval(AT_BASE_PLATFORM);
> -	u64 platform = getauxval(AT_PLATFORM);
> +	unsigned long base_platform = getauxval(AT_BASE_PLATFORM);
> +	unsigned long platform = getauxval(AT_PLATFORM);
>   
>   	if (!strcmp((char *)platform, (char *)base_platform))
>   		return false;

Applied this patch on the powerpc kernel and it fixes the issue.


Without this patch:

   INSTALL libsubcmd_headers
   INSTALL libsymbol_headers
   INSTALL libperf_headers
   INSTALL libapi_headers
   CC      /output/arch/powerpc/util/header.o
   CC      /output/arch/powerpc/util/perf_regs.o
   CC      /output/arch/powerpc/util/mem-events.o
   CC      /output/arch/powerpc/util/pmu.o
   CC      /output/arch/powerpc/util/sym-handling.o
   CC      /output/arch/powerpc/util/evsel.o
   CC      /output/arch/powerpc/util/event.o
arch/powerpc/util/header.c: In function 'is_compat_mode':
arch/powerpc/util/header.c:20:21: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
    20 |         if (!strcmp((char *)platform, (char *)base_platform))
       |                     ^
arch/powerpc/util/header.c:20:39: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
    20 |         if (!strcmp((char *)platform, (char *)base_platform))
       |                                       ^
cc1: all warnings being treated as errors
make[6]: *** [/linux/tools/build/Makefile.build:85: 
/output/arch/powerpc/util/header.o] Error 1
make[6]: *** Waiting for unfinished jobs....
make[5]: *** [/linux/tools/build/Makefile.build:138: util] Error 2
make[4]: *** [/linux/tools/build/Makefile.build:138: powerpc] Error 2
make[3]: *** [/linux/tools/build/Makefile.build:138: arch] Error 2
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile.perf:781: /output/perf-util-in.o] Error 2
make[1]: *** [Makefile.perf:280: sub-make] Error 2
make: *** [Makefile:76: all] Error 2
make: Leaving directory '/linux/tools/perf'


With this patch:

   PERF_VERSION = 6.14.rc4.gbdfd7b9150f1
   INSTALL libapi_headers
   GEN     perf-archive
   GEN     perf-iostat
   INSTALL libperf_headers
   CC      /output/arch/powerpc/util/header.o
   LD      /output/arch/powerpc/util/perf-util-in.o
   LD      /output/arch/powerpc/perf-util-in.o
   LD      /output/arch/perf-util-in.o
   CC      /output/util/header.o
   LD      /output/util/perf-util-in.o
   LD      /output/perf-util-in.o
   AR      /output/libperf-util.a
   LINK    /output/perf
make: Leaving directory '/linux/tools/perf'
## tools/perf build completed rc = 0
## Build completed OK


Please add below tag:

Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>


Regards,

Venkat.



  parent reply	other threads:[~2025-03-24 12:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-21 10:07 [PATCH] tools/perf/arch/powerpc/util: Fix is_compat_mode build break in ppc64 Likhitha Korrapati
2025-03-22  8:05 ` Athira Rajeev
2025-03-24 12:21 ` Venkat Rao Bagalkote [this message]
2025-03-24 16:34 ` 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=37a5a63f-9a75-4196-bf5e-2106bccab18f@linux.ibm.com \
    --to=venkat88@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=atrajeev@linux.ibm.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=likhitha@linux.ibm.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --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;
as well as URLs for NNTP newsgroup(s).