From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Joe Mario <jmario@redhat.com>,
Stephane Eranian <eranian@google.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Kan Liang <kan.liang@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Santosh Shukla <santosh.shukla@amd.com>,
Ananth Narayan <ananth.narayan@amd.com>,
Sandipan Das <sandipan.das@amd.com>
Subject: Re: [PATCH v4 4/4] perf test amd ibs: Add sample period unit test
Date: Tue, 29 Apr 2025 22:13:53 -0300 [thread overview]
Message-ID: <aBF5UWrxvYgbnxde@x1> (raw)
In-Reply-To: <aBE8raTOCVZLfw7J@x1>
On Tue, Apr 29, 2025 at 05:55:13PM -0300, Arnaldo Carvalho de Melo wrote:
> On Tue, Apr 29, 2025 at 03:59:38AM +0000, Ravi Bangoria wrote:
> > IBS Fetch and IBS Op PMUs has various constraints on supported sample
> > periods. Add perf unit tests to test those.
> >
> > Running it in parallel with other tests causes intermittent failures.
> > Mark it exclusive to force it to run sequentially. Sample output on a
> > Zen5 machine:
>
> I've applied the series and will test it now, but found some problems
> when building in some non-glibc systems, namely the use of PAGE_SIZE,
> that is used in libc headers, even in glibc, its just that in glibc we
> happen not to include that header where PAGE_SIZE gets redefined:
>
> ⬢ [acme@toolbx perf-tools-next]$ grep PAGE_SIZE /usr/include/sys/*.h
> /usr/include/sys/user.h:#define PAGE_SIZE (1UL << PAGE_SHIFT)
> /usr/include/sys/user.h:#define PAGE_MASK (~(PAGE_SIZE-1))
> /usr/include/sys/user.h:#define NBPG PAGE_SIZE
> ⬢ [acme@toolbx perf-tools-next]$
>
> So I folded the following patch, see if it is acceptable and please ack.
>
> Thanks for respining it!
Another issue when building with clang on musl:
arch/x86/tests/amd-ibs-period.c:81:3: error: no matching function for call to 'memcpy'
memcpy(func, insn1, sizeof(insn1));
^~~~~~
/usr/include/string.h:27:7: note: candidate function not viable: no known conversion from 'int (*)(void)' to 'void *' for 1st argument
void *memcpy (void *__restrict, const void *__restrict, size_t);
^
/usr/include/fortify/string.h:40:27: note: candidate function not viable: no known conversion from 'int (*)(void)' to 'void *const' for 1st argument
_FORTIFY_FN(memcpy) void *memcpy(void * _FORTIFY_POS0 __od,
^
arch/x86/tests/amd-ibs-period.c:87:3: error: no matching function for call to 'memcpy'
memcpy(func, insn2, sizeof(insn2));
^~~~~~
/usr/include/string.h:27:7: note: candidate function not viable: no known conversion from 'int (*)(void)' to 'void *' for 1st argument
void *memcpy (void *__restrict, const void *__restrict, size_t);
^
/usr/include/fortify/string.h:40:27: note: candidate function not viable: no known conversion from 'int (*)(void)' to 'void *const' for 1st argument
_FORTIFY_FN(memcpy) void *memcpy(void * _FORTIFY_POS0 __od,
^
2 errors generated.
CC /tmp/build/perf/ui/browsers/header.o
CC /tmp/build/perf/arch/x86/util/mem-events.o
Adding the patch below cures it, still need to test on a Zen 5 system.
These issues were just in the regression test.
- Arnaldo
diff --git a/tools/perf/arch/x86/tests/amd-ibs-period.c b/tools/perf/arch/x86/tests/amd-ibs-period.c
index 946b0a377554fb81..a198434da9b5c4a1 100644
--- a/tools/perf/arch/x86/tests/amd-ibs-period.c
+++ b/tools/perf/arch/x86/tests/amd-ibs-period.c
@@ -78,13 +78,13 @@ static int dummy_workload_1(unsigned long count)
else if (count > 10000000)
count = 10000000;
while (count--) {
- memcpy(func, insn1, sizeof(insn1));
+ memcpy((void *)func, insn1, sizeof(insn1));
if (func() != 1) {
pr_debug("ERROR insn1\n");
ret = -1;
goto out;
}
- memcpy(func, insn2, sizeof(insn2));
+ memcpy((void *)func, insn2, sizeof(insn2));
if (func() != 2) {
pr_debug("ERROR insn2\n");
ret = -1;
next prev parent reply other threads:[~2025-04-30 1:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 3:59 [PATCH v4 0/4] perf/amd/ibs: Add Zen5 support (tools changes) Ravi Bangoria
2025-04-29 3:59 ` [PATCH v4 1/4] perf amd ibs: Add Load Latency bits in raw dump Ravi Bangoria
2025-04-30 16:58 ` Namhyung Kim
2025-04-30 17:45 ` Ravi Bangoria
2025-04-29 3:59 ` [PATCH v4 2/4] perf amd ibs: Incorporate Zen5 DTLB and PageSize information Ravi Bangoria
2025-04-29 3:59 ` [PATCH v4 3/4] perf mem/c2c amd: Add ldlat support Ravi Bangoria
2025-04-29 3:59 ` [PATCH v4 4/4] perf test amd ibs: Add sample period unit test Ravi Bangoria
2025-04-29 20:55 ` Arnaldo Carvalho de Melo
2025-04-30 1:13 ` Arnaldo Carvalho de Melo [this message]
2025-04-30 1:22 ` Arnaldo Carvalho de Melo
2025-04-30 9:02 ` Ravi Bangoria
2025-04-30 13:06 ` Arnaldo Carvalho de Melo
2025-04-30 13:31 ` Arnaldo Carvalho de Melo
2025-04-30 16:07 ` Ravi Bangoria
2025-04-30 23:39 ` Arnaldo Carvalho de Melo
2025-04-30 6:36 ` Ravi Bangoria
2025-04-30 6:33 ` Ravi Bangoria
2025-04-30 2:00 ` [PATCH v4 0/4] perf/amd/ibs: Add Zen5 support (tools changes) Arnaldo Carvalho de Melo
2025-05-13 8:32 ` Ravi Bangoria
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=aBF5UWrxvYgbnxde@x1 \
--to=acme@kernel.org \
--cc=ananth.narayan@amd.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=jmario@redhat.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=sandipan.das@amd.com \
--cc=santosh.shukla@amd.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.