linux-stable/tools/perf
Milian Wolff 5ea0416f51 perf report: Include partial stacks unwound with libdw
So far the whole stack was thrown away when any error occurred before
the maximum stack depth was unwound. This is actually a very common
scenario though. The stacks that got unwound so far are still
interesting. This removes a large chunk of differences when comparing
perf script output for libunwind and libdw perf unwinding.

E.g. with libunwind:

~~~~~
heaptrack_gui  2228 135073.388524:     479408 cycles:
        ffffffff811749ed perf_iterate_ctx ([kernel.kallsyms])
        ffffffff81181662 perf_event_mmap ([kernel.kallsyms])
        ffffffff811cf5ed mmap_region ([kernel.kallsyms])
        ffffffff811cfe6b do_mmap ([kernel.kallsyms])
        ffffffff811b0dca vm_mmap_pgoff ([kernel.kallsyms])
        ffffffff811cdb0c sys_mmap_pgoff ([kernel.kallsyms])
        ffffffff81033acb sys_mmap ([kernel.kallsyms])
        ffffffff81631d37 entry_SYSCALL_64_fastpath ([kernel.kallsyms])
                   192ca mmap64 (/usr/lib/ld-2.25.so)
                    59a9 _dl_map_object_from_fd (/usr/lib/ld-2.25.so)
                    83d0 _dl_map_object (/usr/lib/ld-2.25.so)
                    cda1 openaux (/usr/lib/ld-2.25.so)
                   1834f _dl_catch_error (/usr/lib/ld-2.25.so)
                    cfe2 _dl_map_object_deps (/usr/lib/ld-2.25.so)
                    3481 dl_main (/usr/lib/ld-2.25.so)
                   17387 _dl_sysdep_start (/usr/lib/ld-2.25.so)
                    4d37 _dl_start (/usr/lib/ld-2.25.so)
                     d87 _start (/usr/lib/ld-2.25.so)

heaptrack_gui  2228 135073.388677:     611329 cycles:
                   1a3e0 strcmp (/usr/lib/ld-2.25.so)
                    82b2 _dl_map_object (/usr/lib/ld-2.25.so)
                    cda1 openaux (/usr/lib/ld-2.25.so)
                   1834f _dl_catch_error (/usr/lib/ld-2.25.so)
                    cfe2 _dl_map_object_deps (/usr/lib/ld-2.25.so)
                    3481 dl_main (/usr/lib/ld-2.25.so)
                   17387 _dl_sysdep_start (/usr/lib/ld-2.25.so)
                    4d37 _dl_start (/usr/lib/ld-2.25.so)
                     d87 _start (/usr/lib/ld-2.25.so)
~~~~~

With libdw without this patch:

~~~~~
heaptrack_gui  2228 135073.388524:     479408 cycles:
        ffffffff811749ed perf_iterate_ctx ([kernel.kallsyms])
        ffffffff81181662 perf_event_mmap ([kernel.kallsyms])
        ffffffff811cf5ed mmap_region ([kernel.kallsyms])
        ffffffff811cfe6b do_mmap ([kernel.kallsyms])
        ffffffff811b0dca vm_mmap_pgoff ([kernel.kallsyms])
        ffffffff811cdb0c sys_mmap_pgoff ([kernel.kallsyms])
        ffffffff81033acb sys_mmap ([kernel.kallsyms])
        ffffffff81631d37 entry_SYSCALL_64_fastpath ([kernel.kallsyms])

heaptrack_gui  2228 135073.388677:     611329 cycles:
~~~~~

With this patch applied, the libdw unwinder will produce the same
output as the libunwind unwinder.

Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20170601210021.20046-1-milian.wolff@kdab.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-06-05 14:18:03 -03:00
..
arch perf annotate: Add missing powerpc triplet 2017-06-05 14:18:02 -03:00
bench perf tools: Move extra string util functions to util/string2.h 2017-04-19 13:01:51 -03:00
Documentation perf script: Add --inline option for debugging 2017-05-24 08:41:48 +02:00
jvmti perf kvmti: Remove unused Makefile file 2016-11-14 12:42:56 -03:00
pmu-events perf vendor events intel: Add missing space in json descriptions 2017-03-30 13:35:50 -07:00
python
scripts
tests perf test: Disable breakpoint signal tests for powerpc 2017-06-05 14:18:01 -03:00
trace perf tools: Add signal.h to places using its definitions 2017-04-20 13:22:43 -03:00
ui perf tools: Put caller above callee in --children mode 2017-05-24 08:41:49 +02:00
util perf report: Include partial stacks unwound with libdw 2017-06-05 14:18:03 -03:00
.gitignore perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git 2017-03-13 10:59:36 -03:00
Build perf trace: Beautify statx syscall 'flag' and 'mask' arguments 2017-03-31 14:42:31 -03:00
builtin-annotate.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-bench.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-buildid-cache.c perf symbols: Accept symbols starting at address 0 2017-05-02 18:23:04 -03:00
builtin-buildid-list.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-c2c.c perf tools: Move event prototypes from util.h to event.h 2017-04-25 15:30:47 -03:00
builtin-config.c perf config: Refactor a duplicated code for obtaining config file name 2017-05-02 18:23:12 -03:00
builtin-data.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-diff.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-evlist.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-ftrace.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-help.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
builtin-inject.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-kallsyms.c perf tools: Including missing inttypes.h header 2017-04-19 13:01:46 -03:00
builtin-kmem.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-kvm.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-list.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-lock.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-mem.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-probe.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2017-05-02 19:09:35 -07:00
builtin-record.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-report.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
builtin-sched.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-script.c perf script: Add --inline option for debugging 2017-05-24 08:41:48 +02:00
builtin-stat.c perf stat: Only print NMI watchdog hint when enabled 2017-06-02 11:15:34 -03:00
builtin-timechart.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-top.c perf tools: Move event prototypes from util.h to event.h 2017-04-25 15:30:47 -03:00
builtin-trace.c perf trace: Add mmap alias for s390 2017-06-01 10:13:21 -03:00
builtin-version.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
builtin.h perf tools: Remove stale prototypes from builtin.h 2017-04-24 13:43:33 -03:00
check-headers.sh tools include uapi: Grab copies of stat.h and fcntl.h 2017-03-31 11:26:03 -03:00
command-list.txt perf tools: Missing c2c command in command-list 2017-03-13 10:59:31 -03:00
CREDITS
design.txt
Makefile
Makefile.config perf tools: Disable JVMTI if no ELF support available 2017-04-13 11:47:43 -03:00
Makefile.perf perf build: Add special fixdep cleaning rule 2017-02-17 16:04:38 -03:00
MANIFEST tools include: Introduce linux/bug.h, from the kernel sources 2017-04-19 13:01:42 -03:00
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h perf powerpc: Fix build-test failure 2016-09-08 13:44:07 -03:00
perf-with-kcore.sh
perf.c perf tools: Move event prototypes from util.h to event.h 2017-04-25 15:30:47 -03:00
perf.h perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info 2017-03-14 11:38:23 -03:00