<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/perf/util/python.c, branch linux-6.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.17.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.17.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2025-07-30T17:15:17Z</updated>
<entry>
<title>perf python: Stop using deprecated PyUnicode_AsString()</title>
<updated>2025-07-30T17:15:17Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@kernel.org</email>
</author>
<published>2025-07-30T13:34:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=59edbec7a5c70af6c0058e32eb3750bfb8928d7b'/>
<id>urn:sha1:59edbec7a5c70af6c0058e32eb3750bfb8928d7b</id>
<content type='text'>
As noticed while building for Fedora 43:

    GEN     /tmp/build/perf/python/perf.cpython-314-x86_64-linux-gnu.so
  /git/perf-6.16.0-rc3/tools/perf/util/python.c: In function ‘get_tracepoint_field’:
  /git/perf-6.16.0-rc3/tools/perf/util/python.c:340:9: error: ‘_PyUnicode_AsString’ is deprecated [-Werror=deprecated-declarations]
    340 |         const char *str = _PyUnicode_AsString(PyObject_Str(attr_name));
        |         ^~~~~
  In file included from /usr/include/python3.14/unicodeobject.h:1022,
                   from /usr/include/python3.14/Python.h:89,
                   from /git/perf-6.16.0-rc3/tools/perf/util/python.c:2:
  /usr/include/python3.14/cpython/unicodeobject.h:648:1: note: declared here
    648 | _PyUnicode_AsString(PyObject *unicode)
        | ^~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors
  error: command '/usr/bin/gcc' failed with exit code 1

Use PyUnicode_AsUTF8() instead and also check if PyObject_Str() fails
before doing so.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Link: https://lore.kernel.org/r/aIofXNK8QLtLIaI3@x1
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf python: Set index error for invalid thread/cpu map items</title>
<updated>2025-07-11T19:36:40Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-07-10T23:51:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b4aff7ed7a4c1360e8b29d545c7bc9e05af1a995'/>
<id>urn:sha1:b4aff7ed7a4c1360e8b29d545c7bc9e05af1a995</id>
<content type='text'>
Returning NULL for out of bound CPU or thread map items causes
internal errors. Fix by correctly setting the error to be an index
error.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/20250710235126.1086011-14-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf python: Improve leader copying from evlist</title>
<updated>2025-07-11T19:36:40Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-07-10T23:51:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=421c5f39adcdf292ca5c7162f40ed6d120d136a8'/>
<id>urn:sha1:421c5f39adcdf292ca5c7162f40ed6d120d136a8</id>
<content type='text'>
The struct pyrf_evlist embeds the evlist requiring the copying from
things like parsed events. The copying logic handles the leader being
the event itself, but if the leader group event is a different in the
list it will cause an evsel to point to the evsel in the list that was
copied from which is bad. Fix this by adding another pass over the
evlist rewriting leaders, simplified by the introductin of two evlist
helpers.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/20250710235126.1086011-13-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf python: Correct pyrf_evsel__read for tool PMUs</title>
<updated>2025-07-11T19:36:40Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-07-10T23:51:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6183afcba9c1c810656ddb36170106aaf3cf778c'/>
<id>urn:sha1:6183afcba9c1c810656ddb36170106aaf3cf778c</id>
<content type='text'>
Tool PMUs assume that stat's process_counter_values is being used to
read the counters. Specifically they hold onto old values in
evsel-&gt;prev_raw_counts and give the cumulative count based off of this
value. Update pyrf_evsel__read to allocate counts and prev_raw_counts,
use evsel__read_counter rather than perf_evsel__read so tool PMUs are
read from not just perf_event_open events, make the returned
pyrf_counts_values contain the delta value rather than the cumulative
value.

Fixes: 739621f65702 ("perf python: Add evsel read method")
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/20250710235126.1086011-12-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf python: Fix thread check in pyrf_evsel__read</title>
<updated>2025-07-11T19:36:40Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-07-10T23:51:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=64ec9b997f3a9462901a404ad60f452f76dd2d6e'/>
<id>urn:sha1:64ec9b997f3a9462901a404ad60f452f76dd2d6e</id>
<content type='text'>
The CPU index is incorrectly checked rather than the thread index.

Fixes: 739621f65702 ("perf python: Add evsel read method")
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/20250710235126.1086011-11-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf python: In str(evsel) use the evsel__pmu_name helper</title>
<updated>2025-07-11T19:36:40Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-07-10T23:51:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7d5b635d9f4314c93bc1f9828f5d757decb860bc'/>
<id>urn:sha1:7d5b635d9f4314c93bc1f9828f5d757decb860bc</id>
<content type='text'>
The evsel__pmu_name helper will internally use evsel__find_pmu that
handles legacy events, extended types, etc. in determining a PMU and
will provide a better value than just trying to access the PMU's name
directly as the PMU may not have been computed.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/20250710235126.1086011-10-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf stat: Move metric list from config to evlist</title>
<updated>2025-07-11T19:36:40Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-07-10T23:51:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=faebee18d720d9e209946ece3e468c06cf13f5ec'/>
<id>urn:sha1:faebee18d720d9e209946ece3e468c06cf13f5ec</id>
<content type='text'>
The rblist of metric_event that then have a list of associated
metric_expr is moved out of the stat_config and into the evlist. This
is done as part of refactoring things for python, having the state
split in two places complicates that implementation. The evlist is
doing the harder work of enabling and disabling events, the metrics
are needed to compute a value and it doesn't seem unreasonable to hang
them from the evlist.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/20250710235126.1086011-7-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf thread_map: Remove uid options</title>
<updated>2025-06-09T18:18:18Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2025-06-04T17:45:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5128492b2b6bb3a2881e135da54fd8e224a5f610'/>
<id>urn:sha1:5128492b2b6bb3a2881e135da54fd8e224a5f610</id>
<content type='text'>
Now the target doesn't have a uid, it is handled through BPF filters,
remove the uid options to thread_map creation. Tidy up the functions
used in tests to avoid passing unused arguments.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/20250604174545.2853620-11-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf python: Add evlist close support</title>
<updated>2025-05-23T01:24:58Z</updated>
<author>
<name>Gautam Menghani</name>
<email>gautam@linux.ibm.com</email>
</author>
<published>2025-05-19T19:51:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=aa6848374023ea14664e6812e0f64e1a28044936'/>
<id>urn:sha1:aa6848374023ea14664e6812e0f64e1a28044936</id>
<content type='text'>
Add support for the evlist close function.

Signed-off-by: Gautam Menghani &lt;gautam@linux.ibm.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Howard Chu &lt;howardchu95@gmail.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: Madhavan Srinivasan &lt;maddy@linux.ibm.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/20250519195148.1708988-7-irogers@google.com
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf python: Add evsel read method</title>
<updated>2025-05-23T01:24:58Z</updated>
<author>
<name>Gautam Menghani</name>
<email>gautam@linux.ibm.com</email>
</author>
<published>2025-05-19T19:51:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=739621f65702d532527aec124b0818d3a1521b5e'/>
<id>urn:sha1:739621f65702d532527aec124b0818d3a1521b5e</id>
<content type='text'>
Add the evsel read method to enable python to read counter data for the
given evsel.

Signed-off-by: Gautam Menghani &lt;gautam@linux.ibm.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Howard Chu &lt;howardchu95@gmail.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: Madhavan Srinivasan &lt;maddy@linux.ibm.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/linux-perf-users/20250512055748.479786-1-gautam@linux.ibm.com/
Link: https://lore.kernel.org/r/20250519195148.1708988-6-irogers@google.com
[ make the API take a CPU and thread then compute from these the appropriate indices. ]
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
