Received: by 10.213.65.68 with SMTP id h4csp40464imn; Mon, 12 Mar 2018 06:07:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELvBLcMckIXMuqVCUnMMBC329oeOQPD4U9h+w7Sx8ixSWJNjX1+Ycp8l8qPnijxLnK7trDXs X-Received: by 2002:a17:902:aa83:: with SMTP id d3-v6mr8051582plr.36.1520860021125; Mon, 12 Mar 2018 06:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520860021; cv=none; d=google.com; s=arc-20160816; b=oI9bFJchejby+lcDPJQydegPY6EEOSJCwdK9uNPoE1RdSVV8vbS5oQhAARssA5pHn0 pNJ9cRiCgxfFH0Xp58aayO5sf8HD7XVu8VKWnwKE+oQ64S95OoSKrAHkGJR2tITg5R1s UFyUfK42by1tkQiBHS/oWzSV/DlvMwNeiQbJBo10moJkDfCAtq4rwr76Wdc3xL0B+Ju8 elTHwNQKEiDATNhx/abobNSMnzVtyfIvUM+lO8VhvNoQwWociJ6/gjXqQ5cGbpZzl6su kIBhpE3LUaR8sUvOW4bQZ7awdJ3Tdf5ob+s3WT+pcm0B7u0OnBrk5RT3ir3r7+ShffkX 1Qvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=fKHeQg+6o0b1G0ju49p+SHth4FWSbo1Fq1TEllgOrOk=; b=z/9fscWRTLfA3XgKnQU6Ljyw9Fbzg7sUx3mMLypPcPFmFDO9MRxnlKX+bGQuiz8uqM kltJXA/cybXFf5bZhuGJantqdQZBqIYwWjF2UXs3WoHcvygw8gw2HlGW8MNf4cGogpJ/ hXncBdBAEoMcZgBrRkYutHtob4S+uppgMLOUUbeDA+cbVaRjftw4i2/Pz9WwJUDp8wiJ QfCJZ5Mb9v9HfZKlRXBNm2+YcepoJbQ9JWwq5kGFZylgv2JEN8LWpE8F5qIY+dl7j2pD 5ubYSNSsHERbXgS4mlRcXslHwFyLtTfDvJsi2/Hc0U5bnlxDsmc2k+oI/87YVJn6obYV apKw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r62si5025861pgr.77.2018.03.12.06.06.46; Mon, 12 Mar 2018 06:07:01 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751315AbeCLNFu (ORCPT + 99 others); Mon, 12 Mar 2018 09:05:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44050 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751104AbeCLNFt (ORCPT ); Mon, 12 Mar 2018 09:05:49 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECB904067F25; Mon, 12 Mar 2018 13:05:48 +0000 (UTC) Received: from krava (unknown [10.43.17.142]) by smtp.corp.redhat.com (Postfix) with SMTP id 1B39263537; Mon, 12 Mar 2018 13:05:47 +0000 (UTC) Date: Mon, 12 Mar 2018 14:05:47 +0100 From: Jiri Olsa To: Sandipan Das Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, naveen.n.rao@linux.vnet.ibm.com Subject: Re: [PATCH] perf test: Fix exit code for record+probe_libc_inet_pton.sh Message-ID: <20180312130547.GD23111@krava> References: <20180312124450.30371-1-sandipan@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180312124450.30371-1-sandipan@linux.vnet.ibm.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 12 Mar 2018 13:05:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 12 Mar 2018 13:05:49 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 12, 2018 at 06:14:50PM +0530, Sandipan Das wrote: > This fixes record+probe_libc_inet_pton.sh from always exiting > with code 0 and making the test pass even if the perf script > output does not match the expected pattern. > > The issue can be observed if this test is run with the verbose > flags as shown below: > > 60: probe libc's inet_pton & backtrace it with ping : > ... > ping 19602 [006] 16988.413767: probe_libc:inet_pton: (7fff9a2c42e8) > 1842e8 __GI___inet_pton (/usr/lib64/libc-2.26.so) > 130db4 getaddrinfo (/usr/lib64/libc-2.26.so) > > FAIL: expected backtrace entry 3 ".*\(.*/bin/ping.*\)$" got "" > test child finished with 0 > ... > probe libc's inet_pton & backtrace it with ping: Ok > > Fixes: e07d585e2454 ("perf tests: Switch trace+probe_libc_inet_pton to use record") > Signed-off-by: Sandipan Das > --- > tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 5 ++++- > 1 file changed, 4 insertions(+), 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 52c3ee701a89..1ecc1f0ff84a 100755 > --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh > +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh > @@ -47,7 +47,10 @@ trace_libc_inet_pton_backtrace() { > [ -z "${expected[$idx]}" ] && break > done > > - rm -f $file > + # If any statements are executed from this point onwards, > + # the exit code of the last among these will be reflected > + # in err below. If the exit code is 0, the test will pass > + # even if the perf script output does not match. right :-\ but we still need to delete that $file.. I assume it will get delete by the 'rm -f ${file}' in the script main body? thanks, jirka