Skip to contentSkip to conversation

perf test: Remove event_group test for events in multiple PMUs

PATCH In review Michael Petlan 2 participants 2 messages Sep 18, 2023 – Sep 19, 2023 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf test: Remove event_group test for events in multiple PMUs

The test fails on various environments, since not all the combinations of events in a group work. Based on fact, that perf contains code that re-organizes events in groups (and also removes groups when it does not make sense), I assume that there is no rule an arbitrary combination of arbitrary events *should* be supported.

When an uncore event is grouped together with cycles and cs (a sw event):

    # perf stat -e '{uncore_cbox_0/clockticks/,cs,cycles}'
Quoted 3 lines

WARNING: events were regrouped to match PMUs
WARNING: grouped events cpus do not match.
Events with CPUs not matching the leader will be removed from the group.

    anon group { uncore_cbox_0/clockticks/, cs }
    ^C

(the CPU used is Haswell (Intel, family 6, model 60)

The test uses perf_event_open() syscall and bypasses the algorithms perf tool uses to prevent scheduling invalid groups.

Remove the test-case then.

Fixes 9d9b22bedad1 ("perf test: Add event group test for events in multiple PMUs")
---
 tools/perf/tests/Build          |   1 -
 tools/perf/tests/builtin-test.c |   1 -
 tools/perf/tests/event_groups.c | 136 --------------------------------
 tools/perf/tests/tests.h        |   1 -
 4 files changed, 139 deletions(-)
 delete mode 100644 tools/perf/tests/event_groups.c
tools/perf/tests/Build +0 -1
index 63d5e6d5f165..4244837eb210 100644
@@ -57,21 +57,20 @@ perf-y += genelf.o
 perf-y += api-io.o
 perf-y += demangle-java-test.o
 perf-y += demangle-ocaml-test.o
 perf-y += pfm.o
 perf-y += parse-metric.o
 perf-y += pe-file-parsing.o
 perf-y += expand-cgroup.o
 perf-y += perf-time-to-tsc.o
 perf-y += dlfilter-test.o
 perf-y += sigtrap.o
-perf-y += event_groups.o
 perf-y += symbols.o
 
 ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc))
 perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
 endif
 
 CFLAGS_attr.o         += -DBINDIR="BUILD_STR($(bindir_SQ))" -DPYTHON="BUILD_STR($(PYTHON_WORD))"
 CFLAGS_python-use.o   += -DPYTHONPATH="BUILD_STR($(OUTPUT)python)" -DPYTHON="BUILD_STR($(PYTHON_WORD))"
 CFLAGS_dwarf-unwind.o += -fno-optimize-sibling-calls
 
tools/perf/tests/builtin-test.c +0 -1
index 0ad18cf6dd22..cab1f5c00c88 100644
@@ -114,21 +114,20 @@ static struct test_suite *generic_tests[] = {
 	&suite__api_io,
 	&suite__maps__merge_in,
 	&suite__demangle_java,
 	&suite__demangle_ocaml,
 	&suite__parse_metric,
 	&suite__pe_file_parsing,
 	&suite__expand_cgroup_events,
 	&suite__perf_time_to_tsc,
 	&suite__dlfilter,
 	&suite__sigtrap,
-	&suite__event_groups,
 	&suite__symbols,
 	NULL,
 };
 
 static struct test_suite **tests[] = {
 	generic_tests,
 	arch_tests,
 };
 
 static struct test_workload *workloads[] = {
tools/perf/tests/event_groups.c deleted +0 -136

136 lines not on this page · raw message

tools/perf/tests/tests.h +0 -1
index f33cfc3c19a4..d30a99d60ba5 100644
@@ -136,21 +136,20 @@ DECLARE_SUITE(jit_write_elf);
 DECLARE_SUITE(api_io);
 DECLARE_SUITE(demangle_java);
 DECLARE_SUITE(demangle_ocaml);
 DECLARE_SUITE(pfm);
 DECLARE_SUITE(parse_metric);
 DECLARE_SUITE(pe_file_parsing);
 DECLARE_SUITE(expand_cgroup_events);
 DECLARE_SUITE(perf_time_to_tsc);
 DECLARE_SUITE(dlfilter);
 DECLARE_SUITE(sigtrap);
-DECLARE_SUITE(event_groups);
 DECLARE_SUITE(symbols);
 
 /*
  * PowerPC and S390 do not support creation of instruction breakpoints using the
  * perf_event interface.
  *
  * ARM requires explicit rounding down of the instruction pointer in Thumb mode,
  * and then requires the single-step to be handled explicitly in the overflow
  * handler to avoid stepping into the SIGIO handler and getting stuck on the
  * breakpointed instruction.
Signature · 1 line
2.18.4
#1 lore raw

Hi Michael,

Quoted 11 lines · Michael Petlan

The test fails on various environments, since not all the combinations of events in a group work. Based on fact, that perf contains code that re-organizes events in groups (and also removes groups when it does not make sense), I assume that there is no rule an arbitrary combination of arbitrary events *should* be supported.

When an uncore event is grouped together with cycles and cs (a sw event):

    # perf stat -e '{uncore_cbox_0/clockticks/,cs,cycles}'
Quoted 3 lines

WARNING: events were regrouped to match PMUs
WARNING: grouped events cpus do not match.
Events with CPUs not matching the leader will be removed from the group.

Quoted 8 lines
    anon group { uncore_cbox_0/clockticks/, cs }
    ^C

(the CPU used is Haswell (Intel, family 6, model 60)

The test uses perf_event_open() syscall and bypasses the algorithms perf tool uses to prevent scheduling invalid groups.

Remove the test-case then.

Event group of different hw pmus is not allowed by kernel. This selftest is to validate the kernel code, not the perf tool. Please see:

https://git.kernel.org/torvalds/c/bf480f93856673

Can you please rather fix the test instead of removing it.

Thanks,
Ravi