Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1726770imm; Tue, 10 Jul 2018 07:00:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdzhS4HuVcNm6ztbKW2NxkJbhEcIPuzw0I17wwcP2v05YDvLxmE7jA6T9fOhRpR4INGNifv X-Received: by 2002:a63:735d:: with SMTP id d29-v6mr22993769pgn.156.1531231203381; Tue, 10 Jul 2018 07:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531231203; cv=none; d=google.com; s=arc-20160816; b=PrrCpeghfbPfjpzgBMnZq6zXNMioOgEOSYs3nQh4398pOF5dcKVRn+Lw2MbwKBrWlQ w1zOqmo792wljoigMbT2+fg2WasTYtyCButzfEcvgXX2WdubhLYMBZ6mv8I651/9HcSe gJ4mwN+F3sJ6jT4+VXKlZg86YLa6ThaIP4aX7YUkdz+85SpmggCSl5r5USQ5gnZwuKpS U7WEMpTCdf45bxHuuY3ZqVsEMRT00C6k7nfzVDybrkpY0VpXs7tEIquMwrG/qHV3iED9 l6cQ/lucCgsVLUtch3GYIePGg/56sAwAK2qGK2nx16CsfRUROuA7vdgRtCj18KaCoq5V Jh4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to :references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=FzSoU14MfS9pMtWAkWCPYoise4YwF89jnw9OXnYmFAs=; b=aWnWDU8yX0i4d7pqwD4oxmws6hGSJCJ+vcaTxvlU9DHxUmaUMeBXTiqsqGSX54BEBe XMEIMY+u6obASoFF+w7p7PyCjV96JN4+TDeHgPlcd57hae+j7WJJg0Mm2usNcctKT41A OehRdeynqwFkRiLgZ+6qKlQ3n9ojVh7IP9gvjjGJi765fQh0th8tzPmZmd1Z676joVs3 AWE0BRf9TFUOfRp0fnY1/N1pCTOtiVrQDNhQRmZU0z3gP/iN12TKOEoulNzf9d58+fGd AxgHst1pYEFNPDzZGX4AbiVj24mK+FSXywwdZxT+9QeZ34mR1iFO3236QLYkrtGVTIXo E99w== 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 u15-v6si18149816pfa.28.2018.07.10.06.59.40; Tue, 10 Jul 2018 07:00:03 -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 S933628AbeGJN6n (ORCPT + 99 others); Tue, 10 Jul 2018 09:58:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53442 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933573AbeGJN6f (ORCPT ); Tue, 10 Jul 2018 09:58:35 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6ADtkjs005343 for ; Tue, 10 Jul 2018 09:58:35 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k4utrvxvw-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 10 Jul 2018 09:58:35 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Jul 2018 14:58:32 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 10 Jul 2018 14:58:30 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6ADwTMX7274662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 10 Jul 2018 13:58:29 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9CEAB11C054; Tue, 10 Jul 2018 16:58:51 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6F86211C04C; Tue, 10 Jul 2018 16:58:50 +0100 (BST) Received: from localhost.localdomain (unknown [9.195.22.129]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 10 Jul 2018 16:58:50 +0100 (BST) From: Sandipan Das To: acme@kernel.org Cc: linux-kernel@vger.kernel.org, jolsa@redhat.com, ravi.bangoria@linux.vnet.ibm.com, naveen.n.rao@linux.vnet.ibm.com, kim.phillips@arm.com Subject: [PATCH 4/5] perf tests: Fix record+probe_libc_inet_pton.sh to ensure cleanups Date: Tue, 10 Jul 2018 19:28:16 +0530 X-Mailer: git-send-email 2.14.4 In-Reply-To: References: In-Reply-To: References: X-TM-AS-GCONF: 00 x-cbid: 18071013-4275-0000-0000-000002970EF0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18071013-4276-0000-0000-0000379EAA67 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-10_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807100151 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If there is a mismatch in the perf script output, this test fails and exits before the event and temporary files created during its execution are cleaned up. This can be observed on a powerpc64 system running Fedora 27 as shown below. # 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 18655 ping 18674 [013] 24511.496995: probe_libc:inet_pton: (7fffa6b423b0) 7fffa6b423b0 __GI___inet_pton+0x0 (/usr/lib64/power8/libc-2.26.so) 7fffa6af90dc gaih_inet.constprop.7+0xf4c (/usr/lib64/power8/libc-2.26.so) FAIL: expected backtrace entry "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/power8/libc-2.26.so\)$" got "7fffa6af90dc gaih_inet.constprop.7+0xf4c (/usr/lib64/power8/libc-2.26.so)" test child finished with -1 ---- end ---- probe libc's inet_pton & backtrace it with ping: FAILED! # ls /tmp/expected.* /tmp/perf.data.* /tmp/perf.script.* /tmp/expected.u31 /tmp/perf.data.Pki /tmp/perf.script.Bhs # perf probe --list probe_libc:inet_pton (on __inet_pton@resolv/inet_pton.c in /usr/lib64/power8/libc-2.26.so) Cleanup of the event and the temporary files are now ensured by allowing the cleanup code to be executed even if the lines from the backtrace do not match their expected patterns instead of simply exiting from the point of failure. Signed-off-by: Sandipan Das --- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1220e5e052bb..0502a9e04c79 100755 --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh @@ -52,7 +52,7 @@ trace_libc_inet_pton_backtrace() { echo "$line" | egrep -q "$pattern" if [ $? -ne 0 ] ; then printf "FAIL: expected backtrace entry \"%s\" got \"%s\"\n" "$pattern" "$line" - exit 1 + return 1 fi done -- 2.14.4