<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/perf/tests/pmu.c, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2025-10-15T14:59:10Z</updated>
<entry>
<title>perf parse-events: Remove unused FILE input argument to scanner</title>
<updated>2025-10-15T14:59:10Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-10-05T18:24:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5f68451a9356522920928391b84c6c21fd92c903'/>
<id>urn:sha1:5f68451a9356522920928391b84c6c21fd92c903</id>
<content type='text'>
Now the events file isn't directly parsed from a FILE but stored in a
string prior to parsing, remove the FILE argument to the associated
scanner functions as they only ever pass NULL.

Tested-by: Thomas Richter &lt;tmricht@linux.ibm.com&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf pmu: Rename name matching for no suffix or wildcard variants</title>
<updated>2025-02-05T05:28:46Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-02-01T07:43:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=63e287131cf0c59b026053d6d63fe271604ffa7e'/>
<id>urn:sha1:63e287131cf0c59b026053d6d63fe271604ffa7e</id>
<content type='text'>
Wildcard PMU naming will match a name like pmu_1 to a PMU name like
pmu_10 but not to a PMU name like pmu_2 as the suffix forms part of
the match. No suffix matching will match pmu_10 to either pmu_1 or
pmu_2. Add or rename matching functions on PMU to make it clearer what
kind of matching is being performed.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Reviewed-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20250201074320.746259-4-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf pmu: Allow hardcoded terms to be applied to attributes</title>
<updated>2024-10-11T06:40:32Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-10-02T03:20:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c798f72c7a67a4c089142d4b16c8b9587e6db5e6'/>
<id>urn:sha1:c798f72c7a67a4c089142d4b16c8b9587e6db5e6</id>
<content type='text'>
Hard coded terms like "config=10" are skipped by perf_pmu__config
assuming they were already applied to a perf_event_attr by parse
event's config_attr function. When doing a reverse number to name
lookup in perf_pmu__name_from_config, as the hardcoded terms aren't
applied the config value is incorrect leading to misses or false
matches. Fix this by adding a parameter to have perf_pmu__config apply
hardcoded terms too (not just in parse event's config_term_common).

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20241002032016.333748-3-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tests pmu: Initialize all fields of test_pmu variable</title>
<updated>2024-08-12T16:42:56Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2024-08-12T12:57:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4f21bfed691c96da1fc85b76c16e8f6d8fe98a3d'/>
<id>urn:sha1:4f21bfed691c96da1fc85b76c16e8f6d8fe98a3d</id>
<content type='text'>
Instead of explicitely initializing just the .name and .alias_name,
use struct member named initialization of just the non-null -name field,
the compiler will initialize all the other non-explicitely initialized
fields to NULL.

This makes the code more robust, avoiding the error recently fixed when
the .alias_name was used and contained a random value.

Reviewed-by: Veronika Molnarova &lt;vmolnaro@redhat.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: James Clark &lt;james.clark@arm.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Michael Petlan &lt;mpetlan@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Radostin Stoyanov &lt;rstoyano@redhat.com&gt;
Link: https://lore.kernel.org/lkml/e26941f9-f86c-4f2e-b812-20c49fb2c0d3@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf test pmu: Set uninitialized PMU alias to null</title>
<updated>2024-08-08T14:01:54Z</updated>
<author>
<name>Veronika Molnarova</name>
<email>vmolnaro@redhat.com</email>
</author>
<published>2024-08-08T10:37:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=37e2a19c98bf99747ca997be876dfc13f9165e0a'/>
<id>urn:sha1:37e2a19c98bf99747ca997be876dfc13f9165e0a</id>
<content type='text'>
Commit 3e0bf9fde2984469 ("perf pmu: Restore full PMU name wildcard
support") adds a test case "PMU cmdline match" that covers PMU name
wildcard support provided by function perf_pmu__match().

The test works with a wide range of supported combinations of PMU name
matching but omits the case that if the perf_pmu__match() cannot match
the PMU name to the wildcard, it tries to match its alias. However, this
variable is not set up, causing the test case to fail when run with
subprocesses or to segfault if run as a single process.

  ./perf test -vv 9
    9: Sysfs PMU tests                                :
    9.1: Parsing with PMU format directory            : Ok
    9.2: Parsing with PMU event                       : Ok
    9.3: PMU event names                              : Ok
    9.4: PMU name combining                           : Ok
    9.5: PMU name comparison                          : Ok
    9.6: PMU cmdline match                            : FAILED!

  ./perf test -F 9
    9.1: Parsing with PMU format directory            : Ok
    9.2: Parsing with PMU event                       : Ok
    9.3: PMU event names                              : Ok
    9.4: PMU name combining                           : Ok
    9.5: PMU name comparison                          : Ok
  Segmentation fault (core dumped)

Initialize the PMU alias to null for all tests of perf_pmu__match()
as this functionality is not being tested and the alias matching works
exactly the same as the matching of the PMU name.

./perf test -F 9
  9.1: Parsing with PMU format directory                             : Ok
  9.2: Parsing with PMU event                                        : Ok
  9.3: PMU event names                                               : Ok
  9.4: PMU name combining                                            : Ok
  9.5: PMU name comparison                                           : Ok
  9.6: PMU cmdline match                                             : Ok

Fixes: 3e0bf9fde2984469 ("perf pmu: Restore full PMU name wildcard support")
Signed-off-by: Veronika Molnarova &lt;vmolnaro@redhat.com&gt;
Cc: James Clark &lt;james.clark@linaro.org&gt;
Cc: Michael Petlan &lt;mpetlan@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Radostin Stoyanov &lt;rstoyano@redhat.com&gt;
Link: https://lore.kernel.org/r/20240808103749.9356-1-vmolnaro@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf test pmu: Remove unused test_pmus</title>
<updated>2024-07-31T19:58:18Z</updated>
<author>
<name>Dr. David Alan Gilbert</name>
<email>linux@treblig.org</email>
</author>
<published>2024-07-27T17:59:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=156e8dcfeceebce0694fb00542ac68e61a785fe1'/>
<id>urn:sha1:156e8dcfeceebce0694fb00542ac68e61a785fe1</id>
<content type='text'>
Commit aa1551f299ba ("perf test pmu: Refactor format test and exposed
test APIs") added the 'test_pmus' list, but didn't use it.
(It seems to put them on the other_pmus list?)

Remove it.

Fixes: aa1551f299ba414c ("perf test pmu: Refactor format test and exposed test APIs")
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Dr. David Alan Gilbert &lt;linux@treblig.org&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Link: https://lore.kernel.org/lkml/20240727175919.1041468-1-linux@treblig.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf pmu: Restore full PMU name wildcard support</title>
<updated>2024-06-28T03:28:01Z</updated>
<author>
<name>James Clark</name>
<email>james.clark@arm.com</email>
</author>
<published>2024-06-26T14:54:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3e0bf9fde29844694ad9912aa290fbdb2c3fa767'/>
<id>urn:sha1:3e0bf9fde29844694ad9912aa290fbdb2c3fa767</id>
<content type='text'>
Commit b2b9d3a3f021 ("perf pmu: Support wildcards on pmu name in dynamic
pmu events") gives the following example for wildcarding a subset of
PMUs:

  E.g., in a system with the following dynamic pmus:

        mypmu_0
        mypmu_1
        mypmu_2
        mypmu_4

  perf stat -e mypmu_[01]/&lt;config&gt;/

Since commit f91fa2ae6360 ("perf pmu: Refactor perf_pmu__match()"), only
"*" has been supported, removing the ability to subset PMUs, even though
parse-events.l still supports ? and [] characters.

Fix it by using fnmatch() when any glob character is detected and add a
test which covers that and other scenarios of
perf_pmu__match_ignoring_suffix().

Fixes: f91fa2ae6360 ("perf pmu: Refactor perf_pmu__match()")
Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: robin.murphy@arm.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20240626145448.896746-2-james.clark@arm.com
</content>
</entry>
<entry>
<title>perf test pmu: Warn don't fail for legacy mixed case event names</title>
<updated>2024-06-14T04:27:49Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-06-12T12:40:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=65b37df8c61ceea863ac0ac188fe3464c2ee3ac0'/>
<id>urn:sha1:65b37df8c61ceea863ac0ac188fe3464c2ee3ac0</id>
<content type='text'>
PowerPC has mixed case events matching legacy hardware cache
events. Warn but don't fail in this case. Event parsing will still
work in this case by matching the legacy case.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Kajol Jain &lt;kjain@linux.ibm.com&gt;
Cc: James Clark &lt;james.clark@arm.com&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20240612124027.2712643-1-irogers@google.com
</content>
</entry>
<entry>
<title>perf tests: Add some pmu core functionality tests</title>
<updated>2024-05-28T18:29:49Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-05-15T06:01:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=678be1ca30cc939e0180c85b4cc9150b3d5ef0c8'/>
<id>urn:sha1:678be1ca30cc939e0180c85b4cc9150b3d5ef0c8</id>
<content type='text'>
Test behavior of PMU names and comparisons wrt suffixes using Intel
uncore_cha, marvell mrvl_ddr_pmu and S390's cpum_cf as examples.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Ravi Bangoria &lt;ravi.bangoria@amd.com&gt;
Cc: James Clark &lt;james.clark@arm.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Thomas Richter &lt;tmricht@linux.ibm.com&gt;
Cc: Bharat Bhushan &lt;bbhushan2@marvell.com&gt;
Cc: Bhaskara Budiredla &lt;bbudiredla@marvell.com&gt;
Cc: Tuan Phan &lt;tuanphan@os.amperecomputing.com&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20240515060114.3268149-3-irogers@google.com
</content>
</entry>
<entry>
<title>perf test pmu: Test all sysfs PMU event names are the same case</title>
<updated>2024-05-03T20:08:20Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-05-02T21:35:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6debc5aa326fa2eefe2988aaa4c46a1aa6b16e11'/>
<id>urn:sha1:6debc5aa326fa2eefe2988aaa4c46a1aa6b16e11</id>
<content type='text'>
Being either lower or upper case means event name probes can avoid
scanning the directory doing case insensitive comparisons, just the
lower or upper case version of the name can be checked for
existence.

For the majority of PMUs event names are all lower case, upper case
names are present on S390.

Reviewed-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: James Clark &lt;james.clark@arm.com&gt;
Cc: Jing Zhang &lt;renyu.zj@linux.alibaba.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Ravi Bangoria &lt;ravi.bangoria@amd.com&gt;
Cc: Thomas Richter &lt;tmricht@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20240502213507.2339733-6-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
