diff options
Diffstat (limited to 'tools/perf/util/python.c')
-rw-r--r-- | tools/perf/util/python.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 0688bfb6d280..f5bba4b8eb9e 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c | |||
@@ -627,7 +627,7 @@ static PyObject *pyrf_evsel__open(struct pyrf_evsel *pevsel, | |||
627 | * This will group just the fds for this single evsel, to group | 627 | * This will group just the fds for this single evsel, to group |
628 | * multiple events, use evlist.open(). | 628 | * multiple events, use evlist.open(). |
629 | */ | 629 | */ |
630 | if (perf_evsel__open(evsel, cpus, threads, group, NULL) < 0) { | 630 | if (perf_evsel__open(evsel, cpus, threads) < 0) { |
631 | PyErr_SetFromErrno(PyExc_OSError); | 631 | PyErr_SetFromErrno(PyExc_OSError); |
632 | return NULL; | 632 | return NULL; |
633 | } | 633 | } |
@@ -824,7 +824,10 @@ static PyObject *pyrf_evlist__open(struct pyrf_evlist *pevlist, | |||
824 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOii", kwlist, &group)) | 824 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOii", kwlist, &group)) |
825 | return NULL; | 825 | return NULL; |
826 | 826 | ||
827 | if (perf_evlist__open(evlist, group) < 0) { | 827 | if (group) |
828 | perf_evlist__group(evlist); | ||
829 | |||
830 | if (perf_evlist__open(evlist) < 0) { | ||
828 | PyErr_SetFromErrno(PyExc_OSError); | 831 | PyErr_SetFromErrno(PyExc_OSError); |
829 | return NULL; | 832 | return NULL; |
830 | } | 833 | } |