<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/tools/perf/tests/parse-events.c, branch docs-fixes</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-fixes</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-fixes'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2026-04-02T19:51:10+00:00</updated>
<entry>
<title>perf test: Fix ratio_to_prev event parsing test</title>
<updated>2026-04-02T19:51:10+00:00</updated>
<author>
<name>Thomas Falcon</name>
<email>thomas.falcon@intel.com</email>
</author>
<published>2026-03-27T01:59:27+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=77cb9b443b7fff2a93d78cd2e309db030046772f'/>
<id>urn:sha1:77cb9b443b7fff2a93d78cd2e309db030046772f</id>
<content type='text'>
test__ratio_to_prev() assumed the first event in a group is the leader,
which is not the case when the event is expanded into two event groups
on hybrid PMU's with auto counter reload support. Instead, iterate over the
event group generated for each core PMU. Also update "wrong leader" test to
check that the subordinate event has the correct leader instead of checking
that it is not the group leader. Finally, do not exit immediately if a PMU
without auto counter reload support is found.

Signed-off-by: Thomas Falcon &lt;thomas.falcon@intel.com&gt;
Reviewed-by: Dapeng Mi &lt;dapeng1.mi@linux.intel.com&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Fixes: 56be0fe5f62c ("perf record: Add auto counter reload parse and regression tests")
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf test: Add missing newlines in debug messages</title>
<updated>2026-01-20T20:34:51+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@linaro.org</email>
</author>
<published>2025-12-04T09:10:54+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=838def24130540dcb7b846bdb2bad63ea4c3dd55'/>
<id>urn:sha1:838def24130540dcb7b846bdb2bad63ea4c3dd55</id>
<content type='text'>
These debug messages bleed into the next log line. Fix it by adding the
missing newlines.

Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Leo Yan &lt;leo.yan@arm.com&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;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Use const for variables receiving str{str,r?chr}() returns</title>
<updated>2025-12-17T12:30:37+00:00</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@kernel.org</email>
</author>
<published>2025-12-11T22:17:55+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=45718bce7daf39c618188b70a52644bb5a2f968a'/>
<id>urn:sha1:45718bce7daf39c618188b70a52644bb5a2f968a</id>
<content type='text'>
Newer glibc versions return const char for str{str,chr}() where the
haystack/s is const so to avoid warnings like these on fedora 44 change
some variables to const:

  36     8.17 fedora:44                     : FAIL gcc version 15.2.1 20251111 (Red Hat 15.2.1-4) (GCC)
    libbpf.c: In function 'kallsyms_cb':
    libbpf.c:8489:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
     8489 |         res = strstr(sym_name, ".llvm.");

Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/20251211221756.96294-4-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Add support for perf_event_attr::config4</title>
<updated>2025-11-24T20:20:06+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@linaro.org</email>
</author>
<published>2025-11-11T11:37:58+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=14a84c708efd75b3a2c107b1438354361c7dd75f'/>
<id>urn:sha1:14a84c708efd75b3a2c107b1438354361c7dd75f</id>
<content type='text'>
perf_event_attr has gained a new field, config4, so add support for it
extending the existing configN support.

Reviewed-by: Leo Yan &lt;leo.yan@arm.com&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf test parse-events: Add evsel test helper</title>
<updated>2025-10-15T14:59:12+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-10-05T18:24:30+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b4a63b0e73709bb8eb1a5ed10599fb2256f7ba5f'/>
<id>urn:sha1:b4a63b0e73709bb8eb1a5ed10599fb2256f7ba5f</id>
<content type='text'>
Add TEST_ASSERT_EVSEL to dump the failing evsel in the event of a
failure.

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 test parse-events: Add evlist test helper</title>
<updated>2025-10-15T14:59:12+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-10-05T18:24:29+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=c4b34fe0021ffc5b6eab8411a6b9d0cefed89b35'/>
<id>urn:sha1:c4b34fe0021ffc5b6eab8411a6b9d0cefed89b35</id>
<content type='text'>
Add TEST_ASSERT_EVLIST to dump the failing evlist in the event of a
failure.

Add the macro to a number of tests not currently checking the evlist
length.

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 test: Clean up test_..config helpers</title>
<updated>2025-10-15T14:59:12+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-10-05T18:24:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=8f9f6d7117c9d24217530eae068e367e8947d74e'/>
<id>urn:sha1:8f9f6d7117c9d24217530eae068e367e8947d74e</id>
<content type='text'>
Just have a single test_hw_config helper that strips extended type
information in the case of hardware and hardware cache events.

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 test parse-events: Remove cpu PMU requirement</title>
<updated>2025-10-15T14:59:11+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-10-05T18:24:26+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d47c65eea8acd13a32a8d0caa3bae9a611b09ac8'/>
<id>urn:sha1:d47c65eea8acd13a32a8d0caa3bae9a611b09ac8</id>
<content type='text'>
In the event parse string, switch "cpu" to "default_core" and then
rewrite this to the first core PMU name prior to parsing. This enables
testing with a PMU on hybrid x86 and other systems that don't use
"cpu" for the core PMU name. The name "default_core" is already used
by jevents. Update test expectations to match.

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 test parse-events: Without a PMU use cpu-cycles rather than cycles</title>
<updated>2025-10-15T14:59:11+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-10-05T18:24:25+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2e6dc3b9334cd0d404591009b3d9957edcf2f6cf'/>
<id>urn:sha1:2e6dc3b9334cd0d404591009b3d9957edcf2f6cf</id>
<content type='text'>
Without a PMU perf matches an event against any PMU with the
event. Unfortunately some PMU drivers advertise a "cycles" event which
is typically just a core event. Switch to using "cpu-cycles" which is
an indentical legacy event but avoids the multiple PMU confusion
introduced by the PMU drivers. Note, on x86 cpu-cycles is also a sysfs
event but cycles isn't.

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 test parse-events: Use evsel__match for legacy events</title>
<updated>2025-10-15T14:59:11+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-10-05T18:24:24+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ecfcc6a825dfacdb4f3cf38fe4b463396fa0d029'/>
<id>urn:sha1:ecfcc6a825dfacdb4f3cf38fe4b463396fa0d029</id>
<content type='text'>
Switch from the test's assert_hw/test_config to the common
evsel__match code that appropriately handles events with both legacy
and sysfs/json encoding.

For tests asserting that a config value matches that placed in the
perf_event_attr just directly compare the config values.

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>
</feed>
