2017-11-14 14:33:53

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] perf test: fix test case probe libc's inet_pton on s390x

Em Tue, Nov 14, 2017 at 10:34:09AM -0300, Arnaldo Carvalho de Melo escreveu:
> > Different name, same contents, need to look at the inode... ;-\
>
> Nah, lets ask the kernel how is it that it sees libc, please test the
> following, works for me:

BTW, this is what I sticked on that cset:

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.

- Arnaldo

> 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 7a84d73324e3..8b3da21a08f1 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

From 1584052293098348332@xxx Tue Nov 14 14:33:07 +0000 2017
X-GM-THRID: 1584050275476356436
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread


2017-11-14 14:01:03

by Thomas-Mich Richter

[permalink] [raw]
Subject: Re: [PATCH] perf test: fix test case probe libc's inet_pton on s390x

On 11/14/2017 02:47 PM, Arnaldo Carvalho de Melo wrote:
> Em Tue, Nov 14, 2017 at 10:34:09AM -0300, Arnaldo Carvalho de Melo escreveu:
>>> Different name, same contents, need to look at the inode... ;-\
>>
>> Nah, lets ask the kernel how is it that it sees libc, please test the
>> following, works for me:

works for me too.

>
> BTW, this is what I sticked on that cset:
>
> 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.
>
> - Arnaldo
>

Yes I am fine with this changes.
Go ahead.

--
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294


From 1584051772916443563@xxx Tue Nov 14 14:24:51 +0000 2017
X-GM-THRID: 1583498936056662774
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread