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 <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Howard Chu <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Madhavan Srinivasan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ian Rogers <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
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)