![]() |
|
|
|||
|
LD_PRELOAD related question
Hi,
This question might sound weird but its a long story why I want to do this. I sometimes run my app with a profiling agent 'pre-loaded'. For example: $ env LD_PRELOAD=profiling_agent.so my_app My question: Inside 'my_app', I want to know if 'profiling_agent.so' is running/pre-loaded or not. Can I find out via the /proc interface? Regards Rajesh |
|
|||
|
Re: LD_PRELOAD related question
Rajesh <rajesh.radhakrishnan@gmail.com> writes:
> Hi, > > This question might sound weird but its a long story why I want to do > this. > > I sometimes run my app with a profiling agent 'pre-loaded'. For > example: > > $ env LD_PRELOAD=profiling_agent.so my_app > > My question: Inside 'my_app', I want to know if 'profiling_agent.so' > is running/pre-loaded or not. Can I find out via the /proc interface? On Linux, /proc/self/maps should contain this information. -- Måns Rullgård mans@mansr.com |
|
|||
|
Re: LD_PRELOAD related question
In article <d52e576d-298e-425c-870d-6aab595923bc@c58g2000hsc.googlegroups.com>,
Rajesh <rajesh.radhakrishnan@gmail.com> writes: > Hi, > > This question might sound weird but its a long story why I want to do > this. > > I sometimes run my app with a profiling agent 'pre-loaded'. For > example: > > $ env LD_PRELOAD=profiling_agent.so my_app > > My question: Inside 'my_app', I want to know if 'profiling_agent.so' > is running/pre-loaded or not. Can I find out via the /proc interface? [Solaris] Much easier to just ask the dynamic linker if it loaded it... if (dlopen("profiling_agent.so", RTLD_NOLOAD) != NULL) { /* profiling library is already loaded */ } -- Andrew Gabriel [email address is not usable -- followup in the newsgroup] |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|