From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752626AbdK2GdD (ORCPT ); Wed, 29 Nov 2017 01:33:03 -0500 Received: from terminus.zytor.com ([65.50.211.136]:49289 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928AbdK2GdB (ORCPT ); Wed, 29 Nov 2017 01:33:01 -0500 Date: Tue, 28 Nov 2017 22:31:52 -0800 From: tip-bot for Thomas Richter Message-ID: Cc: acme@redhat.com, tmricht@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, brueckner@linux.vnet.ibm.com, tglx@linutronix.de Reply-To: mingo@kernel.org, brueckner@linux.vnet.ibm.com, tglx@linutronix.de, acme@redhat.com, tmricht@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, hpa@zytor.com In-Reply-To: <20171114133409.GN8836@kernel.org> References: <20171114133409.GN8836@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf test shell: Fix test case probe libc's inet_pton on s390x Git-Commit-ID: d5c5e46aa7a2b256a526f9ce832ffbf622c3c19a 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d5c5e46aa7a2b256a526f9ce832ffbf622c3c19a Gitweb: https://git.kernel.org/tip/d5c5e46aa7a2b256a526f9ce832ffbf622c3c19a Author: Thomas Richter AuthorDate: Tue, 14 Nov 2017 08:18:47 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 28 Nov 2017 14:23:16 -0300 perf test shell: Fix test case probe libc's inet_pton on s390x The 'perf test' case "probe libc's inet_pton & backtrace it with ping" fails on s390x. The reason is the 'realpath /lib64/ld*.so.* | uniq' line which returns 2 libraries: root@s35lp76 shell]# realpath /lib64/ld*.so.* | uniq /usr/lib64/ld-2.26.so /usr/lib64/ld_pre_smc.so.1.0.1 [root@s35lp76 shell] This output makes the "perf probe" command lines invalid. Use ldd tool to find out the libraries required by "bash" and check if symbol "inet_pton" is part of the "libc" library. Some distros do not have a /lib64 directory. I have also added a check for the existence of an IPv6 network interface before it is being used. Committer changes: We can't really use ldd for libc, as in some systems, such as x86_64, it has hardlinks and then ldd sees one and the kernel the other, so grep for libc in /proc/self/maps to get the one we'll receive from PERF_RECORD_MMAP. Thomas checked this change and acked it. Signed-off-by: Thomas-Mich Richter Tested-by: Arnaldo Carvalho de Melo Suggested-by: Hendrik Brückner Reviewed-by: Hendrik Brückner Link: http://lkml.kernel.org/r/20171114133409.GN8836@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/shell/trace+probe_libc_inet_pton.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 7a84d73..8b3da21 100755 --- a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh +++ b/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh @@ -10,8 +10,8 @@ . $(dirname $0)/lib/probe.sh -ld=$(realpath /lib64/ld*.so.* | uniq) -libc=$(echo $ld | sed 's/ld/libc/g') +libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1/g') +nm -g $libc 2>/dev/null | fgrep -q inet_pton || exit 254 trace_libc_inet_pton_backtrace() { idx=0 @@ -37,6 +37,9 @@ trace_libc_inet_pton_backtrace() { done } +# Check for IPv6 interface existence +ip a sh lo | fgrep -q inet6 || exit 2 + skip_if_no_perf_probe && \ perf probe -q $libc inet_pton && \ trace_libc_inet_pton_backtrace