Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1487860rdh; Mon, 25 Sep 2023 14:32:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVpkp+J28SfNHTL69/SJJ3ePkh592JKEWvufMQqUZyEKWxnSA8gcZt2+0dXRMRcFak5N27 X-Received: by 2002:a17:902:8d95:b0:1c5:d1a2:c3e8 with SMTP id v21-20020a1709028d9500b001c5d1a2c3e8mr5155450plo.5.1695677566737; Mon, 25 Sep 2023 14:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695677566; cv=none; d=google.com; s=arc-20160816; b=m9Qr6POmub6lnsOaXVg4+BoLEfzKLuPPF9sv7Vtvo+j7f/W+4xS/DvNxJOOL3odm5f gkmnEjrVy5CypEmmnzW3o9+3Sx+jDJ5O3yXO+uMM/YLgdiFa+2tJdKwb44CM2NN4LsS6 ZEs16cnZacAnO9id6IOL6BMw7y2Z4p+/DpabcPZMt9kCfzKewHOkBkebfnHmo+SdYOPH Ol1mLMSQzCU0aITdmEVHUryK8h+HKzNyYuOXE1KzXWdbVakCREo5iT75srhZTo9ytNYa BJEFGC0AoZqmqXl1NEx8O4scpGRqNFiBpLBUijhtrH6YzWZ+pvCtREX6PEz9JKx5OQOS KxSw== 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=zz326N6OBdHyE4AWsKl7zmfrXxh5t/tD9DFw2q4SSSM=; fh=ES1TaaB0QX2bPZlkK85eruWk+ugyH3xit+OrfBeh6dI=; b=nJcmY39ok7tuGfVi0S7Oy0s8UCTpaEXXcBmBFOnX+pfnkwTXutoHdVRQdZ9WsKhh7d hC6+wq3bCBhrybGG6n5usbEn+SyHPJa8qXYqungvYbHJ4j34Ea0vyiFPIaYe8VyVj2WY Bq8dKhVCxo4/3/Muv138qm1r83x9jqna/f3MLOeCXUYoLeCWvR7PAXuDaNRFnrLOksck me2mxtFJGZ6zsVSZNjbXebxflw76yvS7XdNsLqVoLP5b1IDAnhxHoYf58vIHHuooJhMg 4LRbgNWLpyBOB+uVniJ8xo6qR3ZxfMtWv0Qt4icnYAsVL9EZDoi2A7w23zUjWp+g5mPc 07BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FseI31ir; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id w17-20020a170902e89100b001c574110eecsi11529689plg.341.2023.09.25.14.32.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 14:32:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FseI31ir; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 16C56802B11B; Mon, 25 Sep 2023 09:06:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232883AbjIYQGb (ORCPT + 99 others); Mon, 25 Sep 2023 12:06:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232503AbjIYQGa (ORCPT ); Mon, 25 Sep 2023 12:06:30 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEEBFB8 for ; Mon, 25 Sep 2023 09:06:23 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-418157e979eso865721cf.1 for ; Mon, 25 Sep 2023 09:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695657983; x=1696262783; 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=zz326N6OBdHyE4AWsKl7zmfrXxh5t/tD9DFw2q4SSSM=; b=FseI31irQq9JF1uHo2PZcthT/MY3CM/WGvVxf06oEVmusqRCtb7JvC0UYqqbcWMJGO KUvegVPtmzM6JKG7BiRUfASBVNez0o+xYAgNICgv7T2Ay8MTl5liu9SaU4UY7tv0jtDF HhvHwBrUTlQ+JVaJmpGSyUb56qRj1Yv6ybHdoAj81SUECkbTqJwVutIv8znub3lqupyk NK4hZTsBXo5mVS61Jzl17u8V0esqmA0UzPLmDT2rBM0xnpSFKoYLkTjAj6QGhWCAVOA9 BPEGYtgW+hPA0Hk4Pc2CJgRErmV5XTSM+6T+r9arbyx5t9DZ73tzBFGJMxfEeTLrHM8d +sTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695657983; x=1696262783; 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=zz326N6OBdHyE4AWsKl7zmfrXxh5t/tD9DFw2q4SSSM=; b=P3k/riaLOS2pcGgPaL+0Qy68+L7YgNA53tbIeXCdoWYhb1k78RrdqvlCd1NPC7jIQj ckkhRMGl/704RNmF5moAE7LWwPYZ3yhPuI8mvQ58A787fxSoo+9ugsmBmZPoKqeSm1nU ECBkoIVSPbNTnhjPhVHyHgthY29+DRcZXmbedufJyO6Le0x5TpjUcTeaeSRjgZsSnMz7 kZBQFXuNFUuJ1PAEtE7EDvj9gL1SAMBN4Q/RYVK1flVhCJrm2RsM6s2vs3xHLraydS/I aPrasdvIM7h88IaRAJSu9K9SlYBTQOThpr0rG7iXayvX1k5mQ7bdxdEeB8hNFzo5bhlt ZMwQ== X-Gm-Message-State: AOJu0YxxU0vc1rse+6ZhxA/BisEA9F8HxUYVeLNjKm+L7NRO6wU9k5Ls IMoldpaZPCUINzqOo5SJJEuuaGzowFx6azYXaMEnPg== X-Received: by 2002:a05:622a:1905:b0:417:cd31:a2f6 with SMTP id w5-20020a05622a190500b00417cd31a2f6mr459497qtc.1.1695657982784; Mon, 25 Sep 2023 09:06:22 -0700 (PDT) MIME-Version: 1.0 References: <20230923053515.535607-1-irogers@google.com> <20230923053515.535607-2-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Mon, 25 Sep 2023 09:06:11 -0700 Message-ID: Subject: Re: [PATCH v1 01/18] gen_compile_commands: Allow the line prefix to still be cmd_ To: Nick Desaulniers , Nicolas Schier , Masahiro Yamada 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=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Mon, 25 Sep 2023 09:06:30 -0700 (PDT) On Mon, Sep 25, 2023 at 8:49=E2=80=AFAM Nick Desaulniers wrote: > > On Fri, Sep 22, 2023 at 10:35=E2=80=AFPM Ian Rogers = wrote: > > > > 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 I agree. The savedcmd_ change came from Masahiro in: https://lore.kernel.org/lkml/20221229091501.916296-1-masahiroy@kernel.org/ I was reluctant to change the build logic in tools/ because of the potential to break things. Maybe Masahiro/Nicolas know of issues? Thanks, Ian > > > 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/clan= g-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 .= cmd > > # 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 > > > > > -- > Thanks, > ~Nick Desaulniers