[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libunwind-devel] Fast stack trace utility for Linux
From: |
Vladimir Nikulichev |
Subject: |
Re: [Libunwind-devel] Fast stack trace utility for Linux |
Date: |
Mon, 29 Sep 2014 12:27:22 +0400 |
On Sep 29, 2014, at 11:00 AM, Arun Sharma <address@hidden> wrote:
> On Wed, Sep 24, 2014 at 7:50 PM, Vladimir Nikulichev <address@hidden> wrote:
>
>> More details from README:
>>
>> At first it examines process' memory layout reading /proc/pid/maps. When the
>> process is frozen (PTRACE_ATTACH to the main thread + SIGSTOP to start
>> freezing
>> other threads) it copies all threads' general-purpose registers and contents
>> of
>> stack from %rsp to end of memory region [..]
>
> How does this compare to the approach taken by perf tool included in
> the linux kernel sources? It does something similar, but doesn't use
> ptrace or signals.
>
> I'm guessing one difference is that you sample all the threads in the
> process at the same time, where as perf samples stacks of individual
> threads at different times depending on when they generate an event.
>
> -Arun
Similarity of perf and tbstack is that instead of unwinding while thread is not
running (either executing a kernel code or stopped by other user process with
ptrace), which is a heavy job, it copies whole stack content to analyze
afterwards.
Yes, tbstack and similar tools take a snapshot of all threads including sleeping
ones at particular point in time.
Vladimir