• Li Zhijian's avatar
    perf test shell trace+probe_libc_inet_pton.sh: Be compatible with Debian/Ubuntu · 74f8e22c
    Li Zhijian authored
    In debian/ubuntu, libc.so is located at a different place,
    /lib/x86_64-linux-gnu/libc-2.23.so, so it outputs like this when testing:
    
      PING ::1(::1) 56 data bytes
      64 bytes from ::1: icmp_seq=1 ttl=64 time=0.040 ms
    
      --- ::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.040/0.040/0.040/0.000 ms
      0.000 probe_libc:inet_pton:(7f0e2db741c0))
      __GI___inet_pton (/lib/x86_64-linux-gnu/libc-2.23.so)
      getaddrinfo (/lib/x86_64-linux-gnu/libc-2.23.so)
      [0xffffa9d40f34ff4d] (/bin/ping)
    
    Fix up the libc path to make sure this test works in more OSes.
    
    Committer testing:
    
    When this test fails one can use 'perf test -v', i.e. in verbose mode, where
    it'll show the expected backtrace, so, after applying this test:
    
    On Fedora 26:
    
      # perf test -v ping
      62: probe libc's inet_pton & backtrace it with ping       :
      --- start ---
      test child forked, pid 23322
      PING ::1(::1) ...
    74f8e22c
trace+probe_libc_inet_pton.sh 1.45 KB