Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2076822rdb; Mon, 9 Oct 2023 11:40:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFoOsW1QQw5eL3a9zPtNMPxkk3dMZjFKhPpCq5aNAO1pJKzPvxMREtLmgSt9/Pk52n3LtFK X-Received: by 2002:a05:6a21:339d:b0:16b:c20d:fcd1 with SMTP id yy29-20020a056a21339d00b0016bc20dfcd1mr12237216pzb.21.1696876838535; Mon, 09 Oct 2023 11:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696876838; cv=none; d=google.com; s=arc-20160816; b=mZNWMW9WJVYR12LKQTbjZpB/+iRuhaz+6dNsDZ1hQNZIpWh2vQXPS8/OH4bbBMJIOe RKwSDEn/7fCtBmWhR8aa5SgdUBFZPRIvobjat/OoZAit1+JXCgvGXuFC8XGYX47st9Ai P7fvovtaFo0DkDu18wdOigUX1BZxEp4FeJNwppukwr3ToMwsjDYRnZjl7GpprtW+JrLm oJmxYs2YDzrDl8cOtv8qyJqX6E3AQcgDY45VtTNnIXF9oG+J5ETgvr92L8IXMVjOcNdx 7hn1bzGFGyNALm0B2dGUitcADOjl2pwgrwhP0NjaY6rRCodqukCAOSRyijlT/dRl9KTu 5cbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=KnnQkZcbskEopBJnxGh+Vcp7ouLVD/1W8b2XeUOooQY=; fh=8uoRd8OfBKdrcgzCS0TCbKG83gg6rx5b6zeE6Tx82zI=; b=oS0i4S61zA1OsdF6JAeFGznd5vzrHiQ67Z47cLMLYxolargKgEas3sqSaF0HbJLGnA UeElKgdKiRapgQI6eKDut0hq20T4W1nHLKWmRgv8aWwRGPKdSbThCNc7eowI6U9y193P TaOrJiVl5JUulVOF0yYMciSvR0cVdssB44ee1aZOdZSf/w4BEHIWpBEmVXebAAmYuGmo jU/ustFr6iCOFHhYAM2VLkNhhnKTy5sdSHsImeb07RH/Ad2Fjs9wMfFb36bFo5lRZ4og VY7xe6BUSIG0ryWyq3mmT/nRC52EG3/Gg6e1lPBINQ8n9ysrIq6au2GnWo4VnnPXxrOP S9wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rJVw0PRw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id b14-20020a056a00114e00b0068a85532963si7794799pfm.160.2023.10.09.11.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 11:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rJVw0PRw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 887AE806E4CD; Mon, 9 Oct 2023 11:40:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378245AbjJISjj (ORCPT + 99 others); Mon, 9 Oct 2023 14:39:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378216AbjJISjd (ORCPT ); Mon, 9 Oct 2023 14:39:33 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 056F5A6 for ; Mon, 9 Oct 2023 11:39:32 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-d866d13c637so6317834276.3 for ; Mon, 09 Oct 2023 11:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696876771; x=1697481571; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=KnnQkZcbskEopBJnxGh+Vcp7ouLVD/1W8b2XeUOooQY=; b=rJVw0PRwWoWB1JfvSPLNZitx9J0lPvSXce12MjbCoJebzY1f9ObYixNey0ePBNFGfu k+lYGp4k8V7bZWyIhtZF87XDFupG6NLihJ/k8/6kLHwbifENW4htVxpYTIyzocosjnBD zi1BRAPqMy5DU/cb+BLUgRyLXV3jFcoQW5qaFBzzSbyhqCx7pgkBJouZ0CjLaixtELrp cxQ/xrh+S0k4ubh4VaeaDVdlkcuepGdD7Zyp51oQtxQBlLjvdiGNfUnFpfRM1xzmdXGM MO1x8FgShnL+xValM1rAQbHX/w8ozGFrtzMjX/rtNcAKSZhBmKazcwWpPPJ5C4y9eQuy /bwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696876771; x=1697481571; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KnnQkZcbskEopBJnxGh+Vcp7ouLVD/1W8b2XeUOooQY=; b=iAz4xOlXrT0x0cPmWCxEu3IyTrYVVv5OYjY6n/OdL/lL1IXo6NDty32J1R4gSMPPJA GKGwJdWsCFDMR5O/3VTdmIOe+LkI1g74MiCP1mtVJG28/37bv0cDs6/rqFnSqCHH/IQe lo6n+OhunmVOnVfou2BhhInd9FuyOCAgJplfZANzhxndauQH+oHsT91/AgaK8XetXPa6 syJ7eSNmcNt4yyiya1Qkz/AzAMJ0IJSl5bPaqlX+yzFcLCnMHSc87f1jPN8ZAT5X9D4l vZo8U7lar19hWFd5nE3iBNZZ7GoqPnHe7VILJziYszGisA+pGneLgD8K0VZHeNXWYXGn A43w== X-Gm-Message-State: AOJu0Yz87e8nQgS9G5nQ/Lq3SQV1Z3xBXIE9udK1iArdXEvjGNz5VyQS NN/C80b6fuQXeAtYWf0dRG3eMzMg6jVT X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:ac4a:9b94:7158:3f4e]) (user=irogers job=sendgmr) by 2002:a25:6881:0:b0:d89:4776:5d6b with SMTP id d123-20020a256881000000b00d8947765d6bmr254778ybc.5.1696876771177; Mon, 09 Oct 2023 11:39:31 -0700 (PDT) Date: Mon, 9 Oct 2023 11:39:03 -0700 In-Reply-To: <20231009183920.200859-1-irogers@google.com> Message-Id: <20231009183920.200859-3-irogers@google.com> Mime-Version: 1.0 References: <20231009183920.200859-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog Subject: [PATCH v3 02/18] gen_compile_commands: Sort output compile commands by file name From: Ian Rogers To: Nathan Chancellor , Nick Desaulniers , Tom Rix , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Yang Jihong , Huacai Chen , Ming Wang , Kan Liang , Ravi Bangoria , 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" X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Mon, 09 Oct 2023 11:40:12 -0700 (PDT) Make the output more stable and deterministic. Signed-off-by: Ian Rogers Reviewed-by: Nick Desaulniers --- scripts/clang-tools/gen_compile_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-tools/gen_compile_commands.py index b43f9149893c..180952fb91c1 100755 --- a/scripts/clang-tools/gen_compile_commands.py +++ b/scripts/clang-tools/gen_compile_commands.py @@ -221,7 +221,7 @@ def main(): cmdfile, err) with open(output, 'wt') as f: - json.dump(compile_commands, f, indent=2, sort_keys=True) + json.dump(sorted(compile_commands, key=lambda x: x["file"]), f, indent=2, sort_keys=True) if __name__ == '__main__': -- 2.42.0.609.gbb76f46606-goog