For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > February 2008 > lib for dynamic call trace









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author lib for dynamic call trace
sinbad

2008-02-28, 8:12 am

is there any tool that displays the function call trace dynamically
and writes to a file or something like that. If it is any simple
library that links to my app. will be good.

thanks
sinbad
WANG Cong

2008-02-28, 8:12 am

On Thu, 28 Feb 2008 02:59:05 -0800,sinbad wrote:

> is there any tool that displays the function call trace dynamically and
> writes to a file or something like that. If it is any simple library
> that links to my app. will be good.
>


Gcc has an extension named __builtin_return_address(). Does it help?
Jens Thoms Toerring

2008-02-28, 8:09 pm

sinbad <sinbad.sinbad@gmail.com> wrote:
> is there any tool that displays the function call trace dynamically
> and writes to a file or something like that. If it is any simple
> library that links to my app. will be good.


If you're using the GNU libc the functions

backtrace
backtrace_symbols
backtrace_symbols_fd

(see e.g. http://www.gnu.org/software/libtool...Backtraces.html)

may be useful for you.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Chen Ming

2008-02-29, 7:16 pm

Jens Thoms Toerring wrote:
> sinbad <sinbad.sinbad@gmail.com> wrote:
>
> If you're using the GNU libc the functions
>
> backtrace
> backtrace_symbols
> backtrace_symbols_fd
>
> (see e.g. http://www.gnu.org/software/libtool...Backtraces.html)
>
> may be useful for you.
> Regards, Jens


A comment: From my experience, backtrace is very consume performance.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com