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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91A25C64EC4 for ; Wed, 8 Mar 2023 18:54:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B842B85E83; Wed, 8 Mar 2023 19:53:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="PYFThcNp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8264F85DCA; Wed, 8 Mar 2023 19:53:24 +0100 (CET) Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7380285DD5 for ; Wed, 8 Mar 2023 19:53:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x1036.google.com with SMTP id fr5-20020a17090ae2c500b0023af8a036d2so2634755pjb.5 for ; Wed, 08 Mar 2023 10:53:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1678301597; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fcjsNtd7+ziZC+MDLYX+vgrIWIgKGvRG/KSM/VkzX7M=; b=PYFThcNpqWUp+XnefD5aXSbx5SZ2OlKnR0+Dizog8QFeCztPZbjyOSIUiICyHJck/J qwI0m8kNS5wEEzWpEpCAPZW/Ut5l9vQav9piXSbotvj9JX3s92+AHyuM9dU33KtD3adW IjhIEQjJSKWKDdaAV6naJ/kr5nUlPpBfWm8Fc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678301597; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fcjsNtd7+ziZC+MDLYX+vgrIWIgKGvRG/KSM/VkzX7M=; b=u1x9WhXRUYam19PxMx1uW8tRCcjCBOIPG4zAMaNSOZ3I9+O+OqRtTza2lmaMScM9NC BoirSN4Ex75B0AVfyXeRl0XQ3gu8MMh1ixIYLQLfvRovenoLeOhdRdS1wSYci0r3ohtq OqphcsKJrgJu8WdsWFrTjrntGsHApvbmURqKyjPrLTUtdws+tPaOUiMj5S7pZi5Fcu8B Jj+dD8jjfAle0DC/aHsegOr8J/sxtWHcyUq0BUt/d9VVNivci6hQtj7zpNnBYbp/OtI4 RinibZv/8wF2Li1A7pkgJJmBln7BeFoixh2rGyEMttInJlEYTVHXgsCJzruKqLFIIWY4 QoLw== X-Gm-Message-State: AO0yUKWgfNXBEFVY+6gaRYCzNJjN+gCdRaguL4aNvqzczEl4QLZFNHbK VLPitqv5bIaChMxp2FV3EaD8VNi5QqrpPC/aOW8= X-Google-Smtp-Source: AK7set+ILFig9Tt3c6YWsIxzibNI3C/WAYhJ8o2TmpGZXb8WTPlXFD2B8XoT041OWCNhDkjc0F/D3g== X-Received: by 2002:a17:902:6b49:b0:19a:7f4b:3ef6 with SMTP id g9-20020a1709026b4900b0019a7f4b3ef6mr16004378plt.3.1678301597734; Wed, 08 Mar 2023 10:53:17 -0800 (PST) Received: from sjg1.corp.google.com ([2620:15c:9d:200:f975:4c6:dcaf:7762]) by smtp.gmail.com with ESMTPSA id kf3-20020a17090305c300b001994fc55998sm10134198plb.217.2023.03.08.10.53.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 10:53:17 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Doug Anderson , Simon Glass , Maxim Cournoyer Subject: [PATCH v3 4/4] patman: Check patches in parallel Date: Wed, 8 Mar 2023 10:52:55 -0800 Message-Id: <20230308185256.120345-5-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.rc0.216.gc4246ad0f0-goog In-Reply-To: <20230308185256.120345-1-sjg@chromium.org> References: <20230308185256.120345-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean For large series this can take a while. Run checkpatch in parallel to try to reduce the time. The checkpatch information is still reported in sequential order, so a very slow patch at the start can still slow things down. But overall this gives good results. Signed-off-by: Simon Glass Reviewed-by: Douglas Anderson --- (no changes since v1) tools/patmanu/checkpatch.py | 46 +++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/tools/patmanu/checkpatch.py b/tools/patmanu/checkpatch.py index 55d962f536f..1317f50b464 100644 --- a/tools/patmanu/checkpatch.py +++ b/tools/patmanu/checkpatch.py @@ -3,6 +3,7 @@ # import collections +import concurrent.futures import os import re import sys @@ -244,26 +245,31 @@ def check_patches(verbose, args, use_tree): error_count, warning_count, check_count = 0, 0, 0 col = terminal.Color() - for fname in args: - result = check_patch(fname, verbose, use_tree=use_tree) - if not result.ok: - error_count += result.errors - warning_count += result.warnings - check_count += result.checks - print('%d errors, %d warnings, %d checks for %s:' % (result.errors, - result.warnings, result.checks, col.build(col.BLUE, fname))) - if (len(result.problems) != result.errors + result.warnings + - result.checks): - print("Internal error: some problems lost") - # Python seems to get confused by this - # pylint: disable=E1133 - for item in result.problems: - sys.stderr.write( - get_warning_msg(col, item.get('type', ''), - item.get('file', ''), - item.get('line', 0), item.get('msg', 'message'))) - print - #print(stdout) + with concurrent.futures.ThreadPoolExecutor(max_workers=16) as executor: + futures = [] + for fname in args: + f = executor.submit(check_patch, fname, verbose, use_tree=use_tree) + futures.append(f) + + for fname, f in zip(args, futures): + result = f.result() + if not result.ok: + error_count += result.errors + warning_count += result.warnings + check_count += result.checks + print('%d errors, %d warnings, %d checks for %s:' % (result.errors, + result.warnings, result.checks, col.build(col.BLUE, fname))) + if (len(result.problems) != result.errors + result.warnings + + result.checks): + print("Internal error: some problems lost") + # Python seems to get confused by this + # pylint: disable=E1133 + for item in result.problems: + sys.stderr.write( + get_warning_msg(col, item.get('type', ''), + item.get('file', ''), + item.get('line', 0), item.get('msg', 'message'))) + print if error_count or warning_count or check_count: str = 'checkpatch.pl found %d error(s), %d warning(s), %d checks(s)' color = col.GREEN -- 2.40.0.rc0.216.gc4246ad0f0-goog