Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf python: Add evlist close support

Add support for the evlist close function.

Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250519195148.1708988-7-irogers@google.com
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Gautam Menghani and committed by
Arnaldo Carvalho de Melo
aa684837 739621f6

+16
+16
tools/perf/util/python.c
··· 1210 1210 return Py_None; 1211 1211 } 1212 1212 1213 + static PyObject *pyrf_evlist__close(struct pyrf_evlist *pevlist) 1214 + { 1215 + struct evlist *evlist = &pevlist->evlist; 1216 + 1217 + evlist__close(evlist); 1218 + 1219 + Py_INCREF(Py_None); 1220 + return Py_None; 1221 + } 1222 + 1213 1223 static PyObject *pyrf_evlist__config(struct pyrf_evlist *pevlist) 1214 1224 { 1215 1225 struct record_opts opts = { ··· 1277 1267 .ml_meth = (PyCFunction)pyrf_evlist__open, 1278 1268 .ml_flags = METH_VARARGS | METH_KEYWORDS, 1279 1269 .ml_doc = PyDoc_STR("open the file descriptors.") 1270 + }, 1271 + { 1272 + .ml_name = "close", 1273 + .ml_meth = (PyCFunction)pyrf_evlist__close, 1274 + .ml_flags = METH_NOARGS, 1275 + .ml_doc = PyDoc_STR("close the file descriptors.") 1280 1276 }, 1281 1277 { 1282 1278 .ml_name = "poll",