Skip to contentSkip to conversation

perf test: fix failing test cases on linux-next for s390

PATCH In review Thomas Richter 3 participants 5 messages Jun 16, 2023 – Jun 19, 2023 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf test: fix failing test cases on linux-next for s390

In linux-next tree the many test cases fail on s390x when running the perf test suite, sometime the perf tool dumps core.

Output before:
6.1: Test event parsing : FAILED!
10.3: Parsing of PMU event table metrics : FAILED!
10.4: Parsing of PMU event table metrics with fake PMUs: FAILED!

 17: Setup struct perf_event_attr                       : FAILED!
 24: Number of exit events of a simple workload         : FAILED!
 26: Object code reading                                : FAILED!
 28: Use a dummy software event to keep tracking        : FAILED!
 35: Track with sched_switch                            : FAILED!
 42.3: BPF prologue generation                          : FAILED!
 66: Parse and process metrics                          : FAILED!
 68: Event expansion for cgroups                        : FAILED!
 69.2: Perf time to TSC                                 : FAILED!
 74: build id cache operations                          : FAILED!
 86: Zstd perf.data compression/decompression           : FAILED!
 87: perf record tests                                  : FAILED!
106: Test java symbol                                   : FAILED!

The reason for all these failure is a missing PMU. On s390x
the PMU is named cpum_cf which is not detected as core PMU.
A similar patch was added before, see
commit 9bacbced0e32 ("perf list: Add s390 support for detailed PMU event description") which got lost during the recent reworks. Add it again.

Output after:
10.2: PMU event map aliases : FAILED!
42.3: BPF prologue generation : FAILED!

Most test cases now work and there is not core dump anymore.

---
 tools/perf/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/pmu.c +1 -1
index fe64ad292d36..6142e4710a2f 100644
@@ -1419,7 +1419,7 @@ void perf_pmu__del_formats(struct list_head *formats)
 
 bool is_pmu_core(const char *name)
 {
-	return !strcmp(name, "cpu") || is_sysfs_pmu_core(name);
+	return !strcmp(name, "cpu") || !strcmp(name, "cpum_cf") || is_sysfs_pmu_core(name);
 }
 
 bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu)
Signature · 1 line
2.39.2
#1 lore raw

Em Fri, Jun 16, 2023 at 10:14:37AM +0200, Thomas Richter escreveu:

Quoted 27 lines

In linux-next tree the many test cases fail on s390x when running the perf test suite, sometime the perf tool dumps core.

Output before:
6.1: Test event parsing : FAILED!
10.3: Parsing of PMU event table metrics : FAILED!
10.4: Parsing of PMU event table metrics with fake PMUs: FAILED!

 17: Setup struct perf_event_attr                       : FAILED!
 24: Number of exit events of a simple workload         : FAILED!
 26: Object code reading                                : FAILED!
 28: Use a dummy software event to keep tracking        : FAILED!
 35: Track with sched_switch                            : FAILED!
 42.3: BPF prologue generation                          : FAILED!
 66: Parse and process metrics                          : FAILED!
 68: Event expansion for cgroups                        : FAILED!
 69.2: Perf time to TSC                                 : FAILED!
 74: build id cache operations                          : FAILED!
 86: Zstd perf.data compression/decompression           : FAILED!
 87: perf record tests                                  : FAILED!
106: Test java symbol                                   : FAILED!

The reason for all these failure is a missing PMU. On s390x
the PMU is named cpum_cf which is not detected as core PMU.
A similar patch was added before, see
commit 9bacbced0e32 ("perf list: Add s390 support for detailed PMU event description") which got lost during the recent reworks. Add it again.

Quoted 5 lines

Output after:
10.2: PMU event map aliases : FAILED!
42.3: BPF prologue generation : FAILED!

Most test cases now work and there is not core dump anymore.

So you're not fixing 'perf test', that is just what detects the problem, the part being fixed is the PMU code, so I'm rewriting the patch subject to:

[PATCH] perf pmu: Fix core PMU detection on s/390

Have you bisected the problem to the first patch where this problem appears?

- Arnaldo

Quoted 22 lines
---
 tools/perf/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/pmu.c +1 -1
index fe64ad292d36..6142e4710a2f 100644
@@ -1419,7 +1419,7 @@ void perf_pmu__del_formats(struct list_head *formats)
 
 bool is_pmu_core(const char *name)
 {
-	return !strcmp(name, "cpu") || is_sysfs_pmu_core(name);
+	return !strcmp(name, "cpu") || !strcmp(name, "cpum_cf") || is_sysfs_pmu_core(name);
 }
 
 bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu)
Signature · 1 line
2.39.2
Signature · 1 line
- Arnaldo
reviewer Acked-by
#2 lore raw
Quoted 35 lines · Arnaldo Carvalho de Melo

Em Fri, Jun 16, 2023 at 10:14:37AM +0200, Thomas Richter escreveu:

Quoted 27 lines

In linux-next tree the many test cases fail on s390x when running the perf test suite, sometime the perf tool dumps core.

Output before:
6.1: Test event parsing : FAILED!
10.3: Parsing of PMU event table metrics : FAILED!
10.4: Parsing of PMU event table metrics with fake PMUs: FAILED!

 17: Setup struct perf_event_attr                       : FAILED!
 24: Number of exit events of a simple workload         : FAILED!
 26: Object code reading                                : FAILED!
 28: Use a dummy software event to keep tracking        : FAILED!
 35: Track with sched_switch                            : FAILED!
 42.3: BPF prologue generation                          : FAILED!
 66: Parse and process metrics                          : FAILED!
 68: Event expansion for cgroups                        : FAILED!
 69.2: Perf time to TSC                                 : FAILED!
 74: build id cache operations                          : FAILED!
 86: Zstd perf.data compression/decompression           : FAILED!
 87: perf record tests                                  : FAILED!
106: Test java symbol                                   : FAILED!

The reason for all these failure is a missing PMU. On s390x
the PMU is named cpum_cf which is not detected as core PMU.
A similar patch was added before, see
commit 9bacbced0e32 ("perf list: Add s390 support for detailed PMU event description") which got lost during the recent reworks. Add it again.

Quoted 5 lines

Output after:
10.2: PMU event map aliases : FAILED!
42.3: BPF prologue generation : FAILED!

Most test cases now work and there is not core dump anymore.

Quoted 8 lines

So you're not fixing 'perf test', that is just what detects the problem, the part being fixed is the PMU code, so I'm rewriting the patch subject to:

[PATCH] perf pmu: Fix core PMU detection on s/390

Have you bisected the problem to the first patch where this problem appears?

I suspect:
https://lore.kernel.org/all/[email protected]/
9d6a1df9b2ee ("perf pmus: Allow just core PMU scanning")

Thanks,
Ian

Quoted 28 lines

- Arnaldo

Quoted 20 lines
---
 tools/perf/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/pmu.c +1 -2
index fe64ad292d36..6142e4710a2f 100644
@@ -1419,7 +1419,7 @@ void perf_pmu__del_formats(struct list_head *formats)
 
 bool is_pmu_core(const char *name)
 {
-     return !strcmp(name, "cpu") || is_sysfs_pmu_core(name);
+     return !strcmp(name, "cpu") || !strcmp(name, "cpum_cf") || is_sysfs_pmu_core(name);
 }
 
 bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu)
--
Quoted 2 lines

2.39.2

--

- Arnaldo

#3 lore raw

Em Fri, Jun 16, 2023 at 01:48:45PM -0700, Ian Rogers escreveu:

Quoted 43 lines
Quoted 41 lines · Arnaldo Carvalho de Melo

Em Fri, Jun 16, 2023 at 10:14:37AM +0200, Thomas Richter escreveu:

Quoted 27 lines

In linux-next tree the many test cases fail on s390x when running the perf test suite, sometime the perf tool dumps core.

Output before:
6.1: Test event parsing : FAILED!
10.3: Parsing of PMU event table metrics : FAILED!
10.4: Parsing of PMU event table metrics with fake PMUs: FAILED!

 17: Setup struct perf_event_attr                       : FAILED!
 24: Number of exit events of a simple workload         : FAILED!
 26: Object code reading                                : FAILED!
 28: Use a dummy software event to keep tracking        : FAILED!
 35: Track with sched_switch                            : FAILED!
 42.3: BPF prologue generation                          : FAILED!
 66: Parse and process metrics                          : FAILED!
 68: Event expansion for cgroups                        : FAILED!
 69.2: Perf time to TSC                                 : FAILED!
 74: build id cache operations                          : FAILED!
 86: Zstd perf.data compression/decompression           : FAILED!
 87: perf record tests                                  : FAILED!
106: Test java symbol                                   : FAILED!

The reason for all these failure is a missing PMU. On s390x
the PMU is named cpum_cf which is not detected as core PMU.
A similar patch was added before, see
commit 9bacbced0e32 ("perf list: Add s390 support for detailed PMU event description") which got lost during the recent reworks. Add it again.

Quoted 5 lines

Output after:
10.2: PMU event map aliases : FAILED!
42.3: BPF prologue generation : FAILED!

Most test cases now work and there is not core dump anymore.

So you're not fixing 'perf test', that is just what detects the problem, the part being fixed is the PMU code, so I'm rewriting the patch subject to:

[PATCH] perf pmu: Fix core PMU detection on s/390

Quoted 8 lines
Quoted 2 lines

Have you bisected the problem to the first patch where this problem appears?

I suspect:
https://lore.kernel.org/all/[email protected]/
9d6a1df9b2ee ("perf pmus: Allow just core PMU scanning")

I already pushed to perf-tools-next, but this acked/fixes is reachable via the Link tag.

Thanks for checking and acking!

- Arnaldo

Quoted 31 lines

Thanks,
Ian

Quoted 28 lines

- Arnaldo

Quoted 20 lines
---
 tools/perf/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/pmu.c +1 -2
index fe64ad292d36..6142e4710a2f 100644
@@ -1419,7 +1419,7 @@ void perf_pmu__del_formats(struct list_head *formats)
 
 bool is_pmu_core(const char *name)
 {
-     return !strcmp(name, "cpu") || is_sysfs_pmu_core(name);
+     return !strcmp(name, "cpu") || !strcmp(name, "cpum_cf") || is_sysfs_pmu_core(name);
 }
 
 bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu)
--
Quoted 2 lines

2.39.2

--

- Arnaldo

Signature · 1 line
- Arnaldo
#4 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 38 lines · Arnaldo Carvalho de Melo

Em Fri, Jun 16, 2023 at 10:14:37AM +0200, Thomas Richter escreveu:

Quoted 27 lines

In linux-next tree the many test cases fail on s390x when running the perf test suite, sometime the perf tool dumps core.

Output before:
6.1: Test event parsing : FAILED!
10.3: Parsing of PMU event table metrics : FAILED!
10.4: Parsing of PMU event table metrics with fake PMUs: FAILED!

 17: Setup struct perf_event_attr                       : FAILED!
 24: Number of exit events of a simple workload         : FAILED!
 26: Object code reading                                : FAILED!
 28: Use a dummy software event to keep tracking        : FAILED!
 35: Track with sched_switch                            : FAILED!
 42.3: BPF prologue generation                          : FAILED!
 66: Parse and process metrics                          : FAILED!
 68: Event expansion for cgroups                        : FAILED!
 69.2: Perf time to TSC                                 : FAILED!
 74: build id cache operations                          : FAILED!
 86: Zstd perf.data compression/decompression           : FAILED!
 87: perf record tests                                  : FAILED!
106: Test java symbol                                   : FAILED!

The reason for all these failure is a missing PMU. On s390x
the PMU is named cpum_cf which is not detected as core PMU.
A similar patch was added before, see
commit 9bacbced0e32 ("perf list: Add s390 support for detailed PMU event description") which got lost during the recent reworks. Add it again.

Quoted 5 lines

Output after:
10.2: PMU event map aliases : FAILED!
42.3: BPF prologue generation : FAILED!

Most test cases now work and there is not core dump anymore.

So you're not fixing 'perf test', that is just what detects the problem, the part being fixed is the PMU code, so I'm rewriting the patch subject to:

Quoted 6 lines

[PATCH] perf pmu: Fix core PMU detection on s/390

Have you bisected the problem to the first patch where this problem appears?

- Arnaldo

Thanks for picking this patch, I noticed it is already in linux-next tree.

No I did not do the bisect. That first patch info came from Ian Rogers.

Quoted 24 lines
Quoted 23 lines
---
 tools/perf/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/pmu.c +1 -1
index fe64ad292d36..6142e4710a2f 100644
@@ -1419,7 +1419,7 @@ void perf_pmu__del_formats(struct list_head *formats)
 
 bool is_pmu_core(const char *name)
 {
-	return !strcmp(name, "cpu") || is_sysfs_pmu_core(name);
+	return !strcmp(name, "cpu") || !strcmp(name, "cpum_cf") || is_sysfs_pmu_core(name);
 }
 
 bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu)
Signature · 1 line
2.39.2
Signature · 5 lines
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294