All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: acme@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com,
	irogers@google.com, linux-perf-users@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, akanksha@linux.ibm.com,
	maddy@linux.ibm.com, kjain@linux.ibm.com,
	disgoel@linux.vnet.ibm.com, hbathini@linux.ibm.com
Subject: Re: [PATCH] tools/perf/tests: Fix compilation error with strncpy in tests/tool_pmu
Date: Mon, 14 Oct 2024 10:38:40 -0700	[thread overview]
Message-ID: <Zw1XIGML32VaxE0t@google.com> (raw)
In-Reply-To: <20241013173742.71882-1-atrajeev@linux.vnet.ibm.com>

On Sun, Oct 13, 2024 at 11:07:42PM +0530, Athira Rajeev wrote:
> perf fails to compile on systems with GCC version11
> as below:

I have one more build failure on 32 bit systems.  I'll carry this as
well.

Thanks,
Namhyung

---8<---
From 2e2c7ca3691d223d94ea383a6b688e35579d14d5 Mon Sep 17 00:00:00 2001
From: Namhyung Kim <namhyung@kernel.org>
Date: Mon, 14 Oct 2024 10:34:17 -0700
Subject: [PATCH] perf tools: Fix compiler error in util/tool_pmu.c

  util/tool_pmu.c: In function 'evsel__tool_pmu_read':
  util/tool_pmu.c:419:55: error: passing argument 2 of 'tool_pmu__read_event' from incompatible pointer type [-Werror=incompatible-pointer-types]
    419 |                         if (!tool_pmu__read_event(ev, &val)) {
        |                                                       ^~~~
        |                                                       |
        |                                                       long unsigned int *
  util/tool_pmu.c:335:56: note: expected 'u64 *' {aka 'long long unsigned int *'} but argument is of type 'long unsigned int *'
    335 | bool tool_pmu__read_event(enum tool_pmu_event ev, u64 *result)
        |                                                   ~~~~~^~~~~~

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/tool_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/tool_pmu.c b/tools/perf/util/tool_pmu.c
index ea9d50f0252023dc..bd1cee643eb506df 100644
--- a/tools/perf/util/tool_pmu.c
+++ b/tools/perf/util/tool_pmu.c
@@ -394,7 +394,7 @@ bool tool_pmu__read_event(enum tool_pmu_event ev, u64 *result)
 int evsel__tool_pmu_read(struct evsel *evsel, int cpu_map_idx, int thread)
 {
 	__u64 *start_time, cur_time, delta_start;
-	unsigned long val;
+	u64 val;
 	int fd, err = 0;
 	struct perf_counts_values *count, *old_count = NULL;
 	bool adjust = false;
-- 
2.47.0.rc1.288.g06298d1525-goog


  parent reply	other threads:[~2024-10-14 17:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-13 17:37 [PATCH] tools/perf/tests: Fix compilation error with strncpy in tests/tool_pmu Athira Rajeev
2024-10-14 17:26 ` Namhyung Kim
2024-10-16 12:29   ` Athira Rajeev
2024-10-16 15:06     ` Ian Rogers
2024-10-16 18:23       ` Athira Rajeev
2024-10-16 19:04         ` Ian Rogers
2024-10-14 17:38 ` Namhyung Kim [this message]
2024-10-14 17:43 ` 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=Zw1XIGML32VaxE0t@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=akanksha@linux.ibm.com \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=disgoel@linux.vnet.ibm.com \
    --cc=hbathini@linux.ibm.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kjain@linux.ibm.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.