perf test case 58 (
executed on s390x using kernel 4.16.0rc3
displays this result:
 # ./perf trace --no-syscalls
           -e probe_libc:inet_pton/call-graph=dwarf/ ping -6 -c 1 ::1
     probe_libc:inet_pton: (3ffa0240448)
              __GI___inet_pton (/usr/lib64/
              gaih_inet (inlined)
              __GI_getaddrinfo (inlined)
              main (/usr/bin/ping)
              __libc_start_main (/usr/lib64/
             _start (/usr/bin/ping)

After I installed kernel 4.16.0 the same tests uses
 # perf record -e probe_libc:inet_pton/call-graph=dwarf/
      -o /tmp/ ping -6 -c 1 ::1
 # perf script -i /tmp/
and displays:
 ping 39048 [006] 84230.381198: probe_libc:inet_pton: (3ffa0240448)
               140448 __GI___inet_pton (/usr/lib64/
               fbde1 gaih_inet (inlined)
               fe2b9 __GI_getaddrinfo (inlined)
                398d main (/usr/bin/ping)

Nothing else changed including glibc elfutils and other libraries
picked up by the build.
The entries for __libc_start_main and _start are missing.

I bisected missing __libc_start_main and _start to commit
("perf unwind: Unwind with libdw doesn't take symfs into account")

When I undo this commit I get this call stack on s390:
 [root@s35lp76 perf]# ./perf script  -i /tmp/
 ping 39048 [006] 84230.381198: probe_libc:inet_pton: (3ffa0240448)
        140448 __GI___inet_pton (/usr/lib64/
         fbde1 gaih_inet (inlined)
         fe2b9 __GI_getaddrinfo (inlined)
          398d main (/usr/bin/ping)
         22fbd __libc_start_main (/usr/lib64/
          457b _start (/usr/bin/ping)

Looks like dwarf functions dwfl_xxx  create different call back
stack trace when using file
/usr/lib/debug/usr/bin/ping-20161105-7.fc27.s390x.debug instead of
file /usr/bin/ping.

Fix this test case on s390 and do not expect any call back stack
entry after the main() function. Also be more robust and accept a
leading __GI_ prefix in front of getaddrinfo.

On x86 this test case shows the same call stack using
both kernel versions 4.16.0rc3 and 4.16.0 and also
stops at main:

[root@f27 perf]# ./perf script -i /tmp/
ping  4446 [000]   172.027088: probe_libc:inet_pton: (7fdfa08c93c0)
                   1393c0 __GI___inet_pton (/usr/lib64/
                    fe60d getaddrinfo (/usr/lib64/
                     2f40 main (/usr/bin/ping)

[root@f27 perf]#

Signed-off-by: Thomas Richter <>
Reviewed-by: Hendrik Brueckner <>
 tools/perf/tests/shell/ | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/perf/tests/shell/ 
index 1ecc1f0ff84a..016882dbbc16 100755
--- a/tools/perf/tests/shell/
+++ b/tools/perf/tests/shell/
@@ -19,12 +19,10 @@ trace_libc_inet_pton_backtrace() {
        case "$(uname -m)" in
-               eventattr='call-graph=dwarf'
+               eventattr='call-graph=dwarf,max-stack=4'
-               expected[3]="__GI_getaddrinfo[[:space:]]\($libc|inlined\)$"
+               expected[3]="(__GI_)?getaddrinfo[[:space:]]\($libc|inlined\)$"
-               expected[5]="__libc_start_main[[:space:]]\($libc\)$"
-               expected[6]="_start[[:space:]]\(.*/bin/ping.*\)$"

Reply via email to