lkml.org 
[lkml]   [2022]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] perf python: Fix cpu_map__item building
Em Fri, Jan 21, 2022 at 08:58:09PM -0800, Ian Rogers escreveu:
> Value should be built as an integer.
> Switch some uses of perf_cpu_map to use the library API.
>
> Fixes: 6d18804b963b ("perf cpumap: Give CPUs their own type")
> Signed-off-by: Ian Rogers <irogers@google.com>

Thanks, applied.

- Arnaldo

> ---
> tools/perf/util/python.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
> index f3e5131f183c..52d8995cfd73 100644
> --- a/tools/perf/util/python.c
> +++ b/tools/perf/util/python.c
> @@ -638,17 +638,17 @@ static Py_ssize_t pyrf_cpu_map__length(PyObject *obj)
> {
> struct pyrf_cpu_map *pcpus = (void *)obj;
>
> - return pcpus->cpus->nr;
> + return perf_cpu_map__nr(pcpus->cpus);
> }
>
> static PyObject *pyrf_cpu_map__item(PyObject *obj, Py_ssize_t i)
> {
> struct pyrf_cpu_map *pcpus = (void *)obj;
>
> - if (i >= pcpus->cpus->nr)
> + if (i >= perf_cpu_map__nr(pcpus->cpus))
> return NULL;
>
> - return Py_BuildValue("i", pcpus->cpus->map[i]);
> + return Py_BuildValue("i", perf_cpu_map__cpu(pcpus->cpus, i).cpu);
> }
>
> static PySequenceMethods pyrf_cpu_map__sequence_methods = {
> --
> 2.35.0.rc0.227.g00780c9af4-goog

--

- Arnaldo

\
 
 \ /
  Last update: 2022-01-22 21:11    [W:0.047 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site