From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Thomas Richter <tmricht@linux.vnet.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 21/21] perf test: Fix test trace+probe_libc_inet_pton.sh for s390x
Date: Tue, 6 Feb 2018 13:53:50 -0300 [thread overview]
Message-ID: <20180206165350.2570-22-acme@kernel.org> (raw)
In-Reply-To: <20180206165350.2570-1-acme@kernel.org>
From: Thomas Richter <tmricht@linux.vnet.ibm.com>
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>
---
.../perf/tests/shell/trace+probe_libc_inet_pton.sh | 23 +++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh b/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
index 8b3da21a08f1..c446c894b297 100755
--- a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
@@ -22,10 +22,23 @@ trace_libc_inet_pton_backtrace() {
expected[4]="rtt min.*"
expected[5]="[0-9]+\.[0-9]+[[:space:]]+probe_libc:inet_pton:\([[:xdigit:]]+\)"
expected[6]=".*inet_pton[[:space:]]\($libc\)$"
- expected[7]="getaddrinfo[[:space:]]\($libc\)$"
- expected[8]=".*\(.*/bin/ping.*\)$"
-
- perf trace --no-syscalls -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1 2>&1 | grep -v ^$ | while read line ; do
+ case "$(uname -m)" in
+ s390x)
+ eventattr='call-graph=dwarf'
+ expected[7]="gaih_inet[[:space:]]\(inlined\)$"
+ expected[8]="__GI_getaddrinfo[[:space:]]\(inlined\)$"
+ expected[9]="main[[:space:]]\(.*/bin/ping.*\)$"
+ expected[10]="__libc_start_main[[:space:]]\($libc\)$"
+ expected[11]="_start[[:space:]]\(.*/bin/ping.*\)$"
+ ;;
+ *)
+ eventattr='max-stack=3'
+ expected[7]="getaddrinfo[[:space:]]\($libc\)$"
+ expected[8]=".*\(.*/bin/ping.*\)$"
+ ;;
+ esac
+
+ perf trace --no-syscalls -e probe_libc:inet_pton/$eventattr/ ping -6 -c 1 ::1 2>&1 | grep -v ^$ | while read line ; do
echo $line
echo "$line" | egrep -q "${expected[$idx]}"
if [ $? -ne 0 ] ; then
@@ -33,7 +46,7 @@ trace_libc_inet_pton_backtrace() {
exit 1
fi
let idx+=1
- [ $idx -eq 9 ] && break
+ [ -z "${expected[$idx]}" ] && break
done
}
--
2.14.3
next prev parent reply other threads:[~2018-02-06 16:54 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 16:53 [GIT PULL 00/21] perf/core improvements and fixes Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 01/21] perf vendor events aarch64: Add JSON metrics for ARM Cortex-A53 Processor Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 02/21] perf evlist: Remove stale mmap read for backward Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 03/21] perf mmap: Recalculate size for overwrite mode Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 04/21] perf mmap: Cleanup perf_mmap__push() Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 05/21] perf mmap: Introduce perf_mmap__read_init() Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 06/21] perf mmap: Add new return value logic for perf_mmap__read_init() Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 07/21] perf mmap: Discard 'prev' in perf_mmap__read() Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 08/21] perf mmap: Introduce perf_mmap__read_done() Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 09/21] perf mmap: Introduce perf_mmap__read_event() Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 10/21] perf test: Update mmap read functions for backward-ring-buffer test Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 11/21] perf mmap: Discard legacy interface for mmap read Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 12/21] perf top: Check per-event overwrite term Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 13/21] perf evsel: Expose the perf_missing_features struct Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 14/21] perf top: Add overwrite fall back Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 15/21] perf hists browser: Add parameter to disable lost event warning Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 16/21] perf top: Remove lost events checking Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 17/21] perf top: Switch default mode to overwrite mode Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 18/21] perf top: Check the latency of perf_top__mmap_read() Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 19/21] perf tools: Substitute yet another strtoull() Arnaldo Carvalho de Melo
2018-02-06 16:53 ` [PATCH 20/21] perf data: Document missing --force option Arnaldo Carvalho de Melo
2018-02-06 16:53 ` Arnaldo Carvalho de Melo [this message]
2018-02-13 11:59 ` [PATCH] tools/headers: Synchronize kernel ABI headers, v4.16-rc1 Ingo Molnar
2018-02-14 13:41 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180206165350.2570-22-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=schwidefsky@de.ibm.com \
--cc=tmricht@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).