libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [PATCH 0/8] libunwind accuracy improvements for x86-64


From: Lassi Tuura
Subject: [Libunwind-devel] [PATCH 0/8] libunwind accuracy improvements for x86-64
Date: Tue, 20 Apr 2010 23:13:02 +0200

These patches improve tracing accuracy for x86-64.  Without these
patches libunwind loses ~10% of samples in signal-based profiling, as
discussed in: http://thread.gmane.org/gmane.comp.lib.unwind.devel/574

The patches have been tested on RHEL5-based system.  2349 incomplete
stack traces are reduced to 985 when profiling at 6ms interval for 80
seconds an application of ours.  Of the difference 992 is due improved
signal frame handling and next/previous instruction selection, and the
rest (373) due to ability to trace through PLT entries.

As far as I can tell the remaining inaccuracies are known issues with
missing (global ctors and virtual thunks) or inaccurate unwind info
(function epilogues). These need to be fixed in the compiler; I'll
check soon just how much GCC 4.5 fixed of this.

The patches do not introduce any new failures on x86-64, but do not
remove any existing failures either.  Note that run-ptrace-misc test
will typically show more failure - I typically get 5 instead of 1 bad
address complaint - but as far as I was able to work out all the
failures are legitimate and due to inaccurate epilogue unwind info.

---

Lassi Tuura (8):
     Use wider format when printing addresses in debug format.
     Always validate all addresses.
     Identify signal frames by augmentation attribute.
     Identify end-of-stack by undefined return address location.
     Correct choice of next or previous instruction.
     Recognise and unwind through PLT.
     Remove obsolete code for 'old way' of handling x86-64 signal frames.
     Detect end of stack in x86-64 rbp-based walk.


include/dwarf.h                   |    3 +
include/tdep-arm/libunwind_i.h    |    3 +
include/tdep-hppa/libunwind_i.h   |    3 +
include/tdep-ia64/libunwind_i.h   |    3 +
include/tdep-mips/libunwind_i.h   |    3 +
include/tdep-ppc32/libunwind_i.h  |    3 +
include/tdep-ppc64/libunwind_i.h  |    3 +
include/tdep-x86/libunwind_i.h    |    3 +
include/tdep-x86_64/libunwind_i.h |   18 ++++++
src/arm/Ginit_local.c             |    2 -
src/arm/Ginit_remote.c            |    2 -
src/arm/init.h                    |    3 +
src/dwarf/Gfde.c                  |    5 +-
src/dwarf/Gfind_proc_info-lsb.c   |   20 +++---
src/dwarf/Gparser.c               |   62 +++++++++++++++++---
src/hppa/Ginit_local.c            |    2 -
src/hppa/Ginit_remote.c           |    2 -
src/hppa/init.h                   |    4 +
src/mips/Ginit_local.c            |    2 -
src/mips/Ginit_remote.c           |    2 -
src/mips/init.h                   |    3 +
src/ppc/Ginit_local.c             |    4 +
src/ppc/Ginit_remote.c            |    4 +
src/ppc32/init.h                  |    3 +
src/ppc64/init.h                  |    3 +
src/x86/Ginit_local.c             |    2 -
src/x86/Ginit_remote.c            |    2 -
src/x86/init.h                    |    3 +
src/x86_64/Ginit_local.c          |    4 +
src/x86_64/Ginit_remote.c         |    2 -
src/x86_64/Gos-linux.c            |  117 +++++++++++++++++++------------------
src/x86_64/Gstep.c                |   45 +++++++++++++-
src/x86_64/init.h                 |    3 +
33 files changed, 240 insertions(+), 103 deletions(-)

-- 
Signature





reply via email to

[Prev in Thread] Current Thread [Next in Thread]