Received: by 10.223.185.116 with SMTP id b49csp1018926wrg; Fri, 16 Feb 2018 10:55:40 -0800 (PST) X-Google-Smtp-Source: AH8x226U2BpkbTJIjf1RmVCSLbSjsrcUPKKmqtLbebh4QHYggVeMz/86zhDdOixO4/kljIdCUkb4 X-Received: by 2002:a17:902:3183:: with SMTP id x3-v6mr6762387plb.290.1518807340067; Fri, 16 Feb 2018 10:55:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518807340; cv=none; d=google.com; s=arc-20160816; b=jVPgG1Bimoiqzb0VtYlsFhWp4mnH1IsQqTmBzwHaVpRsOe6KNbuiT2zVCWZmVIFuL0 LHSp8HWYL0Ivg3aULof4qdBgDHm6Akfn4KO3ukf13++V/sE+w57Ba8V3CY8RFzZe8TEI O0WSeV8N31sVtEE3GDYnxnhEVNmj5/4uNVujvTSA24XTItBnvPqAVAonCtEeAwHWFxkC XKDNJ9icoskNJncuDJS5kHR9NEx3JX1VR92aLYb/nn6JGU3hk5oO4x7IX4tksmcPk07Y qzvqosoF2mSUNJVB/zga2FFdk/eBc3oftKALFdUOzpKiLyOmNv60IZEDEPJ7O+S2dvgs qrrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=r2+u2G+YwIZKFqVdPJFZCcfEvH5jSWGG659ys7MNuH4=; b=j5D/GJhtJU4EMbf/ddPK6OsRXfuHPu7E4yy6SgtIohXNjOkdj0gh5cwXB+igboLe5+ a7Ul17b2py5MPLOp/d8k56JrGmYdp685OFp8I/FRVYDV7Iyv7Xp6Ma6x2THuz/uQX4+O c2apW8/uzFYYxdSCvDwI61iFmW4Vefks3N2gR/yRccyJxutc1dtjiGmiXVVQJe+rNpgY JbLMTtJs/tv7v3mjBEca/m/bGr7BCYajUnm/5DVACrvpvBpcMID5ct+UOKSj6Pq+ws3l YvZGjzt/0nklWTumQV7o1HAvFNF4a0nfm5NuqD3DOTK8sAZ0tY85kMi0KMuFWCfACX2V hUmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10-v6si128739pln.821.2018.02.16.10.55.24; Fri, 16 Feb 2018 10:55:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932253AbeBPJnm (ORCPT + 99 others); Fri, 16 Feb 2018 04:43:42 -0500 Received: from terminus.zytor.com ([198.137.202.136]:56301 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932120AbeBPJnl (ORCPT ); Fri, 16 Feb 2018 04:43:41 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1G9hVF2023189; Fri, 16 Feb 2018 01:43:31 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1G9hV8p023185; Fri, 16 Feb 2018 01:43:31 -0800 Date: Fri, 16 Feb 2018 01:43:31 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Thomas Richter Message-ID: Cc: tglx@linutronix.de, brueckner@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, schwidefsky@de.ibm.com, tmricht@linux.vnet.ibm.com, acme@redhat.com, heiko.carstens@de.ibm.com, mingo@kernel.org, hpa@zytor.com Reply-To: tglx@linutronix.de, schwidefsky@de.ibm.com, linux-kernel@vger.kernel.org, brueckner@linux.vnet.ibm.com, tmricht@linux.vnet.ibm.com, heiko.carstens@de.ibm.com, acme@redhat.com, mingo@kernel.org, hpa@zytor.com In-Reply-To: <20180117083831.101001-1-tmricht@linux.vnet.ibm.com> References: <20180117083831.101001-1-tmricht@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf test: Fix test trace+probe_libc_inet_pton.sh for s390x Git-Commit-ID: 7a92453620d42c3a5fea94a864dc6aa04c262b93 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7a92453620d42c3a5fea94a864dc6aa04c262b93 Gitweb: https://git.kernel.org/tip/7a92453620d42c3a5fea94a864dc6aa04c262b93 Author: Thomas Richter AuthorDate: Wed, 17 Jan 2018 09:38:31 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 15 Feb 2018 09:57:47 -0300 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 Reviewed-by: Hendrik Brueckner Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180117083831.101001-1-tmricht@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- .../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 8b3da21..c446c89 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 }