Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp250513rdg; Tue, 10 Oct 2023 09:11:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOg9lX+gCVzXE4/uGeTetJnA4chKhSQFfIWIj345lrWprU8TjLwN689Y6pcIVqIfCnoQut X-Received: by 2002:a05:6358:918b:b0:14f:3874:2746 with SMTP id j11-20020a056358918b00b0014f38742746mr15039709rwa.23.1696954299436; Tue, 10 Oct 2023 09:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696954299; cv=none; d=google.com; s=arc-20160816; b=kh+aSOOCDMZ1Tg5GIKN/wsuRuz5LJujkPPzZ5FdCWeiG/AeHKejuAwtXT5dNUsr9QG CHMIGXSj9KdPjXeje1Y5oGetQnQRC/DbK7stQb0a6X/Nlvd44d1vuQBfD0ugWdnQ05km lQZRVZ5JUQJJUZ/nHaWDs3xTW+GreOZo/5IFfzvab7ggjBLRHpEQOWuH8tqj5rZwFjNo jHjcOaE/QYyjCREKHSqriNEg7F5rdgLQ/zqgEzQ2hQ0l92czcO9E7ZOSWFG7Z9IXVAZ3 Q+4LDkueCXCTuoegbdSlrPwEFxAzvR6lWZG6eEEbdvT6pbzBzpKj2V6z5doljdqNeklW ow6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=9FJwAU28iuTv/7nCKDXq9E5+1x1YwYFBxD8benLUCJo=; fh=3INv4ojhZPr/8lxodP3twRHteGxuDZq0iy+Doksd3Lw=; b=MTwg0lmvAujQBK306j3ekWB8BrBAI6uqyMqxwfZ24Iw0FoA3Pg54G7K3lDqdqek8YR W6Y99FiWf6BkzJwjo2slvgjin5mnd09P4/R4OagzX5bq4mVwk6+LZqTCLps9lYnWtflt bx8L798tRcjtphSWYYHhlxUbkAMkSSl7hHKBB+no/lnZmolfCZaLB0rf12lGVZWm4Mrk zZLGtMU38ba0neK3ywOE+TONL51ly29zLYUGbz9lONCpaZmHDttuE2hqbsoZ1pkmdfUQ xbeuJ1EK8nLO9PWR9o1MxlV66TJU6XkgSPoIpkI5+wBpOuIhtRvDeBMbXLKtqSCxQJR0 8oOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=t3CQTzLm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id k63-20020a632442000000b00578a2da998asi10693969pgk.304.2023.10.10.09.11.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 09:11:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=t3CQTzLm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 540D2805CB2B; Tue, 10 Oct 2023 09:11:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233713AbjJJQL0 (ORCPT + 99 others); Tue, 10 Oct 2023 12:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233576AbjJJQLW (ORCPT ); Tue, 10 Oct 2023 12:11:22 -0400 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CFABCF for ; Tue, 10 Oct 2023 09:11:18 -0700 (PDT) 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=9FJwAU28iuTv/7nCKDXq9E5+1x1YwYFBxD8benLUCJo=; b=t3CQTzLmOiWH7ZebcX0dJMdBkY1Ade1HaaJpBfkXTF9ewtNXh0zYeBy/ QZsrfKH4AJcJkFheWzNzXG6NTe3OR3Wx3ZrdS59FsjrWjvlmk0cL8v1JJ VPUot77JI2GuymEWdKhfDQAt5LGmKz5+TFpt4J8faCUzxS0dzFHWesBe0 4=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.03,213,1694728800"; d="scan'208";a="130495417" 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; 10 Oct 2023 18:11:16 +0200 Date: Tue, 10 Oct 2023 18:11:16 +0200 (CEST) From: Julia Lawall To: Anton Eliasson cc: Nicolas Palix , cocci@inria.fr, linux-kernel@vger.kernel.org, kernel@axis.com Subject: Re: [cocci] [PATCH 2/2] scripts: coccicheck: Separate spatch stdout and stderr In-Reply-To: <5c76da14-e34e-afbd-4265-493c66e0bc60@axis.com> 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 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 10 Oct 2023 09:11:36 -0700 (PDT) X-Spam-Level: ** 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 > > > 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 > > > > > > > >