Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42FDECD6E72 for ; Wed, 11 Oct 2023 13:46:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:in-reply-to:message-id:references: mime-version:subject:reply-to:sender:list-id:list-help: list-subscribe:list-unsubscribe:list-post:list-owner: list-archive; bh=p6UCNceHOuV04IW+X+h7Oj6O5SM6pFqNphUsXx7LFEU=; b=lFDXLzIPK33moOrTooj5vAkMeE77kgOObBXbKhNeNiOdI+PYXE/w/2x3 gOm6KalTwMvLIMV4tFvJ082ev0EqljvgCnz9r0zVa123+7SHuPGcW7ZLU 7xPq8pcJ4RwXBsUTMdXsroOfI3ItB8XFlgZqSNWSkDeEP2z+qII9FgTjD Q=; Received-SPF: Pass (mail2-relais-roc.national.inria.fr: domain of cocci-owner@inria.fr designates 128.93.162.160 as permitted sender) identity=mailfrom; client-ip=128.93.162.160; receiver=mail2-relais-roc.national.inria.fr; envelope-from="cocci-owner@inria.fr"; x-sender="cocci-owner@inria.fr"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:128.93.142.0/24 ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:89.107.174.7 mx ~all" Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@sympa.inria.fr) identity=helo; client-ip=128.93.162.160; receiver=mail2-relais-roc.national.inria.fr; envelope-from="cocci-owner@inria.fr"; x-sender="postmaster@sympa.inria.fr"; x-conformance=spf_only Authentication-Results: mail2-relais-roc.national.inria.fr; spf=Pass smtp.mailfrom=cocci-owner@inria.fr; spf=None smtp.helo=postmaster@sympa.inria.fr; dkim=pass (signature verified) header.i=@inria.fr X-IronPort-AV: E=Sophos;i="6.03,216,1694728800"; d="scan'208";a="130688645" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 11 Oct 2023 15:46:42 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 2A902E0CD5; Wed, 11 Oct 2023 15:46:42 +0200 (CEST) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id D1D1CE00B7 for ; Wed, 11 Oct 2023 15:46:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=p6UCNceHOuV04IW+X+h7Oj6O5SM6pFqNphUsXx7LFEU=; b=ICKt+cZe+4JGa4EZFRys4MWKoQ7+kqqek9WVP/KK/FkxVCW9vQBl6JRB VNXnPlZcWAAiekWTcAUke2d1hQRah9Zn0bTtX81mLSvg/Q+nkPhkz9lGn kaYxUxWqPxBui5hlnl29ffxpH4ZCUtY71LdijqaJCATiq7Q+aMxHiSe5p c=; X-IronPort-AV: E=Sophos;i="6.03,216,1694728800"; d="scan'208";a="130688632" Received: from dt-lawall.paris.inria.fr ([128.93.67.65]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 15:46:36 +0200 Date: Wed, 11 Oct 2023 15:46:36 +0200 (CEST) From: Julia Lawall To: Anton Eliasson cc: Nicolas Palix , cocci@inria.fr, linux-kernel@vger.kernel.org, kernel@axis.com In-Reply-To: Message-ID: References: <20231003-coccicheck-v1-0-07d2d900a52a@axis.com> <20231003-coccicheck-v1-2-07d2d900a52a@axis.com> <5c76da14-e34e-afbd-4265-493c66e0bc60@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [cocci] [PATCH 2/2] scripts: coccicheck: Separate spatch stdout and stderr Reply-To: Julia Lawall X-Loop: cocci@inria.fr X-Sequence: 1253 Errors-To: cocci-owner@inria.fr Precedence: list Precedence: bulk Sender: cocci-request@inria.fr X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Wed, 11 Oct 2023, Anton Eliasson wrote: > On 10/10/2023 18.11, Julia Lawall wrote: > > > > On Tue, 10 Oct 2023, Anton Eliasson wrote: > > > > > On 07/10/2023 21.41, Julia Lawall wrote: > > > > On Tue, 3 Oct 2023, Anton Eliasson wrote: > > > > > > > > > This helps automating coccicheck runs by discarding stderr and only > > > > > looking at the output of stdout. In report mode the only remaining > > > > > output on stdout is the initial "Please check for false positives" > > > > > message followed by each spatch warning found. > > > > What is getting dropped is the spatch command lines indicating the > > > > semantic patch. Is this desirable? > > > > > > > > julia > > > It's not ideal but it's the best compromise that I have found. The problem > > > I'm > > > trying to solve is to be able to diff the output of two coccicheck runs > > > and > > > notify the developer if any new warnings were introduced. That requires > > > the > > > output to be stable. spatch is always invoked for each cocci file in the > > > same > > > order. However, the output from each spatch invocation is not stable as it > > > examines each source file in an arbitrary order. > > > > > > My workaround is to sort the output before diffing. The line-by-line > > > sorted > > > output only makes sense if the input is one line per warning found and > > > that is > > > why I try to discard all output except the single line per spatch warning. > > > While the terse output doesn't tell which semantic patch file generated > > > the > > > warning, it does usually contain the offending file, line number and a > > > summary > > > of the issue. > > Why does the command line pose a problem for sorting? > > > > julia > > You're right. I was overthinking it. Since the sorted command lines will be > common for the two runs they will disappear after diffing. > > So at this point I don't have any need for this patch. I'll reach out to you > again if it turns out to be an issue after we have gotten the continuous > integration check in place. Thanks for the feedback and I'm sorry about the > noise. OK, thanks for the discussion. I was also thinking about whether it could be possible to make the output always come out in the same order, based on the name of the analyzed file. Maybe it is possible. julia > > > Anton > > > > > > > > > Anton > > > > > Signed-off-by: Anton Eliasson > > > > > --- > > > > > scripts/coccicheck | 4 ++-- > > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > > > diff --git a/scripts/coccicheck b/scripts/coccicheck > > > > > index 95a312730e98..7e7c44125f47 100755 > > > > > --- a/scripts/coccicheck > > > > > +++ b/scripts/coccicheck > > > > > @@ -146,8 +146,8 @@ run_cmd_parmap() { > > > > > echo $@>>$DEBUG_FILE > > > > > $@ 2>>$DEBUG_FILE > > > > > else > > > > > - echo $@ > > > > > - $@ 2>&1 > > > > > + echo $@ >&2 > > > > > + $@ > > > > > fi > > > > > > > > > > err=$? > > > > > > > > > > -- > > > > > 2.30.2 > > > > > > > > > > > > > > >