From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAB05CD6E6E for ; Wed, 11 Oct 2023 13:58:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232536AbjJKN6H (ORCPT ); Wed, 11 Oct 2023 09:58:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232075AbjJKN6F (ORCPT ); Wed, 11 Oct 2023 09:58:05 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2047.outbound.protection.outlook.com [40.107.247.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B452F90 for ; Wed, 11 Oct 2023 06:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TT3nK0XBY4ZrtSIEWeRAxl6IignVke9qlbKCq/vN7P5+F6fGZEMYqKdlhBTJ3Xg2uHWQWKJuH3FpAIu0zK0dFYyQTNmWXipM4f8uqjSw43YaOYRTYdhR/RqUXusmypqiGBdDdBILRzJNO8I2fPc4gepXuWWOuTaValR6gZKLrm+WWQgL6nRWbCdPDJQgdDZ4eMOhkWOk4o81XDSVG1xlD1ftheXdYb3RZOnJiW8c+9n4KQ/wxKNMJzP3x1SAQLMWfeu9dmq+Mi/9JGdX1hnYrE1lhwzlP5mEyN/7Z2RXcX79JWOLuo/PsNytWKmEVkKQMwF/8CgJBvGlQafmjV7vMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8FCtFBTve7gwWpvT3gJvKrtCRsM/wp2D8FQvxVBjdSs=; b=nbK5WZimgL+NXTDqiCuJzyHQ3P8B5qAt4e6+/HYiet8kccQebp6R5aGls2dQmVOk1+RmSc5kmEV3owTW9eVogAd67U6T+mTpUy/TRCa+c3bjcLju7wdQvrYKFu9YJabNtz88ERM7la+f0vIM0TNnAmEMXsW1ZQipONEncQ9Laz6XBnSMC+pJNtXLRzkWbIdL68k6YIfoE/02SwmzDL9iKarQOM7/aA+zxGScuxGfgfC1Ci/u6ABA8xxAtAeFPZkv+WLTtT8ksJ14KdvEoYB3NY5Ot3YEj7iN76BpJaWMM7CpL9scz+wI7hi/bbnhCDYkz36okDN+JxSsITJLAQA98Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=axis.com; dmarc=pass action=none header.from=axis.com; dkim=pass header.d=axis.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8FCtFBTve7gwWpvT3gJvKrtCRsM/wp2D8FQvxVBjdSs=; b=TPsKlQ0BqmTRp4oROTkY5iEycFumrNgX0sCS5cPrjw7O2VTmykzGwcDKHlfH8xwo2mm96FTxx00sIBwPhRjvdMyll3sqFCXkModXfZI7CCVuRLcUHf89elbOrQh+JbV1yAM5KXlgXnevEn7A6KYYZxNkaE4KtIubbQG3l99gV74= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=axis.com; Received: from AS1PR02MB10348.eurprd02.prod.outlook.com (2603:10a6:20b:473::13) by AM7PR02MB5894.eurprd02.prod.outlook.com (2603:10a6:20b:10b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.38; Wed, 11 Oct 2023 13:58:00 +0000 Received: from AS1PR02MB10348.eurprd02.prod.outlook.com ([fe80::31ee:1e73:e80b:d9ce]) by AS1PR02MB10348.eurprd02.prod.outlook.com ([fe80::31ee:1e73:e80b:d9ce%4]) with mapi id 15.20.6838.040; Wed, 11 Oct 2023 13:58:00 +0000 Message-ID: Date: Wed, 11 Oct 2023 15:57:58 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [cocci] [PATCH 2/2] scripts: coccicheck: Separate spatch stdout and stderr Content-Language: en-GB To: Julia Lawall Cc: Nicolas Palix , cocci@inria.fr, linux-kernel@vger.kernel.org, kernel@axis.com References: <20231003-coccicheck-v1-0-07d2d900a52a@axis.com> <20231003-coccicheck-v1-2-07d2d900a52a@axis.com> <5c76da14-e34e-afbd-4265-493c66e0bc60@axis.com> From: Anton Eliasson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MM0P280CA0009.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:a::24) To AS1PR02MB10348.eurprd02.prod.outlook.com (2603:10a6:20b:473::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS1PR02MB10348:EE_|AM7PR02MB5894:EE_ X-MS-Office365-Filtering-Correlation-Id: 9dd1d9bd-efac-47d2-ad7e-08dbca6214ae X-LD-Processed: 78703d3c-b907-432f-b066-88f7af9ca3af,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8hFDGU9yVH1SEQgLP2XOo0AqTuRiphmeTxylKRhZhcO3PXWxCDs94nHx094fQz29n111hTRtCaOwWVkOHtMwDw4S73nN5fv+I0wm0ixCifxoXGuSgVSD8keUYxQFD709nKnNBfZmvhw7o0o1EzSwaf2Hx01aF293XtU6XDntVxgi+sNFiCzr0G2UV1qauLIrgROWWEbMyyhYBldWXP82c5szRzOjvcT4d/KNQXcZ3Sp4KdCxCQAU6w1nNC88kK6v8aXYFf35FUiKneuGOsxj0liexlNa2cIAKYFxjTYfp5wsycsTehNzOfM5kRpB8SzmU9VhKfCnrB5v1biPcyEpVxdG7JKCxAVuMbfX1X0kTboxSh+5jSHT2reLED3T0cUMnha/XcFzo+c3aETiQb6JcaiYf+P2h3S02UJg2nOoSmi75tEbuRTJLclQByXpHtw+WwV4vbf3te488KlojhH3Xcj4OE6pUu/i8nTkQSO4SEs9rEEoL7ZO4pTV7vdAHlgYJVVt3xrDxHXllfYhnU70W+Ado6F3LGUdhOru/yMEiQ/y8uDNNIn71cvgLOuRnV5XSH5Cp2TAljoJRgSauQVYbh2a89jCDoFKDZ7CmiSfaMFMkr/0IW6D68Ew7977o+vUfEBV2/89xYemaOnqpcezfg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS1PR02MB10348.eurprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(376002)(39850400004)(136003)(366004)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(31686004)(83380400001)(107886003)(2616005)(66899024)(26005)(6916009)(66476007)(66946007)(316002)(38100700002)(41300700001)(66556008)(2906002)(8936002)(8676002)(4326008)(44832011)(5660300002)(36756003)(6512007)(6506007)(31696002)(86362001)(478600001)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dGZnMFBCNDBTZk5qV1BLRWRJUm9ZRzV6ejZZZjRleWpodG1qZ3NscThMQ29t?= =?utf-8?B?bTlhOXBZakZiZHF5bTdsSXhaaFF0bmtxY3hlNG0rb09GM2NKY1BkamNuaEJM?= =?utf-8?B?MVIyWHBIN2ZUOCtra3hKVHY0QmdUUGVCK2FEdXQvd0thSU4xRkF1ZDhzMzJQ?= =?utf-8?B?UUZEajFaRW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f-8?B?cUxSZmpZejZIMlhBd3lYSEFSeDk0UHNDUGdlaDdCRTFnb0tqKzNTQmRrOVlG?= =?utf-8?B?N2U2cFc2L0o3R2d0aE9ubDRMaVRNNmsxOFVzNVkvdlpFdVNGdWxOYlJ6THZt?= =?utf-8?Q?cOBI=3D?= X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9dd1d9bd-efac-47d2-ad7e-08dbca6214ae X-MS-Exchange-CrossTenant-AuthSource: AS1PR02MB10348.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 13:58:00.7350 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3bvWD00iu7xxDv99GEJ6O6iHUDSeLQmKzCI1q82AVz/XWBePl7z+YczHxA7x0JVe X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR02MB5894 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/2023 15.46, Julia Lawall wrote: > > 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 Yes, that might help to preserve some context. The difference between two runs could be presented as a unified diff instead of just lines added. That would probably contain the command line invoking the semantic patch that caused the warning, unless there are too many pre-existent warnings. Anton > >> >> 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 >>>>>> >>>>>> >>