<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/perf/tests/tool_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-04-10T12:41:45Z</updated>
<entry>
<title>perf tests: Fix Tool PMU test segfault</title>
<updated>2025-04-10T12:41:45Z</updated>
<author>
<name>James Clark</name>
<email>james.clark@linaro.org</email>
</author>
<published>2025-02-12T16:38:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b7b7986a18ac726dc2a1989f997799c0f94e7da6'/>
<id>urn:sha1:b7b7986a18ac726dc2a1989f997799c0f94e7da6</id>
<content type='text'>
[ Upstream commit 615ec00b06f78912c370b372426190768402a5b9 ]

tool_pmu__event_to_str() now handles skipped events by returning NULL,
so it's wrong to re-check for a skip on the resulting string. Calling
tool_pmu__skip_event() with a NULL string results in a segfault so
remove the unnecessary skip to fix it:

  $ perf test -vv "parsing with PMU name"

  12.2: Parsing with PMU name:
  ...
  ---- unexpected signal (11) ----
  12.2: Parsing with PMU name         : FAILED!

Fixes: ee8aef2d2321 ("perf tools: Add skip check in tool_pmu__event_to_str()")
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Reported-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Acked-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Tested-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/20250212163859.1489916-1-james.clark@linaro.org
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf test: Add missing __exit calls in tool/hwmon tests</title>
<updated>2024-11-16T19:30:40Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-11-15T20:12:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=db26a8c9e3c285092ed3e14a33755582c04e0269'/>
<id>urn:sha1:db26a8c9e3c285092ed3e14a33755582c04e0269</id>
<content type='text'>
Address sanitizer flagged the missing parse_events_error__exit when
testing on ARM.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.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;
Link: https://lore.kernel.org/r/20241115201258.509477-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/perf/tests: Remove duplicate evlist__delete in tests/tool_pmu.c</title>
<updated>2024-10-14T17:29:55Z</updated>
<author>
<name>Athira Rajeev</name>
<email>atrajeev@linux.vnet.ibm.com</email>
</author>
<published>2024-10-13T17:07:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9ea671d1b2d5962368b94b28507ae65f94c86fb3'/>
<id>urn:sha1:9ea671d1b2d5962368b94b28507ae65f94c86fb3</id>
<content type='text'>
The testcase for tool_pmu failed in powerpc as below:

 ./perf test -v "Parsing without PMU name"
  8: Tool PMU                                                        :
  8.1: Parsing without PMU name                                      : FAILED!

This happens when parse_events results in either skip or fail
of an event. Because the code invokes evlist__delete(evlist)
and "goto out".

	ret = parse_events(evlist, str, &amp;err);
	if (ret) {
		 evlist__delete(evlist);

But in the "out" section also evlist__delete happens.

	out:
        evlist__delete(evlist);
        return ret;

Hence remove the duplicate evlist__delete from the first path
in the testcase

With the change:
	# ./perf test -v "Parsing without PMU name"
	  8: Tool PMU                                                        :
	  8.1: Parsing without PMU name                                      : Ok

Signed-off-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Cc: akanksha@linux.ibm.com
Cc: hbathini@linux.ibm.com
Cc: kjain@linux.ibm.com
Cc: maddy@linux.ibm.com
Cc: disgoel@linux.vnet.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20241013170732.71339-1-atrajeev@linux.vnet.ibm.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/perf/tests: Fix compilation error with strncpy in tests/tool_pmu</title>
<updated>2024-10-14T17:29:14Z</updated>
<author>
<name>Athira Rajeev</name>
<email>atrajeev@linux.vnet.ibm.com</email>
</author>
<published>2024-10-13T17:37:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d94d86cee1032bbf429d5bd0914b064e03b56f0e'/>
<id>urn:sha1:d94d86cee1032bbf429d5bd0914b064e03b56f0e</id>
<content type='text'>
perf fails to compile on systems with GCC version11
as below:

In file included from /usr/include/string.h:519,
                 from /home/athir/perf-tools-next/tools/include/linux/bitmap.h:5,
                 from /home/athir/perf-tools-next/tools/perf/util/pmu.h:5,
                 from /home/athir/perf-tools-next/tools/perf/util/evsel.h:14,
                 from /home/athir/perf-tools-next/tools/perf/util/evlist.h:14,
                 from tests/tool_pmu.c:3:
In function ‘strncpy’,
    inlined from ‘do_test’ at tests/tool_pmu.c:25:3:
/usr/include/bits/string_fortified.h:95:10: error: ‘__builtin_strncpy’ specified bound 128 equals destination size [-Werror=stringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~

The compile error is from strncpy refernce in do_test:
	strncpy(str, tool_pmu__event_to_str(ev), sizeof(str));

This behaviour is not observed with GCC version 8, but observed
with GCC version 11 . This is message from gcc for detecting
truncation while using strncpu. Use snprintf instead of strncpy
here to be safe.

Signed-off-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Cc: akanksha@linux.ibm.com
Cc: hbathini@linux.ibm.com
Cc: kjain@linux.ibm.com
Cc: maddy@linux.ibm.com
Cc: disgoel@linux.vnet.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20241013173742.71882-1-atrajeev@linux.vnet.ibm.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tests: Add tool PMU test</title>
<updated>2024-10-11T06:41:13Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-10-02T03:20:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8c25df7af322040fdf5041e912af7cc810b0f86d'/>
<id>urn:sha1:8c25df7af322040fdf5041e912af7cc810b0f86d</id>
<content type='text'>
Ensure parsing with and without PMU creates events with the expected
config values. This ensures the tool.json doesn't get out of sync with
tool_pmu_event enum.

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-11-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
</feed>
