Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1503018rdh; Mon, 25 Sep 2023 15:07:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRv7/FhHXVHG26Tk/zfI30qR3hHK78b8pNlKMqbueyKAxYhr1ZSTVOkM3fRktnc/WJVty1 X-Received: by 2002:a05:6a00:230b:b0:68e:36b1:3d7f with SMTP id h11-20020a056a00230b00b0068e36b13d7fmr6602230pfh.18.1695679678756; Mon, 25 Sep 2023 15:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695679678; cv=none; d=google.com; s=arc-20160816; b=k4lGH4tvjBgBtJhF2YGNLfd54Mo3MxRaayinKbEla8tmnrKTY+ZCz6POj7HWfgdlAn NpolcbKd/yZpQM6CFgXy+eeDHneXkEfIgi1+IZyRbFaozdj9BiuICrQ83MjtupXGl44H 2DvoXQnHUSN1ehlZv0j5926uiFrBxlZAa+NLiXzoSHsPB0eFkTvwjjGAeskwDQZFrvsx hP/iT5JrGOvETzDXiPWcwD3fcVRhGhEl+Y3lxRd6V9Jq0/PYxyyc39D2p4XVcC3WRrgp RP/Q7oz/+HxNcLOAHVT14raepirvs+QGUDwktWE/6yKLKUYpQWGzLXa2G999O2uwfFOw iBoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7+2yILMg5RefpLAOUcXf0dyQqPNPRMS1MIKyTbaudkU=; fh=BAJ6YMa5Gem6X8haA0jcx45YPoS1qKWrUMiMqz4ltm0=; b=UQVumU0XP9UZwQJADy4wPv75kFXuH1v10koKALbFzO/cFNW0f6aHKP91lf4o49eDTv /mSxQfEdHc+gB45kQHwaGgbysNxrwLmrXWZEu7CenXGFVqYyNEjBGKj3xOjCnLPyDjmN DQhap1G6KXvdni9QUuU7ivaDwKThDfSAaJzExWyvU9GxjjMNKLkvh4ZaOcc1SQaBoK/6 D83E2p7MQ/NO0t9XWYNDAB9/tucJ8aWuHS5xGK0aFOWw9Mct6Tlxme4img4NlWqNyGQB IDQhLewvLdg64GfufyndQia2/cp0M3MokH9oppRSSn+DJJ9/zNHkLTW8CBE4Eq64t6sr zo2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="t/aQMdCA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k139-20020a628491000000b0068e405d9217si10618818pfd.302.2023.09.25.15.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 15:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="t/aQMdCA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1600480781D8; Mon, 25 Sep 2023 09:26:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233357AbjIYPvB (ORCPT + 99 others); Mon, 25 Sep 2023 11:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233062AbjIYPuk (ORCPT ); Mon, 25 Sep 2023 11:50:40 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B09B193 for ; Mon, 25 Sep 2023 08:49:30 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-401d6f6b2e0so52961865e9.1 for ; Mon, 25 Sep 2023 08:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695656968; x=1696261768; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7+2yILMg5RefpLAOUcXf0dyQqPNPRMS1MIKyTbaudkU=; b=t/aQMdCAV+9kj1lZg6osRNTx16J0KKQcD76dLr9Z2Omp1N2QItejbo7VHO4xEDzkqt C4wwfUOam/1SXXWEf87IcA0JWkVWvRAoDFOFMeLrKMGMSwNCKAMztFTF6rKSkXr8wPXZ Lo4Ikf+wAfPtlsuzBQea1uokzV3whxc34t3DacgDHP/UbClvL5JqjsumjAWLmNUvP1c3 DW0Pbjwmyn/Y6B+lYzMjbgrL1vWD3kW2a0JKNzzDG2C3op2Fh/UfSFlJluifnUWxnrDr +0Yl1hKZ45oOOICXOTpEYHYo+0qTOdAxM6kWRNooX1zHFWwRGFJTK+03Mbpcng+1tZFg AJSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695656968; x=1696261768; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7+2yILMg5RefpLAOUcXf0dyQqPNPRMS1MIKyTbaudkU=; b=jKKCtG/6zNb6oE9NbnSLL8R4sZ5g5sN/4XCg9F6CLxWxNZU8f9wVCUmmD641G52svV mSX4rJy0uo9VUK3mAcQhaZHA/vFOt5Qokp7GuIIAPkgI93ZgkI3TQLCAexsp0Og6UAh5 Yc8DIH4GhtusFcvs/Rab7d94MIsJ3Wc7DhTqCLWbE8KtxfEj+fMXDc7b3+HlUi7NC2zd JjMRs2+zeZtQ/5uml9HXmGSU7hQ/E9eFdYEcsXwz4GZveQEVV9JNGqLJd8WO8w+m1G/d mVbb+waGa8+kBzvt6l10bhlAqTkwIdoxk3YnK+vWaE84MUId5LjW2H5f9kgS+//1OdZH 4MRw== X-Gm-Message-State: AOJu0Yw1jnWZnvIqX2IppSNan9O0DsGUSuAlXLBB6jv8u5dG/Rm7i/Kh aJBUNRSP1wnLK8RExfXGLSjTh8udOpycmHizsChvbw== X-Received: by 2002:adf:fe09:0:b0:323:30d0:5c4d with SMTP id n9-20020adffe09000000b0032330d05c4dmr15309wrr.19.1695656968282; Mon, 25 Sep 2023 08:49:28 -0700 (PDT) MIME-Version: 1.0 References: <20230923053515.535607-1-irogers@google.com> <20230923053515.535607-2-irogers@google.com> In-Reply-To: <20230923053515.535607-2-irogers@google.com> From: Nick Desaulniers Date: Mon, 25 Sep 2023 08:49:17 -0700 Message-ID: Subject: Re: [PATCH v1 01/18] gen_compile_commands: Allow the line prefix to still be cmd_ To: Ian Rogers Cc: Nathan Chancellor , Tom Rix , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Yicong Yang , Jonathan Cameron , Yang Jihong , Kan Liang , Ming Wang , Huacai Chen , Sean Christopherson , K Prateek Nayak , Yanteng Si , Yuan Can , Ravi Bangoria , James Clark , Paolo Bonzini , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 09:26:25 -0700 (PDT) On Fri, Sep 22, 2023 at 10:35=E2=80=AFPM Ian Rogers wr= ote: > > Builds in tools still use the cmd_ prefix in .cmd files, so don't > require the saved part. Name the groups in the line pattern match so Is that something that can be changed in the tools/ Makefiles? I'm fine with this change, just curious where the difference comes from precisely. Reviewed-by: Nick Desaulniers > that changing the regular expression is more robust and works with the > addition of a new match group. > > Signed-off-by: Ian Rogers > --- > scripts/clang-tools/gen_compile_commands.py | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-= tools/gen_compile_commands.py > index a84cc5737c2c..b43f9149893c 100755 > --- a/scripts/clang-tools/gen_compile_commands.py > +++ b/scripts/clang-tools/gen_compile_commands.py > @@ -19,7 +19,7 @@ _DEFAULT_OUTPUT =3D 'compile_commands.json' > _DEFAULT_LOG_LEVEL =3D 'WARNING' > > _FILENAME_PATTERN =3D r'^\..*\.cmd$' > -_LINE_PATTERN =3D r'^savedcmd_[^ ]*\.o :=3D (.* )([^ ]*\.[cS]) *(;|$)' > +_LINE_PATTERN =3D r'^(saved)?cmd_[^ ]*\.o :=3D (?P.* )(?= P[^ ]*\.[cS]) *(;|$)' > _VALID_LOG_LEVELS =3D ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] > # The tools/ directory adopts a different build system, and produces .cm= d > # files in a different format. Do not support it. > @@ -213,8 +213,8 @@ def main(): > result =3D line_matcher.match(f.readline()) > if result: > try: > - entry =3D process_line(directory, result.group(1= ), > - result.group(2)) > + entry =3D process_line(directory, result.group('= command_prefix'), > + result.group('file_path')) > compile_commands.append(entry) > except ValueError as err: > logging.info('Could not add line from %s: %s', > -- > 2.42.0.515.g380fc7ccd1-goog > --=20 Thanks, ~Nick Desaulniers