Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6660426imm; Tue, 24 Jul 2018 00:21:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdz0EpAH9UjzDw3GErp1/J3AUxKGK4RaoqDiFhAmWp27aKGsAXVz9cv5s8ArbOosROGhieh X-Received: by 2002:a65:6110:: with SMTP id z16-v6mr15530527pgu.412.1532416891798; Tue, 24 Jul 2018 00:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532416891; cv=none; d=google.com; s=arc-20160816; b=QrvLZw3BXLKQ+LZKltUT6/w+K3Hf5NNqcRoDz4jAs8jhWNO/fFcTuCzLO15PBdYH40 ATARffflmGVQCIvfiVc0cr0sxXgXGqJ+YK52Uo7Du6uWErbSpaM3MA6RVHN/Fq/EVT/j aS6lvZoQyKTL7aBm6ZjxjCwtASBBxwXzzwfaz0LtvvUSzMGAjU6wswshgT9UgysVL6jt DdwlXbqW9ltvuSoBNqNa0i8OeqbjwN6IMp2wQrM1wQJEoLYy+ysPzOpOtqL/eozmJHt5 b3DAdIgFWCU/oSFQzPfY0MOAEfUcGx+CPOfloBi0bCNDOC9H50F3j3e2CqaSjzZmKE6U xIqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=AJtMKDJ6Ay1zeFZsPR9mMrMUjjzCwR11hiAGTAFbyYg=; b=egBvwmscrT4ADS6hWjC3z8vLTZ81RM/wBTF58nCeTIJX9UOhXWT2uc3air1s71cosy Xyoq+ZQDILCvaKq+PchW+eBb+94/ZsA61GWRY3lBYaEvAhpbe5eLw/MX0SKN0YGxyWrF f+LMaM872NM+h9xKhOfNHOvybNMfXIDKEUMZku6tE+xMfYz9rtIDCZSZ4rEzNw59HatS 7CAttBhMBuVWbwHzrdpQtF4pjVi6WSARjC6wt5C81R+CVwBL1UosNRHwkFTYsYfwXVW2 uQX+YkQ1SOZViJOkWdtoSPHmhSab5p83sXrlKjUSJhp10N5/njNNvemWKBui+HIwNMOx acMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fYyZzAHd; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2-v6si11683246pfs.2.2018.07.24.00.21.17; Tue, 24 Jul 2018 00:21:31 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fYyZzAHd; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388458AbeGXIZY (ORCPT + 99 others); Tue, 24 Jul 2018 04:25:24 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:54816 "EHLO mail-it0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388383AbeGXIZX (ORCPT ); Tue, 24 Jul 2018 04:25:23 -0400 Received: by mail-it0-f49.google.com with SMTP id s7-v6so2427415itb.4 for ; Tue, 24 Jul 2018 00:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AJtMKDJ6Ay1zeFZsPR9mMrMUjjzCwR11hiAGTAFbyYg=; b=fYyZzAHdTj+c3GCZf9ykNR/Bx9gu/W4TqWNUM/8+lW1dlgmU3ui7Lptag1u11FW1Qk 2HoiU7ViNl1pJ3KH/NUsrZK8/OcLbLolBVYo8WZeL/LiOK6D83ytiFeYbvZt5F0c7f/x DpVTcU4uh/aBDvbZQOYdsub4JiO7X1Lc0MxcpL7Fge6Uf4vGNd4ZRP+zABfmFMiXSsoW gm1xwxb1i0L9NQblk7ugkrS/S0mTpFhk9JRyxxJQXZ4EwlY4APPNgR+/QoW6EKL2V0UN 3CWsWcI2lA7Dv4Y8mGvl89QZ5MwtKpa5puMB+twLwvOnX/nDFGon+ixfNA3LDhJUNxUT NR5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AJtMKDJ6Ay1zeFZsPR9mMrMUjjzCwR11hiAGTAFbyYg=; b=Tgprf8mVc2K3eGRFS/7yrIl9m4njn/QT6e0hURPuWsM6oLvHmBPXAYti+17bDot4pc 0rMMybK4mD8O7WEUS/20NGsiRNXsW/wFGwjPPSt7+PRxgpwvRi2jzhaj2aGVVlJJnZiU icycLcYQpLTQeSrmhtyBgNPUdxEAsWed7I4nqncx0TR3GV5gAAFH2wTqMVUa5vpw93fp yhMwYjuFFo3ODa+enKI7N2oCfJSEQDdS9tIsDpMBxIgiUZGJC8hTlChdmhppdP36HciL tSTaWOssBr45DrQVhPpwEtws3rd/SXz00HXR91Bnbkce4d1MLRY+iE2g4LZ5o+7NbtMi fWrw== X-Gm-Message-State: AOUpUlEMlpM54STKeV5+p1VTI7tv6IK5rtfwzmvyMgJmrx0z5rNDiGf2 g65X5JFolb5oj2WOFL1sShatf+SuXaSRmqftoJg= X-Received: by 2002:a02:9bc1:: with SMTP id f1-v6mr14640927jal.90.1532416820635; Tue, 24 Jul 2018 00:20:20 -0700 (PDT) MIME-Version: 1.0 References: <20180720110036.32251-1-jolsa@kernel.org> <20180720110036.32251-3-jolsa@kernel.org> <20180720145745.GB4329@kernel.org> <20180720151518.GC27176@krava> <20180723070145.GB7523@krava> In-Reply-To: <20180723070145.GB7523@krava> From: Alexander Kapshuk Date: Tue, 24 Jul 2018 08:20:07 +0100 Message-ID: Subject: Re: [PATCH 3/4] perf tools: Fix check-headers.sh output file variables To: Jiri Olsa 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 Content-Type: multipart/alternative; boundary="0000000000003dfe120571b998b2" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000003dfe120571b998b2 Content-Type: text/plain; charset="UTF-8" On Mon, Jul 23, 2018, 08:01 Jiri Olsa wrote: > 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 > I'm away traveling till August 10th, and I may not be able to send the patch in until I get back. Is that OK? Thanks. --0000000000003dfe120571b998b2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, = Jul 23, 2018, 08:01 Jiri Olsa <jolsa= @redhat.com> wrote:
On Fri, = Jul 20, 2018 at 06:22:49PM +0300, Alexander Kapshuk wrote:
> On Fri, Jul 20, 2018 at 6:16 PM Jiri Olsa <jolsa@redhat.com> w= rote:
> >
> > On Fri, Jul 20, 2018 at 11:57:45AM -0300, Arnaldo Carvalho de Mel= o 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/includ= e/uapi/asm/unistd.h' differs from latest version at 'arch/powerpc/i= nclude/uapi/asm/unistd.h'
> > >
> > > After:
> > >
> > > Warning: Kernel ABI header at '../arch/powerpc/include/u= api/asm/unistd.h' differs from latest version at '../../arch/powerp= c/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/po= werpc/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 le= ast 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<= br> > thought I'd use this email exchange instead, as my question is abo= ut
> the code in question. Hope you don't mind.
>
> If I'm reading this right, the intended behavoir of the block of c= ode
> below is to test file2 for existance, and if it exists, to evaluate $c= md.
> If file1 and file2 are found to differ, print the warning.
>
> test -f $file2 &&
>=C2=A0 =C2=A0eval $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 does= n't exist,
> which is probably very unlikely to happen. See below.
>
> % file1=3Dfile1; file2=3Dfile2
> % cmd=3D"echo diff $file1 $file2"
> % test -f $file2 &&
> eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file= 1'
> differs from latest version at '$file2'" >&2
> Warning: Kernel ABI header at 'tools/file1' differs from lates= t
> version at 'file2'
>
> Is this something you would rather leave as is, or perhaps use somethi= ng
> 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..=C2=A0 please feel free to post a patch.. just make sure all=
the displayed files paths are based on the kernel root

thanks,
jirka

I'm away traveling till August 10th, and I may not be able to send= the patch in until I get back. Is that OK?
Thanks.<= /div>

--0000000000003dfe120571b998b2--