linux/tools/perf/tests
Thomas Richter 7a92453620 perf test: Fix test trace+probe_libc_inet_pton.sh for s390x
On Intel test case trace+probe_libc_inet_pton.sh succeeds and the
output is:

[root@f27 perf]# ./perf trace --no-syscalls
                  -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.037 ms

 --- ::1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.037/0.037/0.037/0.000 ms
     0.000 probe_libc:inet_pton:(7fa40ac618a0))
              __GI___inet_pton (/usr/lib64/libc-2.26.so)
              getaddrinfo (/usr/lib64/libc-2.26.so)
              main (/usr/bin/ping)

The kernel stack unwinder is used, it is specified implicitly
as call-graph=fp (frame pointer).

On s390x only dwarf is available for stack unwinding. It is also
done in user space. This requires different parameter setup
and result checking for s390x and Intel.

This patch adds separate perf trace setup and result checking
for Intel and s390x. On s390x specify this command line to
get a call-graph and handle the different call graph result
checking:

[root@s35lp76 perf]# ./perf trace --no-syscalls
	-e probe_libc:inet_pton/call-graph=dwarf/ ping -6 -c 1 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.041 ms

 --- ::1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.041/0.041/0.041/0.000 ms
     0.000 probe_libc:inet_pton:(3ffb9942060))
            __GI___inet_pton (/usr/lib64/libc-2.26.so)
            gaih_inet (inlined)
            __GI_getaddrinfo (inlined)
            main (/usr/bin/ping)
            __libc_start_main (/usr/lib64/libc-2.26.so)
            _start (/usr/bin/ping)
[root@s35lp76 perf]#

Before:
[root@s8360047 perf]# ./perf test -vv 58
58: probe libc's inet_pton & backtrace it with ping       :
 --- start ---
test child forked, pid 26349
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.079 ms
 --- ::1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.079/0.079/0.079/0.000 ms
0.000 probe_libc:inet_pton:(3ff925c2060))
test child finished with -1
 ---- end ----
probe libc's inet_pton & backtrace it with ping: FAILED!
[root@s8360047 perf]#

After:
[root@s35lp76 perf]# ./perf test -vv 57
57: probe libc's inet_pton & backtrace it with ping       :
 --- start ---
test child forked, pid 38708
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.038 ms
 --- ::1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.038/0.038/0.038/0.000 ms
0.000 probe_libc:inet_pton:(3ff87342060))
__GI___inet_pton (/usr/lib64/libc-2.26.so)
gaih_inet (inlined)
__GI_getaddrinfo (inlined)
main (/usr/bin/ping)
__libc_start_main (/usr/lib64/libc-2.26.so)
_start (/usr/bin/ping)
test child finished with 0
 ---- end ----
probe libc's inet_pton & backtrace it with ping: Ok
[root@s35lp76 perf]#

On Intel the test case runs unchanged and succeeds.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Link: http://lkml.kernel.org/r/20180117083831.101001-1-tmricht@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-02-15 09:57:47 -03:00
..
attr perf tests attr: Make hw events optional 2017-10-23 11:20:54 -03:00
shell perf test: Fix test trace+probe_libc_inet_pton.sh for s390x 2018-02-15 09:57:47 -03:00
.gitignore perf test: Add libbpf relocation checker 2016-01-26 12:10:55 -03:00
Build perf test: Add test cases for new data source encoding 2017-08-22 13:23:10 -03:00
attr.c perf tests: Add missing WRITE_ASS for new fields of perf_event_attr 2017-11-16 14:49:53 -03:00
attr.py Merge branch 'linus' into perf/core, to fix conflicts 2017-11-07 10:30:18 +01:00
backward-ring-buffer.c perf test: Update mmap read functions for backward-ring-buffer test 2018-02-15 09:54:08 -03:00
bitmap.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bp_signal.c perf test: Disable test cases 19 and 20 on s390x 2017-11-29 18:17:59 -03:00
bp_signal_overflow.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bpf-script-example.c perf test bpf: Hook on epoll_pwait() 2018-01-08 11:11:57 -03:00
bpf-script-test-kbuild.c perf test: Enhance the LLVM tests: add kbuild test 2015-11-06 17:49:50 -03:00
bpf-script-test-prologue.c perf bpf: Fix endianness problem when loading parameters in prologue 2017-08-16 10:31:11 -03:00
bpf-script-test-relocation.c perf test: Add libbpf relocation checker 2016-01-26 12:10:55 -03:00
bpf.c perf evlist: Remove fcntl.h from evlist.h 2018-01-25 06:37:30 -03:00
builtin-test.c perf test: Handle properly readdir DT_UNKNOWN 2017-12-27 12:15:48 -03:00
clang.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
code-reading.c perf evlist: Remove 'overwrite' parameter from perf_evlist__mmap 2017-12-05 15:43:53 -03:00
cpumap.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dso-data.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dwarf-unwind.c perf unwind: Do not look just at the global callchain_param.record_mode 2018-01-17 10:23:32 -03:00
event-times.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
event_update.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
evsel-roundtrip-name.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
evsel-tp-sched.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
expr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fdarray.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hists_common.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hists_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hists_cumulate.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hists_filter.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hists_link.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hists_output.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
is_printable_array.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
keep-tracking.c perf evlist: Remove 'overwrite' parameter from perf_evlist__mmap 2017-12-05 15:43:53 -03:00
kmod-path.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
llvm.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
llvm.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
make Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-12-17 16:24:13 -08:00
mem.c perf test: Add test cases for new data source encoding 2017-08-22 13:23:10 -03:00
mmap-basic.c perf evlist: Remove 'overwrite' parameter from perf_evlist__mmap 2017-12-05 15:43:53 -03:00
mmap-thread-lookup.c Merge branch 'linus' into perf/core, to fix conflicts 2017-11-07 10:30:18 +01:00
openat-syscall-all-cpus.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
openat-syscall-tp-fields.c perf evlist: Remove fcntl.h from evlist.h 2018-01-25 06:37:30 -03:00
openat-syscall.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
parse-events.c perf perf: Remove duplicate includes 2017-12-27 12:15:49 -03:00
parse-no-sample-id-all.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf-hooks.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf-record.c perf evlist: Remove 'overwrite' parameter from perf_evlist__mmap 2017-12-05 15:43:53 -03:00
perf-targz-src-pkg License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pmu.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
python-use.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sample-parsing.c perf tools: Get rid of unused 'swapped' parameter from perf_event__synthesize_sample() 2018-01-18 09:01:23 -03:00
sdt.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stat.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sw-clock.c perf evlist: Remove 'overwrite' parameter from perf_evlist__mmap 2017-12-05 15:43:53 -03:00
switch-tracking.c perf evlist: Remove 'overwrite' parameter from perf_evlist__mmap 2017-12-05 15:43:53 -03:00
task-exit.c perf evlist: Remove 'overwrite' parameter from perf_evlist__mmap 2017-12-05 15:43:53 -03:00
tests.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
thread-map.c perf thread_map: Enumerate all threads from /proc 2017-12-27 12:15:46 -03:00
thread-mg-share.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
topology.c Merge branch 'linus' into perf/core, to fix conflicts 2017-11-07 10:30:18 +01:00
unit_number__scnprintf.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vmlinux-kallsyms.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00