Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4329978imm; Fri, 18 May 2018 03:21:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrmkEUn/BIOOrJCNvKISHFmp9jhLUYKYZdIBRiKoqeV4xF9F2ncsYnm3oN8TZ7saxm7yV7a X-Received: by 2002:a63:6703:: with SMTP id b3-v6mr6821344pgc.176.1526638902929; Fri, 18 May 2018 03:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526638902; cv=none; d=google.com; s=arc-20160816; b=BSUSmBp0ACNtMMl02EE/QgIZhtbQea6rhgs++4IVb3BCIwzKKUNsJOzV3UWBxrJgHO 5LhL5LYyaGr+HwgVC9DRY9DBDDNyqCxDZeFgRvm+J67ay2VhcVYj7ueJXXX5NgTTPb5a X4GS9KphzcFe0jJz/Hik7e/04Dyaq9eFU8AFloe6E1882AK41ApxfdufEflSD8MUwYTi IU5Sevg2reuLNUwacxyRjZ5seCLakBrKhhf+cWKvce6g0rsu35EIJOeuRd4gsnukve8C xGvHdfEkKBzXDlfqTq5Q0z7B04S3vX9GCZCCztClvh+wPhkzOnvaIXRIGnFXj13PSh3k wpOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :organization:from:references:cc:to:subject :arc-authentication-results; bh=DuU5qyasis2Lod76gjWiC5uMAIzmLKg5CVfoE1UxUJg=; b=cK56ND+jbEVvaae4IgyGiH9kViFARXSUXUCNHLWsrbX8Qx6PvQvqNtOy6YqcVSAYZ4 +Qb8hGFkz7EU+wRftaJ/a3qmQpou4OE8nzrD+b562lE1+FKAskuthP2wuSiZkCF/qlan +7FcK2wNNFcuebbK9x7V8ZTAvIhtKmOZB4vWORAjuDKBYYZm5zpIY+hjRngevaXXM14N eqWwjC5N7/I2RlbMUFgGaUWhObMQ5Z8BQw62JW/AXMMlVBMJJR0KH2M4myBiSn5gp04R DTHuweTcO4SuAMfLpV91+N1L7kQurlvmEQyQ090XVzZ97CaJulRJqjuXPDModxSobhbt mGNw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e20-v6si5605894pgn.130.2018.05.18.03.21.28; Fri, 18 May 2018 03:21:42 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752377AbeERKVQ (ORCPT + 99 others); Fri, 18 May 2018 06:21:16 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55912 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752176AbeERKVO (ORCPT ); Fri, 18 May 2018 06:21:14 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4IAK3ko139120 for ; Fri, 18 May 2018 06:21:13 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j1swd0h66-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 18 May 2018 06:21:13 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 18 May 2018 11:21:11 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 18 May 2018 11:21:09 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4IAL88212583406; Fri, 18 May 2018 10:21:08 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 078E7AE055; Fri, 18 May 2018 11:10:27 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B2156AE04D; Fri, 18 May 2018 11:10:26 +0100 (BST) Received: from oc3784624756.ibm.com (unknown [9.152.212.159]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 18 May 2018 11:10:26 +0100 (BST) Subject: Re: [PATCH] perf tests: Fix regex for record+probe_libc_inet_pton.sh To: Sandipan Das , acme@kernel.org, jolsa@redhat.com Cc: linux-kernel@vger.kernel.org, ravi.bangoria@linux.ibm.com, naveen.n.rao@linux.vnet.ibm.com, Hendrik Brueckner References: <20180518072417.1498-1-sandipan@linux.vnet.ibm.com> From: Thomas-Mich Richter Organization: IBM LTC Date: Fri, 18 May 2018 12:21:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180518072417.1498-1-sandipan@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18051810-0020-0000-0000-0000041E99F6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051810-0021-0000-0000-000042B3C1F5 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-18_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805180115 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/18/2018 09:24 AM, Sandipan Das wrote: > This test currently fails because the regular expressions for > matching the output of perf script do not consider the symbol > offsets to be part of the output. > > The symbol offsets are seen because of the default behaviour > introduced by commit 4140d2ea74b3 ("perf script: Show symbol > offsets by default"). > > Before applying this patch: > > # perf test -v "probe libc's inet_pton & backtrace it with ping" > > 62: probe libc's inet_pton & backtrace it with ping : > --- start --- > test child forked, pid 30389 > ping 30406 [002] 307144.280983: probe_libc:inet_pton: (7f4117adf220) > 7f4117adf220 __GI___inet_pton+0x0 (/usr/lib64/libc-2.25.so) > FAIL: expected backtrace entry 1 ".*inet_pton[[:space:]]\(/usr/lib64/libc-2.25.so|inlined\)$" got "7f4117adf220 __GI___inet_pton+0x0 (/usr/lib64/libc-2.25.so)" > test child finished with -1 > ---- end ---- > probe libc's inet_pton & backtrace it with ping: FAILED! > > After applying this patch: > > # perf test -v "probe libc's inet_pton & backtrace it with ping" > > 62: probe libc's inet_pton & backtrace it with ping : > --- start --- > test child forked, pid 30539 > ping 30556 [003] 307254.313217: probe_libc:inet_pton: (7fe19ab10220) > 7fe19ab10220 __GI___inet_pton+0x0 (/usr/lib64/libc-2.25.so) > 7fe19aad5ebd getaddrinfo+0x11d (/usr/lib64/libc-2.25.so) > 56351e3c1c71 main+0x891 (/usr/bin/ping) > test child finished with 0 > ---- end ---- > probe libc's inet_pton & backtrace it with ping: Ok > > Signed-off-by: Sandipan Das > --- > tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh > index ee86473643be..650b208f700f 100755 > --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh > +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh > @@ -16,18 +16,18 @@ nm -g $libc 2>/dev/null | fgrep -q inet_pton || exit 254 > trace_libc_inet_pton_backtrace() { > idx=0 > expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)" > - expected[1]=".*inet_pton[[:space:]]\($libc|inlined\)$" > + expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" > case "$(uname -m)" in > s390x) > eventattr='call-graph=dwarf,max-stack=4' > - expected[2]="gaih_inet.*[[:space:]]\($libc|inlined\)$" > - expected[3]="(__GI_)?getaddrinfo[[:space:]]\($libc|inlined\)$" > - expected[4]="main[[:space:]]\(.*/bin/ping.*\)$" > + expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" > + expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" > + expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" > ;; > *) > eventattr='max-stack=3' > - expected[2]="getaddrinfo[[:space:]]\($libc\)$" > - expected[3]=".*\(.*/bin/ping.*\)$" > + expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" > + expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" > ;; > esac > > This patch fails on s390. I used 4.17.0rc5 + fedora 27 and I get this output: [root@p23lp27 perf]# ./perf test 59 59: probe libc's inet_pton & backtrace it with ping : Ok [root@p23lp27 linux]# cd ~/linux; patch -p1 < ../inet_pton1 (Stripping trailing CRs from patch; use --binary to disable.) patching file tools/perf/tests/shell/record+probe_libc_inet_pton.sh [root@p23lp27 linux]# cd -; [root@p23lp27 perf]# ./perf test 59 59: probe libc's inet_pton & backtrace it with ping : FAILED! [root@p23lp27 perf]# Debugging revealed this line as cause of failure: FAIL: expected backtrace entry 2 "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/libc-2.26.so|inlined\)$" got "fdcb1 gaih_inet.constprop.7 (/usr/lib64/libc-2.26.so)" Here is the output of the trace file [root@p23lp27 perf]# perf script ping 87291 [001] 96936.231618: probe_libc:inet_pton: (3ff96342378) 142378 __inet_pton (inlined) fdcb1 gaih_inet.constprop.7 (/usr/lib64/libc-2.26.so) 100189 __GI_getaddrinfo (inlined) 398d main (/usr/bin/ping) 2303d __libc_start_main (/usr/lib64/libc-2.26.so) 457b [unknown] (/usr/bin/ping) [root@p23lp27 perf]# Hope this helps -- Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany -- Vorsitzende des Aufsichtsrats: Martina Koederitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294