namhyung / uftrace

Function graph tracer for C/C++/Rust/Python
https://uftrace.github.io/slide/
GNU General Public License v2.0
3.04k stars 473 forks source link

improve support for patching external modules. #817

Open ParkHanbum opened 5 years ago

ParkHanbum commented 5 years ago

I want add some task to TODO list.

$ ldd pthread_ex
        linux-vdso.so.1 (0x00007ffea75b7000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fecf47e4000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fecf43f3000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fecf4c06000)

for now, this PR could not support alias name like libc.so.6. only support actually library name that has displayed in proc /< pid >/ maps. and this PR could not support dynamic loaded module also.

so, I want append to TODO list two tasks.

  1. support alias name of library. ( if possible )
  2. support dynamic loaded module.

and as honggyu say, need to make module name also can use regex.

  1. support regex for module name also.
honggyukim commented 5 years ago

@ParkHanbum Please go ahead. I think we need it. Thanks!

namhyung commented 5 years ago

As I said before you can compare SONAME of the library too (if filename comparison is failed).

$ readlink /lib/x86_64-linux-gnu/libpthread.so.0
libpthread-2.28.so

$ readelf -d /lib/x86_64-linux-gnu/libpthread-2.28.so | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libpthread.so.0]
ParkHanbum commented 5 years ago

@namhyung thanks, I understand what you say, now.