login
Header Space

 
 

PID to ELF image full path

July 8, 2008 - 6:21am
Submitted by Anonymous on July 8, 2008 - 6:21am.
Linux

Is there anyway, can get location of ELF image based on task's PID ?

Use the proc interface

July 8, 2008 - 7:06am
snu (not verified)

/proc/<pid>/exe links to the binary executable. Maybe this is what you want.

Actually I was analyzing

July 8, 2008 - 7:42am
Anonymous (not verified)

Actually I was analyzing Oprofile.
oprofile implements using pid which will be pointing to task_struct in turn we get mm_sruct intuen we get vma, which in turn gives vma_file and finally we access corresponding dentry using fast_get_dcookie call.
but you are suggesting a straightforward way, I am not sure why oprofile has implemented in such a way !

libraries

July 8, 2008 - 2:06pm

this sounds like it wants to find mapped shared libraries, too. like what you see in /proc/<pid>/maps . and repeatedly and minimizing deadlocks and overhead.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
speck-geostationary