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 1B7CDC001DF for ; Sun, 16 Jul 2023 00:43:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8DC386657; Sun, 16 Jul 2023 02:39:21 +0200 (CEST) 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="dWUuwZcc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 53050865F0; Sun, 16 Jul 2023 02:37:59 +0200 (CEST) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 4B630862B9 for ; Sun, 16 Jul 2023 02:37:49 +0200 (CEST) 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-io1-xd33.google.com with SMTP id ca18e2360f4ac-78363cc070aso162431239f.1 for ; Sat, 15 Jul 2023 17:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467868; x=1692059868; 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=d/niLHqVsy1oT0A9lzaaTEf7vrPClJJUurM5coRmR+I=; b=dWUuwZccASUKhL6sDLn6HMDA3BpelqHf06jvE8GwuQJRMhZm7D04N/mzKei4n1EQL1 B0FTC9Rs+WN3wXRw9BIVRAnVZzwsUj5sOnx0xeBiEEqOoFjMmvDO9yvGAZ5I5WYsDlKL Whp+PSh/J+V8ZVjBzSfMEHX9U2YbprV5kBjgo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467868; x=1692059868; 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=d/niLHqVsy1oT0A9lzaaTEf7vrPClJJUurM5coRmR+I=; b=R7ivW4IeYRL7gaEA64ywdcElddUJxJ/y7uXTXRZS3+N17t7LofR5AusbSn2Tw2skST neqSpS08JqabT1mtC8MA8whFcDvmMZJjDd7/uMMco/eseogbvs9ojxOlmRd/fH8l42z1 8OL/QcaCaX21B6MF4vjCq0e1FewG7a4SMAQcPsg0LPeK+YSCX+yxSErdPQzNa1Pi0v2v UNSKa+xL2+8TXILkmjFVEMKsG1mgQTqC80YHAE9PwiXzBx7aSGWuzugbVKoFz3B4FDYR BG+buGE5tOPIVaWLjtZvqTS74Qli5KcEq36Go5TLQz8Zwxo9q4RMG6bK8mr9jlAI8Rus TR9w== X-Gm-Message-State: ABy/qLYbotPysJU/kqg1K3Rzo2sBql2oXOQJAtD8rS81CLFiKo5ZQ87G 9CyBsHNdFkWwoGc3VcjmZ3N5l2O4EUqjzIRvE8k= X-Google-Smtp-Source: APBJJlHciDtPJHoKUc7uSYF3Z+bukwKp/VauHW/82l9IweGygEq+T/gro4P2FgZZ+HusVhlmjUb1Kw== X-Received: by 2002:a92:cd08:0:b0:345:d0c1:12b5 with SMTP id z8-20020a92cd08000000b00345d0c112b5mr8956981iln.26.1689467867927; Sat, 15 Jul 2023 17:37:47 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id t3-20020a05663801e300b0042b52dc77e3sm3510512jaq.158.2023.07.15.17.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:37:47 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 35/81] buildman: Pass option values to get_action_summary() Date: Sat, 15 Jul 2023 18:36:03 -0600 Message-ID: <20230716003718.231903-36-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.455.g037347b96a-goog In-Reply-To: <20230716003718.231903-1-sjg@chromium.org> References: <20230716003718.231903-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 Pass in the individual values rather than the whole options object, so we can see what is needed. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/control.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tools/buildman/control.py b/tools/buildman/control.py index a9e5b84c4b8e..a1a4adf25a96 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -29,22 +29,30 @@ def get_plural(count): """Returns a plural 's' if count is not 1""" return 's' if count != 1 else '' -def get_action_summary(is_summary, commits, selected, options): +def get_action_summary(is_summary, commits, selected, step, threads, jobs): """Return a string summarising the intended action. + Args: + is_summary (bool): True if this is a summary (otherwise it is building) + commits (list): List of commits being built + selected (list of Board): List of Board objects that are marked + step (int): Step increment through commits + threads (int): Number of processor threads being used + jobs (int): Number of jobs to build at once + Returns: Summary string. """ if commits: count = len(commits) - count = (count + options.step - 1) // options.step + count = (count + step - 1) // step commit_str = f'{count} commit{get_plural(count)}' else: commit_str = 'current source' msg = (f"{'Summary of' if is_summary else 'Building'} " f'{commit_str} for {len(selected)} boards') - msg += (f' ({options.threads} thread{get_plural(options.threads)}, ' - f'{options.jobs} job{get_plural(options.jobs)} per thread)') + msg += (f' ({threads} thread{get_plural(threads)}, ' + f'{jobs} job{get_plural(jobs)} per thread)') return msg # pylint: disable=R0913 @@ -73,7 +81,7 @@ def show_actions(series, why_selected, boards_selected, output_dir, options, else: commits = None print(get_action_summary(False, commits, boards_selected, - options)) + options.step, options.threads, options.jobs)) print(f'Build directory: {output_dir}') if commits: for upto in range(0, len(series.commits), options.step): @@ -152,7 +160,7 @@ def determine_series(selected, col, git_dir, count, branch, work_in_output): """Determine the series which is to be built, if any Args: - selected (list of Board(: List of Board objects that are marked + selected (list of Board): List of Board objects that are marked selected col (Terminal.Color): Color object to use git_dir (str): Git directory to use, e.g. './.git' @@ -523,7 +531,7 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None, if not options.ide: tprint(get_action_summary(options.summary, commits, board_selected, - options)) + options.step, options.threads, options.jobs)) # We can't show function sizes without board details at present if options.show_bloat: -- 2.41.0.455.g037347b96a-goog