LKML Archive on
 help / color / Atom feed
From: tip-bot for Thomas Richter <>
Subject: [tip:perf/core] perf test shell: Fix test case probe libc's inet_pton on s390x
Date: Tue, 28 Nov 2017 22:31:52 -0800
Message-ID: <> (raw)
In-Reply-To: <>

Commit-ID:  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
        [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

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 <>
Signed-off-by: Arnaldo Carvalho de Melo <>
 tools/perf/tests/shell/ | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/perf/tests/shell/ b/tools/perf/tests/shell/
index 7a84d73..8b3da21 100755
--- a/tools/perf/tests/shell/
+++ b/tools/perf/tests/shell/
@@ -10,8 +10,8 @@
 . $(dirname $0)/lib/
-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() {
@@ -37,6 +37,9 @@ trace_libc_inet_pton_backtrace() {
+# 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 && \

      parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
     [not found] ` <>
     [not found]   ` <>
2017-11-14 13:34     ` [PATCH] perf test: fix " Arnaldo Carvalho de Melo
2017-11-14 13:47       ` Arnaldo Carvalho de Melo
2017-11-14 13:55         ` Thomas-Mich Richter
2017-11-14 14:58           ` Arnaldo Carvalho de Melo
2017-11-18  8:33       ` [tip:perf/core] perf test shell: Fix " tip-bot for Thomas Richter
2017-11-29  6:31       ` tip-bot for Thomas Richter [this message]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone