Linux Perf Users
 help / color / mirror / Atom feed
From: Athira Rajeev <atrajeev@linux.ibm.com>
To: Likhitha Korrapati <likhitha@linux.ibm.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Ian Rogers <irogers@google.com>,
	Namhyung Kim <namhyung@kernel.org>,
	"open list:PERFORMANCE EVENTS SUBSYSTEM"
	<linux-perf-users@vger.kernel.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: Re: [PATCH] tools/perf/arch/powerpc/util: Fix is_compat_mode build break  in ppc64
Date: Sat, 22 Mar 2025 13:35:52 +0530	[thread overview]
Message-ID: <22675B19-F5B4-4CAE-A320-58F42107FE44@linux.ibm.com> (raw)
In-Reply-To: <20250321100726.699956-1-likhitha@linux.ibm.com>



> On 21 Mar 2025, at 3:37 PM, Likhitha Korrapati <likhitha@linux.ibm.com> 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>

Hi Likhitha,
Thanks for the fix. 

Reviewed-by: Athira Rajeev <atrajeev@linux.ibm.com>

Thanks
Athira
> ---
> 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;
> -- 
> 2.43.5
> 


  reply	other threads:[~2025-03-22  8:06 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 [this message]
2025-03-24 12:21 ` Venkat Rao Bagalkote
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=22675B19-F5B4-4CAE-A320-58F42107FE44@linux.ibm.com \
    --to=atrajeev@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=christophe.leroy@csgroup.eu \
    --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