NetBSD-Users archive

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

Re: Mapping function address to name



On Sun, 29 Apr 2012 13:46:49 +0100
Sad Clouds <cryintothebluesky%googlemail.com@localhost> wrote:

> On Sun, 29 Apr 2012 08:19:21 -0400
> christos%zoulas.com@localhost (Christos Zoulas) wrote:
> 
> > On Apr 29, 10:59am, cryintothebluesky%googlemail.com@localhost (Sad Clouds)
> > wrote:
> > -- Subject: Re: Mapping function address to name
> > 
> > | OK thanks, I've taken your symtab functions, which obtain symbol
> > | names. I'm trying to instrument libfuse and quite a lot of symbol
> > | names show up as '_fini' eg:
> > | 
> > | tusec ncalls func file
> > | ---------------------------------------------------
> > | 126.50 1 _fini() /lib64/libfuse.so.2
> > | 1.88 2 fuse_register_module() /lib64/libfuse.so.2
> > | 11.13 808 _fini() /lib64/libfuse.so.2
> > | 1.38 2 _fini() /lib64/libfuse.so.2
> > | 231.85 5 _fini() /lib64/libfuse.so.2
> > | 1.16 811 fuse_req_userdata() /lib64/libfuse.so.2
> > | 
> > | .. and so on
> > | 
> > | Any idea why that might be?
> > 
> > No idea, maybe there is a bug in my code?
> > 
> > christos
> 
> OK no problem, I'll have a look at it in more details then.
> 
> Cheers.

I think this is because in shared libraries, functions defined as
'static' are not visible in ELF sections.

It would alleviate much of my frustration, if GCCs instrumentation
callbacks __cyg_profile_func_enter/__cyg_profile_func_exit would
also pass function name as one of their arguments. Surely this would be
a simple thing for a compiler to do.


Home | Main Index | Thread Index | Old Index