Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2999850imm; Mon, 13 Aug 2018 04:23:55 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy0GGOTc0DlFhmkuxFYBP2STCS8A8ktwEEGWm9fZezh6FmSwJutgK5dQpQfiaNWH/PMn83c X-Received: by 2002:a63:524e:: with SMTP id s14-v6mr16922820pgl.35.1534159435113; Mon, 13 Aug 2018 04:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534159435; cv=none; d=google.com; s=arc-20160816; b=Wjtt3k0pyPonXxO8nMvrOfaJV5Lh29VJzmO0tJ64M0EWv4U4dAAmYFuzSbfaOvoVks 6+a2t/96Naq1j+bvHxL+6rBloTX6+XuUibkENPcTIfJ0TEgL9LZnZ/SYzCpwdVou5QrO 9LRlSGWsBeQz9/sweaNGjCCUyPOUP9FJEaZGfP6SIT/H41a5fXfClIKxXPMqVa3+AoF4 P6kuWJQESn/THXFerfixSfcndZPSwDa8SOhEYitIoVXcpsojer3UwK/ZZdFrPoW9WnX7 hUc7m2pBEBbX//tv4joB811w5rKdmBGmZNUrqR0VgJya4VgI7vBFlR8mHbttTYJZk/6i 0d2A== 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=MQSIU267YNg1gmgtSD9Aeh99GXp3ZgIUoJQNaOv9cq8=; b=NZAviPFEKYxqYPJOvyK4vE6xxdqvKLn6+r/Z7Tap9cj+bSdILrVat1v9K6v4Tq2rjW wU6n04dwbKwkgIioMhJ3V4ldsoU8bWxJCVaNCmdeMioJ1QNOXsxJSbpS404TRAkWG282 6iZWsG6FSbbiC2/TbuQoSA1qAU9m4/gmbavPmS2NUSGCheDqu6DvcYS7oCvmzGergwqs a5wCrde6cbw06D16ROwzaa7yf8p1Dy8pQm0DnWs0CsvFqzLzMs3ZPKaxVdcIiMhG6k+D LXAGSDyoN+t0flz/7NU/O17hV/8/LIuUytyK9/a5J0jd1CAF5WequpMDWUkLiTyi4B/t xpeA== 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 p1-v6si9335008plk.294.2018.08.13.04.23.39; Mon, 13 Aug 2018 04:23:55 -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 S1728704AbeHMN6W (ORCPT + 99 others); Mon, 13 Aug 2018 09:58:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58458 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728055AbeHMN6W (ORCPT ); Mon, 13 Aug 2018 09:58:22 -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 A5060400138A; Mon, 13 Aug 2018 11:16:33 +0000 (UTC) Received: from krava (unknown [10.43.17.217]) by smtp.corp.redhat.com (Postfix) with SMTP id 374C51C59E; Mon, 13 Aug 2018 11:16:32 +0000 (UTC) Date: Mon, 13 Aug 2018 13:16:31 +0200 From: Jiri Olsa To: Alexander Kapshuk Cc: jolsa@kernel.org, acme@kernel.org, mingo@kernel.org, namhyung@kernel.org, dsahern@gmail.com, alexander.shishkin@linux.intel.com, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf tools: Fix check-headers.sh AND list path of execution Message-ID: <20180813111631.GA718@krava> References: <20180723070145.GB7523@krava> <20180811083915.17471-1-alexander.kapshuk@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180811083915.17471-1-alexander.kapshuk@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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, 13 Aug 2018 11:16:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 13 Aug 2018 11:16:33 +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 Sat, Aug 11, 2018 at 11:39:15AM +0300, Alexander Kapshuk wrote: > The '||' path of execution in the 'test' block of the check_2() function > may also be taken if file2 does not exist, in which case the warning > message about the ABI headers being different would still be printed > where it should not be. See below. > > % file1=file1; file2=file2 > % cmd="echo diff $file1 $file2" > % test -f $file2 && > eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file1' > differs from latest version at '$file2'" >&2 > Warning: Kernel ABI header at 'tools/file1' differs from latest > version at 'file2' > > The proposed patch converts the code following the '&&' operator into a > compound list to be executed in the current process environment only if > file2 does exist. Should the files being compared differ, a diff command > to compare the files concerned is printed on standard output. E.g. > > diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S > > Signed-off-by: Alexander Kapshuk I posted follow up patches based on this one as a reply on this patch for this one: Acked-by: Jiri Olsa thanks, jirka > --- > tools/perf/check-headers.sh | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh > index de28466c0186..ea48aa6f8d19 100755 > --- a/tools/perf/check-headers.sh > +++ b/tools/perf/check-headers.sh > @@ -67,8 +67,12 @@ check_2 () { > > cmd="diff $* $file1 $file2 > /dev/null" > > - test -f $file2 && > - eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file' differs from latest version at '$file'" >&2 > + test -f $file2 && { > + eval $cmd || { > + echo "Warning: Kernel ABI header at 'tools/$file' differs from latest version at '$file'" >&2 > + echo diff -u tools/$file $file > + } > + } > } > > check () { > -- > 2.18.0 >