Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2998262imm; Fri, 20 Jul 2018 08:25:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc+nHOJRGbRiLkFgCM8ak+4ySp7J42Wo/kuAN2qzifz1MrhmObqyr/n3V5PWDkHKY/0A8LO X-Received: by 2002:a17:902:3081:: with SMTP id v1-v6mr2595726plb.266.1532100316856; Fri, 20 Jul 2018 08:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532100316; cv=none; d=google.com; s=arc-20160816; b=kSBLnTRq8IwfxKZDDJDv3b61bNLL/u8QJiZsyZLRfvR9zCVcmYA685+67vR3xaYh3m SSHfMhOnniQGQYWNiOVDa+DA7yWBsf6SuZRjLtAGv1Pu7kNudpAlG/rDCc8OaspCVJi2 k74hKLFa1cYz4+wC+Gj0xD0UhaUTGB6VwPgfebsvDTkbHAT7UqQxX1nLjaqJ6D7CAiyU Knlw5Ny5KqjRzcOVWVPGKBVJvjKFCynqXAcosPsor0qiSZbrozz0kw+zJstiFzjD4PC5 WH+jWepYek7XusIyLRsQqvg9hvNssGsXJx8dhlbdNdAn/LM/FwMw+W3j7evNBz/1iMOR JJXg== 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=3Millr4p7z4Lx1AraIxVV5LY7eRZTQ5E0LQzAp7Vgbg=; b=pMIvqmI3AQ7Lk3KlYAZSC+RhIqeDXLaJwUqezDuMaybn21yiHku2pLoEw3WUwDxQ+y +e2a6Q8lGYmb7TfJPjDVhxtu93QzKgX8uwOVeUDX58bd5piCz8Hlbx+DzeNZahcSYU6O L1gfFfWUkytkx6k0hDtj/a99SJEM4a1wIrN1iGwqUCyCgTKSvGPzxdCup7WozByxLFUy oNJs0k6HbmzbqGafqI01GzWWxqKDTSC1kzxBggYKM1MFL6I2TLDMswKBrr/IdA/22S8j 4HpMvBKSaDBVRhlr8G72IG1OMG0l/BKlPH9ZFQPhDaCHmCM5MVQb3mzjiuvj/GyENFm2 QfLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JwH8Nuaz; 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 c16-v6si1884440pfn.212.2018.07.20.08.25.02; Fri, 20 Jul 2018 08:25:16 -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=JwH8Nuaz; 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 S2387810AbeGTQMN (ORCPT + 99 others); Fri, 20 Jul 2018 12:12:13 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:53275 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731792AbeGTQMN (ORCPT ); Fri, 20 Jul 2018 12:12:13 -0400 Received: by mail-it0-f66.google.com with SMTP id 72-v6so15171432itw.3 for ; Fri, 20 Jul 2018 08:23:26 -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=3Millr4p7z4Lx1AraIxVV5LY7eRZTQ5E0LQzAp7Vgbg=; b=JwH8NuazhS94612cBdudIqw50178aO+DsTQtxj2EBxPDxHARnxn088pLcYZy3syTP4 5s5a5LEfa87pZ+zuHd/L2hjiztJb2wJP3zT1or0PqMhwBdHR39zs7tXCR2kaF73Po8FM wmbhFD/V57l88xpwQxAvIVD1OHl2vf2bOYjqYFg4LEW+rDV73GTerNKM2YpFdlFsu5t2 KEfsUGTRSnvOmZKfl0MGVuAf9mWJz6U9vSEioMER46W9CN6xNvHLgmyinIE+G/kAPNTx Nxoll752QUvrLiE6rbAaLhcnqQ/SCvRUSSFiCo97z0wKXvSAAVd0WA2Fe6fn6Ly00rhv Xugw== 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=3Millr4p7z4Lx1AraIxVV5LY7eRZTQ5E0LQzAp7Vgbg=; b=esnFvOsRWl/3KW3PwLBr581Sp4J4BcpXu11461sOuteDd3rhvIujTJMx89AUA3BnoF RLEsrSKhJw08bt0WxUlpBgW78d7loOSGYBFwQ0uPEBAAmTNZH4Cv/gnXo0qgRw4nonzr Q3kTi64KMWuNcp/ShyHVeRBqAJONmbKhOwRYIolHmpK9JwHgQh1z9GXDoqka0TczUuHg t5dxTyLoLTywtXLcfP++BmdMrVNQgR1TJtLOEG0tQPoX9egYIo0Yqd09RTy8UNphV83c vB23tN84V99YfgrL2lfS2KV4Pq/RIJZWRSH8tWqle6G+cDSNsAII+1oiIK8eI+ahx+av aqSw== X-Gm-Message-State: AOUpUlGi7xZHe+rYEWmkX/egPdt0PafaeI1qkgy9B3AJnmjObL4EGkes Arn+tnvJRJHjXDizNKVaEpFa5HagCgbtQE1YEnQ= X-Received: by 2002:a24:dc07:: with SMTP id q7-v6mr2239757itg.147.1532100206057; Fri, 20 Jul 2018 08:23:26 -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> In-Reply-To: <20180720151518.GC27176@krava> From: Alexander Kapshuk Date: Fri, 20 Jul 2018 18:22:49 +0300 Message-ID: Subject: Re: [PATCH 3/4] perf tools: Fix check-headers.sh output file variables To: jolsa@redhat.com 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: text/plain; charset="UTF-8" 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 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 } Thanks.