diff options
author | Aliaksey Kandratsenka <alk@tut.by> | 2014-02-08 15:30:36 -0800 |
---|---|---|
committer | Aliaksey Kandratsenka <alk@tut.by> | 2014-02-16 19:22:06 -0800 |
commit | 90ba15d1f2f6704af96f62ce1e8c5f214697bab1 (patch) | |
tree | 52c0481abd9ad93aa9ee7dd603335cc2b7dd966d /src/stacktrace_instrument-inl.h | |
parent | 33f6781d64af88ea23698a084188d8c2ab94ecb1 (diff) | |
download | gperftools-90ba15d1f2f6704af96f62ce1e8c5f214697bab1.tar.gz |
issue-604: implement runtime-selectable stacktrace capturing
We're now building all supported stacktrace capturing methods. And
there's now a way to select at runtime which method is used.
Diffstat (limited to 'src/stacktrace_instrument-inl.h')
-rwxr-xr-x | src/stacktrace_instrument-inl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stacktrace_instrument-inl.h b/src/stacktrace_instrument-inl.h index c99c4de..c631765 100755 --- a/src/stacktrace_instrument-inl.h +++ b/src/stacktrace_instrument-inl.h @@ -130,14 +130,14 @@ static int cyg_backtrace(void **buffer, int size) { // int max_depth: the size of the result (and sizes) array(s) // int skip_count: how many stack pointers to skip before storing in result // void* ucp: a ucontext_t* (GetStack{Trace,Frames}WithContext only) -int GET_STACK_TRACE_OR_FRAMES { +static int GET_STACK_TRACE_OR_FRAMES { static const int kStackLength = 64; void * stack[kStackLength]; int size; memset(stack, 0, sizeof(stack)); size = cyg_backtrace(stack, kStackLength); - skip_count++; // we want to skip the current frame as well + skip_count += 2; // we want to skip the current and parent frame as well int result_count = size - skip_count; if (result_count < 0) result_count = 0; |