From nobody Wed Feb 11 05:17:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613136381; cv=none; d=zohomail.com; s=zohoarc; b=cRVqQVynbdDVBYl/aRg1Clu3rt2tJIRp+NJwjJxjnWTilBkJXwLDYoFJ6xZ2icfkxOd8Bl4sFc26BdxtJ1UHvONgE8Zv8j3koDtFjX7Tisk4E89sIDBIjsL+ynVIdd7qN11rPODa0zef/1oJVMl/LxxYraWJaPtn+BM1LTjEDaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613136381; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=o3f4lXiCPExo3m1TgSIYDf79UmVLdKUBt+GbtITkhW0=; b=JqYNuJNBBKSKet3GaE+X7VIKhDaD8uVCb3IvHCsHWI6wMSHMhFUT3I3zFIcc3hyOMwbvbxIxppdjjVPVWNYV9B5ipDgsCJehoACKGxNpy+HFIjawsJJN/UDdA1t+/4lYE6ExjK0bzUrsD64rXPtQMb7UwRkuan8YxEnwV7MCEfw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1613136380592596.5282103904074; Fri, 12 Feb 2021 05:26:20 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-469-cl0lEVfCNg6fcqvhw1lciw-1; Fri, 12 Feb 2021 08:26:17 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B8661936B68; Fri, 12 Feb 2021 13:26:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 490566E419; Fri, 12 Feb 2021 13:26:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 139C11809C91; Fri, 12 Feb 2021 13:26:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11CDPjdg008648 for ; Fri, 12 Feb 2021 08:25:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id D8AC0614EB; Fri, 12 Feb 2021 13:25:45 +0000 (UTC) Received: from work.redhat.com (ovpn-112-223.ams2.redhat.com [10.36.112.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E69D6E51B; Fri, 12 Feb 2021 13:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613136379; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=o3f4lXiCPExo3m1TgSIYDf79UmVLdKUBt+GbtITkhW0=; b=EBcVQMP5CvXXKLLIwh+eAfUKwlByeO8Vesy5lZERj1l5tyi6VeEJLqcg+Uejbd6LRXEfoI MVpXZ3qek1mc6bB36AUYHAk4JlyGimuvQEYrDJ92CiCLGYmXdpDYyQna9XPMGYrFFATtg2 EsLJ/r/O8AvLgOaNPh0obDuvEoKA9Ak= X-MC-Unique: cl0lEVfCNg6fcqvhw1lciw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/10] clang-tidy: Add shuffle Date: Fri, 12 Feb 2021 14:25:31 +0100 Message-Id: <20210212132534.29066-8-twiederh@redhat.com> In-Reply-To: <20210212132534.29066-1-twiederh@redhat.com> References: <20210212132534.29066-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Randomizing the order of files to scan has no impact for local use of the script. The same holds true for use in the CI, if the amount of cached files is big enough for the entire scan to finish before timeout. If the cache is empty or not filled enough to ensure timely completion, randomizing the order of files makes it more likely to spent time on caching new files rather than hashing already cached files to check for the presence of a cache file. Signed-off-by: Tim Wiederhake --- scripts/run-clang-tidy.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/run-clang-tidy.py b/scripts/run-clang-tidy.py index 54eb0ea584..1d1038df0f 100755 --- a/scripts/run-clang-tidy.py +++ b/scripts/run-clang-tidy.py @@ -6,6 +6,7 @@ import json import multiprocessing import os import queue +import random import re import shlex import subprocess @@ -61,6 +62,11 @@ def parse_args(): dest=3D"allow_timeout", action=3D"store_true", help=3D"Do not treat timeout as failure if set") + parser.add_argument( + "--shuffle-input", + dest=3D"shuffle_input", + action=3D"store_true", + help=3D"Randomize order of files to check") =20 return parser.parse_args() =20 @@ -188,6 +194,8 @@ for _ in range(args.thread_num): =20 with open(os.path.join(args.build_dir, "compile_commands.json")) as f: compile_commands =3D json.load(f) + if args.shuffle_input: + random.shuffle(compile_commands) for compile_command in compile_commands: items.put(compile_command) =20 --=20 2.26.2