Re: [PATCH v1 0/3] Make a "Setup struct perf_event_attr" a shell test

From: Athira Rajeev
Date: Sun Oct 13 2024 - 02:59:24 EST




> On 13 Oct 2024, at 11:08 AM, Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx> wrote:
>
>
>
>> On 11 Oct 2024, at 12:18 PM, Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>>
>> On 2024-10-10 15:50 -0700, Namhyung Kim wrote:
>>> On Tue, 01 Oct 2024 10:19:47 -0700, Ian Rogers wrote:
>>>> The path detection for "Setup struct perf_event_attr" test is brittle
>>>> and leads to the test frequently not running. Running shell tests is
>>>> reasonably robust, so make the test a shell test. Move the test files
>>>> to reflect this.
>>>>
>>>> Ian Rogers (3):
>>>> perf test: Add a shell wrapper for "Setup struct perf_event_attr"
>>>> perf test: Remove C test wrapper for attr.py
>>>> perf test: Move attr files into shell directory where they are used
>>>>
>>>> [...]
>>>
>>> Applied to perf-tools-next, thanks!
>>
>> Dropped from perf-tools-next due to build failures on PPC.
>>
>> https://lore.kernel.org/r/20241011102330.02bece12@xxxxxxxxxxxxxxxx
>
> Hi Namhyung
>
> I am checking this on powerpc. Will respond with the findings
>
> Thanks
> Athira

I tried on tmp.perf-tools-next branch from git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git

But hit a patch apply issue in second patch

error: patch failed: tools/perf/tests/tests.h:83
error: tools/perf/tests/tests.h: patch does not apply

Applied this change separately and hit the compilation error reported by Stephen

As suggested by Ian , tried below change and it did solve the compilation issue

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 37c338b0f8b2..cc5c919dcd0f 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -6,6 +6,11 @@
* copyright notes.
*/
+/* Powerpc needs __SANE_USERSPACE_TYPES__ before <linux/types.h> to select
+ * 'int-ll64.h' and avoid compile warnings when printing __u64 with %llu.
+ */
+#define __SANE_USERSPACE_TYPES__
+
#include <byteswap.h>
#include <errno.h>
#include <inttypes.h>

I could also verify running the test as well

# ./perf test attribute
65: Perf attribute expectations test : Ok


With the change above,

Tested-by: Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx <mailto:atrajeev@xxxxxxxxxxxxxxxxxx>>

Thanks
Athira


>>
>> Thanks,
>> Namhyung