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 B1941C001DC for ; Wed, 19 Jul 2023 23:56:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C61B886851; Thu, 20 Jul 2023 01:51:36 +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="fJl8Ge/i"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EECC4867EA; Thu, 20 Jul 2023 01:50:33 +0200 (CEST) Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 65B49867D8 for ; Thu, 20 Jul 2023 01:50:28 +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-il1-x135.google.com with SMTP id e9e14a558f8ab-345db6c12b4so1626555ab.0 for ; Wed, 19 Jul 2023 16:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810627; x=1690415427; 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=zVe5dzmxFfBHySONx1iSlHNo6+IdaxyA983K2X6UMZM=; b=fJl8Ge/ikoQdmP8h6nbjBKK26Spi0I4xgVOSN5KXqVWdGWxeRpEyDsWo7ObNN248/p yf5sAVgFOKvAQL7PAG5TiUR6ytNI18lP3BNP8mVg2EW+Q5nJcPDimm/N8u8NQJkNUzza Eot8ox2pbyexuwzwvvQ99Igp36O2190VGpdW0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810627; x=1690415427; 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=zVe5dzmxFfBHySONx1iSlHNo6+IdaxyA983K2X6UMZM=; b=XY6KDbj0+jtPPI0cJomjl0Rhdp9SjE7YzDbUzM5P6iJUJ/5XwSIFiAnqvwi0XO46E6 PWJOhQ/m+VQTYM+wU17pwzZlWgCSh0TpH48N/lmllCOtj6549IV3lvotxIfqz8EuljdO qwpeYC9M+jg0Ri96OWRuEBGObqadA1grJxRX4x6KuBPArDU6S4709Rp0emN7WyEomsPb w51SZb4pdXMBJXB0haaOTcycdL0eOlEkr2EkymP41rdkHgBh5543gLS+5phTMhp8cR1f sa4/eIemJZhfL9xl30u3r8N7egMMfA0YrkKlv0qEzFyXmGnrmOZ7aekB0BwLnFnLI+Wf bYcw== X-Gm-Message-State: ABy/qLaJS3nGuvC4j11DbAfbqUMnLVRf5H4oNOUAmF3yT+kuzv4z1Wli 6QUCXs1j199YUsNkEsS+7QWFpNZYIRDmXkBu9zM= X-Google-Smtp-Source: APBJJlF7DF6wtlEBrLJG8xksfRBSCGA6DATX6gIaA+NV2Qg2Fc3eHKItH8koxCqzJERscPjsRZz1EQ== X-Received: by 2002:a05:6e02:214f:b0:346:24c2:4f87 with SMTP id d15-20020a056e02214f00b0034624c24f87mr7935193ilv.32.1689810626939; Wed, 19 Jul 2023 16:50:26 -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 ed16-20020a056638291000b0042bb1779c18sm1551779jab.151.2023.07.19.16.50.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:26 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 37/83] buildman: Pass option values to get_action_summary() Date: Wed, 19 Jul 2023 17:48:45 -0600 Message-ID: <20230719234953.796101-38-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230719234953.796101-1-sjg@chromium.org> References: <20230719234953.796101-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.487.g6d72f3e995-goog