Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5490781imm; Mon, 23 Jul 2018 00:03:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcOgzS2NddZqU8hOp5h7YfeqruPtzjAoEItVSTY12o7SO/RCi0kt2rFdAgCy/O8yZgOGeW5 X-Received: by 2002:a63:790b:: with SMTP id u11-v6mr10984482pgc.111.1532329410942; Mon, 23 Jul 2018 00:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532329410; cv=none; d=google.com; s=arc-20160816; b=KpTeuJ3s1A0YwjCjcuBtLjko14wo2q9yartblEMSCXvlLwq3EWW+zz+Gg7YjxDd/14 o1u1PGqnJSJyV3rj94DjJsy8Hwh9f0WOrxSjnGIQNMApjpHwEyD8up6ZhokF92sAM0je ecoDFD5efVQZC/qUfYvVL48/D+5wECM9qHkSQH3oArJAR1du4KbPZNlwQ2HhUMoy0Dg7 nYqQC6Cai3e1ZcS0hv5+5qXF+4bh9MRlc37v0dmuhOUQo4oJyE9/lHfZ6Cc0upuTGLR0 KrTo5dv2g3jL5NCJTBnj1UoNaskxn/4WhFQHPluleMPdKXJOJXugwhY6KIDvz6J9kemG tSAw== 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=LL+tXRISCKYWWJKCGSLX3+TR/qT9YHYzsUtc1aIrUqU=; b=xxLNKR+b6/FJieKK4AzEJ7tb4Q8SoHuw+B6tC15LgIc+1EnsXUfKNUTGch6VmfKfTg EJWtN0nRm/W6NDU/iIZ3DkSkUmN5rVIINJFbr3dI4mdCz8LvPzqYBuEIQoJ/x/T2W3+4 GiLcjOTX5xjCodx1uWij3Gyb1ObyJY7ActU+NhpUGtG6o6Swl5cZFeANxYo0DnhU/5Ub 3xy7zdfSDlIMUn/nev72loaAXocfmwaS+8L0j/Fg8DQVVUZYTKIFujkY6WvJ0zKspTFc bKEPVR7JoCVOtu4nZ0v7vb4nl72MrfMG3wMXXhdj1XisYHAVrqy4nJdeAXD7s0c9Dttj uZKw== 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 v84-v6si8189517pfd.71.2018.07.23.00.03.16; Mon, 23 Jul 2018 00:03:30 -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 S2387840AbeGWIBd (ORCPT + 99 others); Mon, 23 Jul 2018 04:01:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52928 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728188AbeGWIBd (ORCPT ); Mon, 23 Jul 2018 04:01:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6BF5077888; Mon, 23 Jul 2018 07:01:48 +0000 (UTC) Received: from krava (ovpn-204-187.brq.redhat.com [10.40.204.187]) by smtp.corp.redhat.com (Postfix) with SMTP id 55C96111CB8C; Mon, 23 Jul 2018 07:01:46 +0000 (UTC) Date: Mon, 23 Jul 2018 09:01:45 +0200 From: Jiri Olsa To: Alexander Kapshuk Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel , mingo@kernel.org, namhyung@kernel.org, dsahern@gmail.com, alexander.shishkin@linux.intel.com, a.p.zijlstra@chello.nl Subject: Re: [PATCH 3/4] perf tools: Fix check-headers.sh output file variables Message-ID: <20180723070145.GB7523@krava> References: <20180720110036.32251-1-jolsa@kernel.org> <20180720110036.32251-3-jolsa@kernel.org> <20180720145745.GB4329@kernel.org> <20180720151518.GC27176@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 23 Jul 2018 07:01:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 23 Jul 2018 07:01:48 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 Fri, Jul 20, 2018 at 06:22:49PM +0300, Alexander Kapshuk wrote: > On Fri, Jul 20, 2018 at 6:16 PM Jiri Olsa wrote: > > > > On Fri, Jul 20, 2018 at 11:57:45AM -0300, Arnaldo Carvalho de Melo wrote: > > > Em Fri, Jul 20, 2018 at 01:00:35PM +0200, Jiri Olsa escreveu: > > > > The warning message in check_w function uses wrongly > > > > the $file variable instead of $file1 and $file2. > > > > > > Humm, > > > > > > Before: > > > > > > Warning: Kernel ABI header at 'tools/arch/powerpc/include/uapi/asm/unistd.h' differs from latest version at 'arch/powerpc/include/uapi/asm/unistd.h' > > > > > > After: > > > > > > Warning: Kernel ABI header at '../arch/powerpc/include/uapi/asm/unistd.h' differs from latest version at '../../arch/powerpc/include/uapi/asm/unistd.h' > > > > > > > > > The previous version is better, I can then just use: > > > > > > diff -u tools/arch/powerpc/include/uapi/asm/unistd.h arch/powerpc/include/uapi/asm/unistd.h > > > > > > and get what changed, with your change I have to go to tools/perf before > > > doing that diff, which is an unnecessary extra step in at least my > > > workflow. > > > > so all paths output based in kernel tree root then, will change > > > > jirka > > I was going to ask about this in a separate email initially, but then > thought I'd use this email exchange instead, as my question is about > the code in question. Hope you don't mind. > > If I'm reading this right, the intended behavoir of the block of code > below is to test file2 for existance, and if it exists, to evaluate $cmd. > If file1 and file2 are found to differ, print the warning. > > test -f $file2 && > eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file' > differs from latest version at '$file'" >&2 > > The '||' path of execution is however also taken if file2 doesn't exist, > which is probably very unlikely to happen. 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' > > Is this something you would rather leave as is, or perhaps use something > along the lines of the code below instead: > > test -f $file2 && { > eval $cmd || > echo "Warning: Kernel ABI header at 'tools/$file' differs from latest > version at '$file'" >&2 > } hi, yea, probably.. please feel free to post a patch.. just make sure all the displayed files paths are based on the kernel root thanks, jirka