Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp909141imm; Wed, 15 Aug 2018 08:10:01 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw1qjHoD2dUs7T2tLMkC0WGGT1+mvuaFIDUSUO5lWcGTqTKdcwN5EUfhY9X6hnfWQXyQaez X-Received: by 2002:a63:1722:: with SMTP id x34-v6mr25571799pgl.268.1534345801463; Wed, 15 Aug 2018 08:10:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534345801; cv=none; d=google.com; s=arc-20160816; b=kBs3TSq77RAhZjH8roEsZERVvq+LePZYMPpYrdmsWcmdSVpKjK1Mjf64tSHovlq7E5 auiUviV1ueuHuwoSY+ozFxVOeJ9016jUux2bCjz8p/Jx+nqlQ4oPOmLqScXXecOmuZLL APEE9j8jlXBfaFjIL4ZQPejpYLu8WUz/24HlbU+1dEalZb2qiv9cP5tc38/zxoCwQxQR QO0m4uyMEMxMN9PcSOlMQON+z9dJrnJLPavItVJzzcoUBORZwZw+EZ0KNQwFd7W1GPif nrjWIWroW8/wZcLsQO1oSEiQWoeN66F9EnsxH9rkR2LbUY5wlYer/MSiVHMjjQu9gD4S g/2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ZVCJqgu5omywbcc3l4BmrUFSdfj0NFBCXl32r5miShE=; b=RQWUlavpiCSEYTsatknmj12UwqsMrOI9iS10/YiFwqBhRcXJJLnMFpIsfZKLRQUkfe XcsWnl0pjTt0sSwY4AGh+cb+zX+ZhoSoe3ZrDxn/JrJhbe0t6zOmtLdqlmUUfvbgRYe4 1bKExBkEUWzMGcxGApN+aNawt20xiCFXogrAL4ZziLBls/0IVip0tWYXKWqhaaZsB92M 0bp1EkE/T7VIChQzfnIvui1K6jSPywmYFwpX/1b+Em/nSy5RDdg7ITghUn0kPl1/i3Ly yEXEdslvEvogIRToz9zCWCm+KoovrLxiC0sme8rpkkPDMcswmYxFCGzR6F6LXQIH4vDF ++xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OdtWUzUF; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s27-v6si21268791pgn.159.2018.08.15.08.09.46; Wed, 15 Aug 2018 08:10: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; dkim=pass header.i=@kernel.org header.s=default header.b=OdtWUzUF; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730647AbeHOSA7 (ORCPT + 99 others); Wed, 15 Aug 2018 14:00:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:50852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730599AbeHOSA7 (ORCPT ); Wed, 15 Aug 2018 14:00:59 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 82FE5214F0; Wed, 15 Aug 2018 15:08:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1534345706; bh=56fEHwCh7wLt1n9JjGbZCQjb93VGGy4Bm2cqtR2vyF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OdtWUzUFCE+XVW1xkSerIOxGrpu0tN/54J0oLAsm/Xi+ZXmjOK4TnHlthCnxdTfnS EYjFYh8SqOgw0N31/u+5UfldGuPtu9vpKf7pqvr+Blp9nFuj/v7VVIUF2mGgtgcOAl nR6nt25Lpl2qPLjqB6fk+Xb7uYFHIFId8fwFn8rc= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Alexander Kapshuk , Alexander Shishkin , David Ahern , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: [PATCH 27/35] perf tools: Fix check-headers.sh AND list path of execution Date: Wed, 15 Aug 2018 12:06:03 -0300 Message-Id: <20180815150611.32080-28-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180815150611.32080-1-acme@kernel.org> References: <20180815150611.32080-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Kapshuk 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 Committer testing: Remove a line from that tools/arch/x86/lib/memcpy_64.S file to test this: BUILD: Doing 'make -j4' parallel build Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S' diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o Signed-off-by: Alexander Kapshuk Tested-by: Arnaldo Carvalho de Melo Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180811083915.17471-1-alexander.kapshuk@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- 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.14.4