diff options
author | Ingo Molnar <mingo@kernel.org> | 2018-08-23 10:29:19 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-08-23 10:29:19 +0200 |
commit | 66e5db4a1ccc64f278653bc69dc406d184dc750a (patch) | |
tree | 962c9c7debae59ced3401c38d6894d620f68693b /tools/perf/util/python.c | |
parent | 5804b11034a21e4287daaf017c5ad60ad7af8d67 (diff) | |
parent | 78303650e4cd873c6c4276c6fe3e768ff0b46d22 (diff) |
Merge tag 'perf-core-for-mingo-4.19-20180820' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
LLVM/clang/eBPF: (Arnaldo Carvalho de Melo)
- Allow passing options to llc in addition to to clang.
Hardware tracing: (Jack Henschel)
- Improve error message for PMU address filters, clarifying availability of
that feature in hardware having hardware tracing such as Intel PT.
Python interface: (Jiri Olsa)
- Fix read_on_cpu() interface.
ELF/DWARF libraries: (Jiri Olsa)
- Fix handling of the combo compressed module file + decompressed associated
debuginfo file.
Build (Rasmus Villemoes)
- Disable parallelism for 'make clean', avoiding multiple submakes deleting
the same files and causing the build to fail on systems such as Yocto.
Kernel ABI copies: (Arnaldo Carvalho de Melo)
- Update tools's copy of x86's cpufeatures.h.
- Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy'.
Miscellaneous: (Steven Rostedt)
- Change libtraceevent to SPDX License format.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/python.c')
-rw-r--r-- | tools/perf/util/python.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index f74fbb652a4f..ce501ba14b08 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -11,6 +11,7 @@ #include "cpumap.h" #include "print_binary.h" #include "thread_map.h" +#include "mmap.h" #if PY_MAJOR_VERSION < 3 #define _PyUnicode_FromString(arg) \ @@ -976,6 +977,20 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist, return Py_BuildValue("i", evlist->nr_entries); } +static struct perf_mmap *get_md(struct perf_evlist *evlist, int cpu) +{ + int i; + + for (i = 0; i < evlist->nr_mmaps; i++) { + struct perf_mmap *md = &evlist->mmap[i]; + + if (md->cpu == cpu) + return md; + } + + return NULL; +} + static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist, PyObject *args, PyObject *kwargs) { @@ -990,7 +1005,10 @@ static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist, &cpu, &sample_id_all)) return NULL; - md = &evlist->mmap[cpu]; + md = get_md(evlist, cpu); + if (!md) + return NULL; + if (perf_mmap__read_init(md) < 0) goto end; |