Skip to content

Commit aa68483

Browse files
Gautam Menghaniacmel
authored andcommitted
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>
1 parent 739621f commit aa68483

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tools/perf/util/python.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,16 @@ static PyObject *pyrf_evlist__open(struct pyrf_evlist *pevlist,
12101210
return Py_None;
12111211
}
12121212

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+
12131223
static PyObject *pyrf_evlist__config(struct pyrf_evlist *pevlist)
12141224
{
12151225
struct record_opts opts = {
@@ -1268,6 +1278,12 @@ static PyMethodDef pyrf_evlist__methods[] = {
12681278
.ml_flags = METH_VARARGS | METH_KEYWORDS,
12691279
.ml_doc = PyDoc_STR("open the file descriptors.")
12701280
},
1281+
{
1282+
.ml_name = "close",
1283+
.ml_meth = (PyCFunction)pyrf_evlist__close,
1284+
.ml_flags = METH_NOARGS,
1285+
.ml_doc = PyDoc_STR("close the file descriptors.")
1286+
},
12711287
{
12721288
.ml_name = "poll",
12731289
.ml_meth = (PyCFunction)pyrf_evlist__poll,

0 commit comments

Comments
 (0)