History log of /external/libunwind/src/x86_64/Gtrace.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
890e23eb9d3ffd9be2a025189a21794b5ed0e0ff 21-Sep-2012 Tommi Rantala <tt.rantala@gmail.com> Prefer NULL over zero
/external/libunwind/src/x86_64/Gtrace.c
aebba1f8a7dee9b9ae3e70128ad48de69ca90b15 21-Sep-2012 Tommi Rantala <tt.rantala@gmail.com> Apply `define_lock()'

We have a nice macro for defining pthread mutexes, use it.
/external/libunwind/src/x86_64/Gtrace.c
52ca68c770e9128940748bab72a5b103057166a8 16-Dec-2011 Arun Sharma <asharma@fb.com> Fix a race condition

There is a window of time between the munmap and the tls_cache being
marked as destroyed, where there could be a bad access to memory that
has been unmapped/freed. Reorder the code a bit to close the window.

Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
/external/libunwind/src/x86_64/Gtrace.c
1010880548589685a27b8f63ef54a3ea78e052fc 28-Nov-2011 Arun Sharma <asharma@fb.com> Address x86_64 crashes when using sigaltstack

The crashes were tracked down to f->rpb_cfa_offset being incorrect.

The problem is that {rsp,rbp}_cfa_offset only have 15 bits, but for
SIGRETURN frame they are filled with:

// src/x86_64/Gstash_frame.c

f->cfa_reg_offset = d->cfa - c->sigcontext_addr;
f->rbp_cfa_offset = DWARF_GET_LOC(d->loc[RBP]) - d->cfa;
f->rsp_cfa_offset = DWARF_GET_LOC(d->loc[RSP]) - d->cfa;

The problem is that the delta here can be arbitrarily large when
sigaltstack is used, and can easily overflow the 15 and 30-bit fields.

When signal handler starts running, the stack layout is:

... higher addresses ...
ucontext
CFA->
__restore_rt (== pretcode in rt_sigframe from
linux-2.6/arch/x86/include/asm/sigframe.h)
SP ->
... sighandler runs on this stack.

... lower addresses ...

This makes it very convenient to find ucontext from the CFA.

Attached patch re-tested on Linux/x86_64, no new failures.

Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
Reviwed-by: Lassi Tuura <lat@cern.ch>
/external/libunwind/src/x86_64/Gtrace.c
0a26727ea2b3b9afd8d019a91777f350d06dd8dc 30-Oct-2011 Arun Sharma <asharma@fb.com> Fix TLS destructor ordering problems

Glibc calls thread-specific dtors in the order in which the keys were added,
so the first dtor is the trace_cache_free() one. Then thread-specific
data for some other key is free()d, which calls into unw_backtrace(),
which uses dangling cache and munmapped cache->frames.

[ Minor rename + compiler warning fix: asharma@fb.com ]
Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
/external/libunwind/src/x86_64/Gtrace.c
08077a4962c4e606598f9f0e54b515b3c882be10 30-Oct-2011 Arun Sharma <asharma@fb.com> pthread_once() workaround for FreeBSD and Solaris

On FreeBSD, as well as on the Solaris < 10, weak pthread_once stub is
always exported from libc. But it does nothing, which means that if
threaded library is not loaded, then pthread_once() call do not actually
call the initializer finction. The construct
if (likely (pthread_once != 0))
{
pthread_once(&trace_cache_once, &trace_cache_init_once);
then fails to initialize the trace cache on x86_64.

Work around by checking that the initializer was indeed called.
Note that this can break if libthr is loaded dynamically, but my belief
is that there is no platforms which allow dynamic loading of the threading
library.
/external/libunwind/src/x86_64/Gtrace.c
d2525ec9369525c4d089eeffc84b417fd9c9aea7 07-May-2011 Lassi Tuura <lat@cern.ch> Use single level hash table for fast trace.
/external/libunwind/src/x86_64/Gtrace.c
5c2cade264010c9855c4ea5effc5b4789739e7ca 07-May-2011 Lassi Tuura <lat@cern.ch> Inline access to initial register values as it's known to be safe.
/external/libunwind/src/x86_64/Gtrace.c
ae5c1f2adf4da04235d87d024d4d942c01b2b447 18-Apr-2011 Lassi Tuura <lat@cern.ch> Performance optimisations for fast trace.

Insert static branch prediction predicates in useful places and avoid
unnecessary code in the hottest paths. Bypass unnecessary indirect
calls, in particular to access_mem(), when known to be safe.
/external/libunwind/src/x86_64/Gtrace.c
15f182828d88ea51d419d94b3daabb7a69181c78 06-Apr-2011 Arun Sharma <asharma@fb.com> Use __thread instead of pthread_getspecific()
/external/libunwind/src/x86_64/Gtrace.c
5f38f35d5d6c78aafa6da20845d9ceff74af00f8 01-Apr-2011 Lassi Tuura <lat@cern.ch> Drop a call frame in tdep_trace and avoid a call to unw_step.

Dropping the extra frame for unw_backtrace itself using unw_step is
approximately 15% slower than skipping the frame in tdep_trace. So
drop the frame in the latter, and make the function a private
implementation detail for libunwind, not an exported interface.

Also moves unw_getcontext call back into unw_backtrace to avoid an
extra call frame in case slow_backtrace does not get inlined into
unw_backtrace.
/external/libunwind/src/x86_64/Gtrace.c
3b9fd99cb78383e0ce8cd1a31e3b824a30ef965e 25-Mar-2011 Lassi Tuura <lat@iki.fi> Assign copyright as requested by the author.
/external/libunwind/src/x86_64/Gtrace.c
f1ea02be58c2127cc655ef3fd6a385a1bd22cdcd 25-Mar-2011 Lassi Tuura <lat@iki.fi> Reset 'used' to zero after expanding frame cache hash table.
/external/libunwind/src/x86_64/Gtrace.c
44a14d1364abff3dc7ec49f35b7220542c4cf2b1 21-Mar-2011 Lassi Tuura <lat@cern.ch> Integrate fast trace into backtrace().
/external/libunwind/src/x86_64/Gtrace.c
9e98f15e9aee12e67cd5956d06ccb559f6a06213 19-Mar-2011 Lassi Tuura <lat@iki.fi> Fast back-trace for x86_64 for only collecting the call stack.

Adds new function to perform a pure stack walk without unwinding,
functionally similar to backtrace() but accelerated by an address
attribute cache the caller maintains across calls.
/external/libunwind/src/x86_64/Gtrace.c