mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
perf evsel: Fix use of inherit
perf stat doesn't mmap and its perfectly fine for it to use task-bound counters with inheritance. So set the attr.inherit on the caller and leave the syscall itself to validate it. When the mmap fails perf_evlist__mmap will just emit a warning if this is the failure reason. Reported-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> Link: http://lkml.kernel.org/r/20110414170121.GC3229@ghostprotocols.net Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
db9a9cbc81
commit
5d2cd90922
8 changed files with 42 additions and 43 deletions
|
@ -498,11 +498,11 @@ static PyObject *pyrf_evsel__open(struct pyrf_evsel *pevsel,
|
|||
struct cpu_map *cpus = NULL;
|
||||
struct thread_map *threads = NULL;
|
||||
PyObject *pcpus = NULL, *pthreads = NULL;
|
||||
int group = 0, overwrite = 0;
|
||||
static char *kwlist[] = {"cpus", "threads", "group", "overwrite", NULL, NULL};
|
||||
int group = 0, inherit = 0;
|
||||
static char *kwlist[] = {"cpus", "threads", "group", "inherit", NULL, NULL};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOii", kwlist,
|
||||
&pcpus, &pthreads, &group, &overwrite))
|
||||
&pcpus, &pthreads, &group, &inherit))
|
||||
return NULL;
|
||||
|
||||
if (pthreads != NULL)
|
||||
|
@ -511,7 +511,8 @@ static PyObject *pyrf_evsel__open(struct pyrf_evsel *pevsel,
|
|||
if (pcpus != NULL)
|
||||
cpus = ((struct pyrf_cpu_map *)pcpus)->cpus;
|
||||
|
||||
if (perf_evsel__open(evsel, cpus, threads, group, overwrite) < 0) {
|
||||
evsel->attr.inherit = inherit;
|
||||
if (perf_evsel__open(evsel, cpus, threads, group) < 0) {
|
||||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue