Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1217800imm; Wed, 25 Jul 2018 13:47:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd0RzOSlfpCLYniP7OYKfzQ74XxhD7m/lOXCCOtuTY9IqJMhg61kCrzBVbQPfqPXhvzt6gT X-Received: by 2002:a17:902:4081:: with SMTP id c1-v6mr22315657pld.169.1532551672216; Wed, 25 Jul 2018 13:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532551672; cv=none; d=google.com; s=arc-20160816; b=SClEx/fMZaZ6m46U5QX/P5Y8PNDPq1vOEx6Vm1SFVtSa49jjqy7CMGOcrMd3Pkq1tp fRRQ/Jj43bgHP5ApkDcakAhBnTj0xPUPxqTqwCRX9Z2s4eANd/llZSDQa4ZueuYPMQ++ Mzr81QWw+rJ8ihMJPgGGhuh3j8rY6gXKCG/mYr8Dc2rZdR7kxaxVk89550oAgZlZQuDZ UucFu6ZEaV4/JwuF9qJ9JAzmsneAj+cEKRrGakW2Wmh5nePx3SvVnovXhsA5O1i4FMwp /fHBbrCvFBazoGDj8hl+iSJSUsvp3RqfGKlOKzW4YuYPmFbyRTbb5NXfNj6Qvszx15fj 839g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=eJQCtEbkrPBPFENDlm6C9riZurPTzh4UYRrjaREpn4U=; b=ZqOSSwdP+qnd1oFKt9MHMdP7aX5uwl9sclKoCqdi0D0OZ1FCPCTVjkY8OsiTEijOXs eBvvjGi5D0KmG51wAEWd7YwyFxpvpuBHH83M6TmuexzK3bzULufx0k+FzJH8CuUuy1OJ BWbS7jmG0la4GY82W+HAiqeyt9HEKpi2idZqIj7WC/pBNYqwUD9NToCrlIE7yNeUZGb7 3oVYmMLWIhpdM38bnrqDJrsPoWSZ9BbfNhvUdjofBvVDjzInAeSeLvrIPbAZifRKWJ0K XxRPRWtQq3sQIM6CdBYVegO9DBjR2tLp8TVBt0rKIMFIhDUoFBe91/KyIlKjLqDJgAlm 3r9g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j21-v6si14767400pgl.8.2018.07.25.13.47.37; Wed, 25 Jul 2018 13:47:52 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731495AbeGYWAN (ORCPT + 99 others); Wed, 25 Jul 2018 18:00:13 -0400 Received: from terminus.zytor.com ([198.137.202.136]:46391 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731168AbeGYWAN (ORCPT ); Wed, 25 Jul 2018 18:00:13 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6PKke00500828 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 25 Jul 2018 13:46:40 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6PKkeK3500825; Wed, 25 Jul 2018 13:46:40 -0700 Date: Wed, 25 Jul 2018 13:46:40 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Sandipan Das Message-ID: Cc: hpa@zytor.com, naveen.n.rao@linux.vnet.ibm.com, tglx@linutronix.de, sandipan@linux.ibm.com, linux-kernel@vger.kernel.org, jolsa@redhat.com, mingo@kernel.org, kim.phillips@arm.com, ravi.bangoria@linux.vnet.ibm.com, acme@redhat.com Reply-To: kim.phillips@arm.com, ravi.bangoria@linux.vnet.ibm.com, acme@redhat.com, tglx@linutronix.de, naveen.n.rao@linux.vnet.ibm.com, hpa@zytor.com, linux-kernel@vger.kernel.org, sandipan@linux.ibm.com, mingo@kernel.org, jolsa@redhat.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tests: Fix record+probe_libc_inet_pton.sh to ensure cleanups Git-Commit-ID: 83e3b6d73e66a10088f362b08b99c36fec3a14e7 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 X-Spam-Status: No, score=-0.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_48_96 autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 83e3b6d73e66a10088f362b08b99c36fec3a14e7 Gitweb: https://git.kernel.org/tip/83e3b6d73e66a10088f362b08b99c36fec3a14e7 Author: Sandipan Das AuthorDate: Tue, 10 Jul 2018 19:28:16 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 24 Jul 2018 14:52:09 -0300 perf tests: Fix record+probe_libc_inet_pton.sh to ensure cleanups 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 Cc: Jiri Olsa Cc: Kim Phillips Cc: Naveen N. Rao Cc: Ravi Bangoria Link: http://lkml.kernel.org/r/ce9fb091dd3028fba8749a1a267cfbcb264bbfb1.1530724939.git.sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- 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