open-power-sdk / splat

System Performance Lock Analysis Tool
GNU General Public License v2.0
6 stars 1 forks source link

can't addprobes against at12 libpthread #7

Open brihh opened 5 years ago

brihh commented 5 years ago

i have an application that is built against the Advanced Tool chain:

[root@p215n49 splat]# grep pthread /proc/40216/maps
7fffa9540000-7fffa9570000 r-xp 00000000 fd:00 101176594                  /opt/at12.0/lib64/power9/libpthread-2.28.so
7fffa9570000-7fffa9580000 r--p 00020000 fd:00 101176594                  /opt/at12.0/lib64/power9/libpthread-2.28.so
7fffa9580000-7fffa9590000 rw-p 00030000 fd:00 101176594                  /opt/at12.0/lib64/power9/libpthread-2.28.so

i modified the addprobes.sh tool for the new libpthread path:

[root@p215n49 splat]# diff addprobes.sh at12_addprobes.sh 
6c6
<       perf probe -x /lib64/libpthread.so.0 --del=pthread_mutex_trylock --del=pthread_mutex_trylock_ret
---
>       perf probe -x /opt/at12.0/lib64/power9/libpthread-2.28.so --del=pthread_mutex_trylock --del=pthread_mutex_trylock_ret
21c21
< perf "$perfarg" -x /lib64/libpthread.so.0 --add='pthread_mutex_trylock mutex' --add=pthread_mutex_trylock_ret='pthread_mutex_trylock%return $retval'
---
> perf "$perfarg" -x /opt/at12.0/lib64/power9/libpthread-2.28.so --add='pthread_mutex_trylock mutex' --add=pthread_mutex_trylock_ret='pthread_mutex_trylock%return $retval'

but the script fails because perf can't find the debuginfo library:

[root@p215n49 splat]# ./at12_addprobes.sh 
The /opt/at12.0/lib64/power9/libpthread-2.28.so file has no debug information.
Rebuild with -g, or install an appropriate debuginfo package.
  Error: Failed to add events.
Failed to probe events with symbols in libpthread.so.  You may need to install glibc-debuginfo package.

though the at12 debuginfo rpm's are installed and there are debuginfo files there:

[root@p215n49 splat]# yum list advance-toolchain-at12*debuginfo*
Loaded plugins: auto-update-debuginfo, langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Installed Packages
advance-toolchain-at12.0-devel-debuginfo.ppc64le                                         12.0-0                                     @advance-toolchain
advance-toolchain-at12.0-mcore-libs-debuginfo.ppc64le                                    12.0-0                                     @advance-toolchain
advance-toolchain-at12.0-perf-debuginfo.ppc64le                                          12.0-0                                     @advance-toolchain
advance-toolchain-at12.0-runtime-debuginfo.ppc64le                                       12.0-0                                     @advance-toolchain

[root@p215n49 splat]# find /opt/at12.0/ -name "libpthread*"
/opt/at12.0/lib/debug/opt/at12.0/lib64/power9/libpthread-2.28.so.debug
/opt/at12.0/lib/debug/opt/at12.0/lib64/libpthread-2.28.so.debug
/opt/at12.0/lib64/power8/libpthread-2.28.so
/opt/at12.0/lib64/power8/libpthread.so
/opt/at12.0/lib64/power8/libpthread.so.0
/opt/at12.0/lib64/power9/libpthread.so
/opt/at12.0/lib64/power9/libpthread.so.0
/opt/at12.0/lib64/power9/libpthread.a
/opt/at12.0/lib64/power9/libpthread-2.28.so
/opt/at12.0/lib64/power9/.debug/libpthread-2.28.so.debug
/opt/at12.0/lib64/libpthread-2.28.so
/opt/at12.0/lib64/libpthread.so
/opt/at12.0/lib64/libpthread.so.0
/opt/at12.0/lib64/libpthread.a
/opt/at12.0/lib64/.debug/libpthread-2.28.so.debug
ThinkOpenly commented 5 years ago

In addition to the issue with splat itself, there appears to be an issue with the Advance Toolchain as well, where it does not have SDTs enabled:

 readelf --notes /lib64/libpthread-2.17.so | grep sdt | wc -l
115
$ readelf --notes /opt/at12.0/lib64/libpthread-2.28.so | grep sdt | wc -l
0

(Note to self: it appears Glibc's configure script checks for, and compiles with, sys/sdt.h to determine whether to enable SDTs. This is part of the systemtap-sdt-devel package.)

ThinkOpenly commented 5 years ago

https://github.com/advancetoolchain/advance-toolchain/issues/946