Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2500722imm; Mon, 24 Sep 2018 05:32:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV60WrWbMWYrEVTy/Q5bpD9Jg0Hdwd5SzwOAwLcelsylgMO6sRdFlcGgldngTPDNUoA71FSK/ X-Received: by 2002:a17:902:aa47:: with SMTP id c7-v6mr5138718plr.100.1537792339709; Mon, 24 Sep 2018 05:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792339; cv=none; d=google.com; s=arc-20160816; b=zS0kDDIBe9ArxJvmNWSxjZOWgSWt/LXnP0Roq6rdExW7rWUspn+OEgNU2DimN40JjT z+m2CJulQkO+piaa7pqXWrFwSjM6dQ0rzNIV38iopHPoMtWCBPsA2nmpz83UMFOe1b0d LRLVYhkZpMQYEs4t56e8urD0sbJlizpi59CGevi8LcUJ0+b7lznrPGl4VynxzikfBsPF aec6s5Rw4TSOU8SkTVqExc3pzQ9g5+aodep0M/wlQ8aRUFkV8uUMhzgLZKopCe9ScTdM gpL/iPHFsNdBsezw8TKwfffpNcaHem4BcgSpgt7yPLTNcCTBjma84NpFYfEIr7uHPhU4 y4IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=hE6eMXeDoY5tC8fh60ZKEhJBXsktuIuhowP5u94XdkM=; b=zYFho07OLyvbw1dec8m2FQKzfxJXYW5MtpptJgJDz38vpQJ4kK3pzo1Rj0MBfNpS8g MvRrrCfNIR2TGs6HnYcbFmeIBCVWzcTJZm6OOcDrrasGqVpwSPwjEM826PRz8yZ3PmJW Dx5Q5OdNwZOs+4BAtJ1KxZj1/Re6LodL+y59HjgUNz6jxLC9G4rafoGIe6Sd4GfLhPji Ux+F/nxlnwNPcBuiVROlhvLZYZ7dKHdu+hXLRl9zOiK0o12dzQOpzR0Wii0QCyB1Oehz rD443HHd0genK01QBb4QYIOhqcfxYGN0miqQS3EUQdB6JRPNwEygeay79S7yWhsxBck6 m4Sw== 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 w9-v6si36365060pfg.234.2018.09.24.05.32.04; Mon, 24 Sep 2018 05:32:19 -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 S1733254AbeIXSbZ (ORCPT + 99 others); Mon, 24 Sep 2018 14:31:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57622 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732800AbeIXSbY (ORCPT ); Mon, 24 Sep 2018 14:31:24 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 14F8E1099; Mon, 24 Sep 2018 12:29:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sandipan Das , Jiri Olsa , Kim Phillips , "Naveen N. Rao" , Ravi Bangoria , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.18 050/235] perf tests: Fix record+probe_libc_inet_pton.sh to ensure cleanups Date: Mon, 24 Sep 2018 13:50:36 +0200 Message-Id: <20180924113110.176835908@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sandipan Das [ Upstream commit 83e3b6d73e66a10088f362b08b99c36fec3a14e7 ] 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 Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh @@ -65,7 +65,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