linux_dsm_epyc7002/tools/perf
He Kuang 76c588f1f6 perf tools: Find right DSO taking into account if binary is 32 or 64-bit
There's a problem in machine__findnew_vdso(), vdso buildid generated by a
32-bit machine stores it with the name 'vdso', but when processing buildid on a
64-bit machine with the same 'perf.data', perf will search for vdso named as
'vdso32' and get failed.

This patch tries to find the existing dsos in machine->dsos by thread dso_type.
64-bit thread tries to find vdso with name 'vdso', because all 64-bit vdso is
named as that. 32-bit thread first tries to find vdso with name 'vdso32' if
this thread was run on 64-bit machine, if failed, then it tries 'vdso' which
indicates that the thread was run on 32-bit machine when recording.

Committer note:

Additional explanation by Adrian Hunter:

We match maps to builds ids using the file name - consider
machine__findnew_[v]dso() called in map__new().  So in the context of a perf
data file, we consider the file name to be unique.

A vdso map does not have a file name - all we know is that it is vdso.  We look
at the thread to tell if it is 32-bit, 64-bit or x32.  Then we need to get the
build id which has been recorded using short name "[vdso]" or "[vdso32]" or
"[vdsox32]".

The problem is that on a 32-bit machine, we use the name "[vdso]".  If you take
a 32-bit perf data file to a 64-bit machine, it gets hard to figure out if
"[vdso]" is 32-bit or 64-bit.

This patch solves that problem.

 ----

This also merges a followup patch fixing a problem introduced by the
original submission of this patch, that would crash 'perf record' when
recording samples for a 32-bit app on a 64-bit system.

Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1463475894-163531-1-git-send-email-hekuang@huawei.com
Link: http://lkml.kernel.org/r/1466578626-92406-6-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-06-23 10:25:58 -03:00
..
arch perf tests time-to-tsc: No need to disable an event before deleting it 2016-06-22 10:10:52 -03:00
bench
config kbuild: List libelf-devel as an alternative 2016-06-21 13:18:32 -03:00
Documentation perf record: Add --dry-run option to check cmdline options 2016-06-21 13:18:35 -03:00
jvmti
python
scripts perf script stackcollapse: Remove reference to the perl interpreter 2016-06-22 09:56:34 -03:00
tests perf evlist: Destructors should accept NULL 2016-06-22 10:01:48 -03:00
trace perf trace: Move seccomp args beautifiers to tools/perf/trace/beauty/ 2016-05-11 13:06:00 -03:00
ui perf config: Move config declarations from util/cache.h to util/config.h 2016-06-23 08:51:41 -03:00
util perf tools: Find right DSO taking into account if binary is 32 or 64-bit 2016-06-23 10:25:58 -03:00
.gitignore perf tools: Add arch/*/include/generated/ to .gitignore 2016-05-30 12:41:46 -03:00
Build
builtin-annotate.c perf hists: Rename __hists__add_entry to hists__add_entry 2016-06-21 13:18:33 -03:00
builtin-bench.c
builtin-buildid-cache.c perf session: Destructors should accept NULL 2016-06-22 10:02:16 -03:00
builtin-buildid-list.c
builtin-config.c
builtin-data.c
builtin-diff.c perf session: Destructors should accept NULL 2016-06-22 10:02:16 -03:00
builtin-evlist.c
builtin-help.c perf config: Move config declarations from util/cache.h to util/config.h 2016-06-23 08:51:41 -03:00
builtin-inject.c
builtin-kmem.c perf config: Move config declarations from util/cache.h to util/config.h 2016-06-23 08:51:41 -03:00
builtin-kvm.c perf session: Destructors should accept NULL 2016-06-22 10:02:16 -03:00
builtin-list.c
builtin-lock.c
builtin-mem.c perf mem: Add --ldlat option 2016-06-15 10:35:27 -03:00
builtin-probe.c perf probe: Add --cache option to cache the probe definitions 2016-06-15 14:34:42 -03:00
builtin-record.c perf config: Move config declarations from util/cache.h to util/config.h 2016-06-23 08:51:41 -03:00
builtin-report.c perf config: Move config declarations from util/cache.h to util/config.h 2016-06-23 08:51:41 -03:00
builtin-sched.c
builtin-script.c perf script: Show call graphs when 1st event doesn't have it but some other has 2016-06-03 14:53:46 -03:00
builtin-stat.c perf stat: Add missing aggregation headers for --metric-only CSV 2016-06-06 17:43:12 -03:00
builtin-timechart.c perf tools: Set buildid dir under symfs when --symfs is provided 2016-05-20 11:43:58 -03:00
builtin-top.c perf config: Move config declarations from util/cache.h to util/config.h 2016-06-23 08:51:41 -03:00
builtin-trace.c perf trace: Use the ptr->name beautifier as default for "filename" args 2016-05-23 16:41:00 -03:00
builtin-version.c
builtin.h
command-list.txt
CREDITS
design.txt
Makefile
Makefile.perf perf tools: Let python use correct gcc for build_ext 2016-06-22 16:11:42 -03:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf config: Move config declarations from util/cache.h to util/config.h 2016-06-23 08:51:41 -03:00
perf.h