Re: [PATCH V3 0/7] Clean up perf mem

From: Liang, Kan
Date: Tue Jan 16 2024 - 11:37:19 EST




On 2024-01-16 9:05 a.m., kajoljain wrote:
>> For powerpc, the patch 3 introduced a perf_mem_events_power, which
>> doesn't have ldlat. But it only be assigned to the pmu->is_core. I'm not
>> sure if it's the problem.
> Hi Kan,
> Correct there were some small issues with patch 3, I added fix for that.
>

Thanks Kajol Jain! I will fold your fix into V4.

>> Also, S390 still uses the default perf_mem_events, which includes ldlat.
>> I'm not sure if S390 supports the ldlat.
> I checked it, I didn't find ldlat parameter defined in arch/s390
> directory. I think its better to make default ldlat value as false
> in tools/perf/util/mem-events.c file.

The s390 may not be the only user for the default perf_mem_events[] in
the tools/perf/util/mem-events.c. We probably cannot change the default
value.
We may share the perf_mem_events_power[] between powerpc and s390. (We
did the similar share for arm and arm64.)

How about the below patch (not tested.)

diff --git a/tools/perf/arch/s390/util/pmu.c
b/tools/perf/arch/s390/util/pmu.c
index 225d7dc2379c..411034c984bb 100644
--- a/tools/perf/arch/s390/util/pmu.c
+++ b/tools/perf/arch/s390/util/pmu.c
@@ -8,6 +8,7 @@
#include <string.h>

#include "../../../util/pmu.h"
+#include "../../powerpc/util/mem-events.h"

#define S390_PMUPAI_CRYPTO "pai_crypto"
#define S390_PMUPAI_EXT "pai_ext"
@@ -21,5 +22,5 @@ void perf_pmu__arch_init(struct perf_pmu *pmu)
pmu->selectable = true;

if (pmu->is_core)
- pmu->mem_events = perf_mem_events;
+ pmu->mem_events = perf_mem_events_power;
}



However, the original s390 code doesn't include any s390 specific code
for perf_mem. So I thought it uses the default perf_mem_events[].
Is there something I missed?

Or does the s390 even support mem events? If not, I may remove the
mem_events from s390.

Thanks,
Kan