From nobody Fri Apr 26 16:53:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+65905+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65905+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1601941327; cv=none; d=zohomail.com; s=zohoarc; b=Gr03INCpuDoMAIiWiwnXCbbDUmfUkVCIgORbl27ZFaEHOVtKz2msxOeOjZNu3YYWIL8sN4uHm+vufJOyVrWdNd8UZqxVQyhX0Mvgqq8QBkM2mTbVBfkvwQa2x4NgltYKnJf0Spi6/RWEKfkwlUE1Sov/AL/r23zrcJGhHYPhR/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601941327; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=zE3QP++fh28+RCZEIxgo5TKba6mvPkK/YpW16BfF8ic=; b=JCa4iKgR6joiC2ULT5lsHNNZOBT3Sgcy4jM1BCzPfgFFkrbe6gZAanflxVk5JoadEwaAQZ9hBcDSvGwPPNcA5+XUVSVPSik3pE2m/EJn3TWl46pEU7lwFLLlGUYqXXhEylfXBnsOL8uwUoIGcRPKgOCj1KHKISyNugHBmyPz2/4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65905+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1601941327509804.5117777717388; Mon, 5 Oct 2020 16:42:07 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id DCaGYY1788612x4dI7vTnvGI; Mon, 05 Oct 2020 16:42:07 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.2540.1601941146536205067 for ; Mon, 05 Oct 2020 16:39:06 -0700 IronPort-SDR: VJ2hOXKMzgFusJDQxqxRptVNPoxnnQyZddx0Gq+brbzaOpf88ebJzvJkVguV+OZzBUujsFuAR8 yfNKTKox6Ehg== X-IronPort-AV: E=McAfee;i="6000,8403,9765"; a="181714234" X-IronPort-AV: E=Sophos;i="5.77,341,1596524400"; d="scan'208";a="181714234" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2020 16:34:34 -0700 IronPort-SDR: Adcgk8d3zDhsOmurdrIcdXIxztB24QrG/gdxhwiqUeHjya4WB/CSHaAGQomYZ//itkAPgqMe3C KToZ6ykEXlUQ== X-IronPort-AV: E=Sophos;i="5.77,341,1596524400"; d="scan'208";a="353766258" X-Received: from ecbjorge-mobl1.amr.corp.intel.com ([10.212.227.145]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2020 14:55:23 -0700 From: "Bjorge, Erik C" To: devel@edk2.groups.io Cc: Ashley E Desimone , Nate DeSimone , Puja Pandya , Bret Barkelew , Prince Agyeman Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH v2] EdkRepo: Adding performance option Date: Mon, 5 Oct 2020 14:54:47 -0700 Message-Id: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,erik.c.bjorge@intel.com X-Gm-Message-State: TNKfFYPrZetXy02AoAp9uyk5x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1601941327; bh=Ix8eArdCdqV1Que7ttP2e6Ay77YtTqEMmdiWjvKYv78=; h=Cc:Date:From:Reply-To:Subject:To; b=M+zTybS+qxIMCK3N/6m6fTFzMLuubhfvsfAFC4k2SDasSOlyflLyrSS+cBL4lb3FdUO VjeaQLOwy6UZSE/IDET71XAdVBLPhpSBqrqxJnhxSHQ6oyVzUED3CU1OhXIVHVm/rSdHB JZnuICmrl1Xtk/VQC7xw+AiC/PuCYClMCkY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This new option will display the execution time of a successful command. Cc: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Bret Barkelew Cc: Prince Agyeman Cc: Erik Bjorge Signed-off-by: Erik Bjorge Reviewed-by: Ashley DeSimone Reviewed-by: Nate DeSimone --- edkrepo/commands/arguments/edkrepo_cmd_args.py | 3 ++- edkrepo/commands/composite_command.py | 4 +++- edkrepo/commands/edkrepo_command.py | 7 ++++++- edkrepo/edkrepo_cli.py | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/edkrepo/commands/arguments/edkrepo_cmd_args.py b/edkrepo/comma= nds/arguments/edkrepo_cmd_args.py index e8a6138..2fab8c1 100644 --- a/edkrepo/commands/arguments/edkrepo_cmd_args.py +++ b/edkrepo/commands/arguments/edkrepo_cmd_args.py @@ -3,7 +3,7 @@ ## @file # argument_strings.py # -# Copyright (c) 2017- 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2017- 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # =20 @@ -17,3 +17,4 @@ OVERRIDE_HELP =3D 'Ignore warnings' SUBMODULE_SKIP_HELP =3D 'Skip the pull or sync of any submodules.' COLOR_HELP =3D 'Force color output (useful with \'less -r\')' SOURCE_MANIFEST_REPO_HELP =3D "The name of the workspace's source global m= anifest repository" +PERFORMANCE_HELP =3D 'Displays performance timing data for successful comm= ands' diff --git a/edkrepo/commands/composite_command.py b/edkrepo/commands/compo= site_command.py index ff53d3b..72cb029 100644 --- a/edkrepo/commands/composite_command.py +++ b/edkrepo/commands/composite_command.py @@ -7,7 +7,8 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent # =20 -from edkrepo.commands.edkrepo_command import VerboseArgument +from edkrepo.commands.edkrepo_command import VerboseArgument, PerformanceA= rgument + =20 class CompositeCommand(object): def __init__(self): @@ -21,6 +22,7 @@ class CompositeCommand(object): if command.get_metadata()['name'] =3D=3D command_name: metadata =3D command.get_metadata() args =3D metadata['arguments'] + args.append(PerformanceArgument) args.append(VerboseArgument) metadata['arguments'] =3D args return metadata diff --git a/edkrepo/commands/edkrepo_command.py b/edkrepo/commands/edkrepo= _command.py index edd29a9..320dd9c 100644 --- a/edkrepo/commands/edkrepo_command.py +++ b/edkrepo/commands/edkrepo_command.py @@ -3,7 +3,7 @@ ## @file # edkrepo_command.py # -# Copyright (c) 2017- 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2017- 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # =20 @@ -54,3 +54,8 @@ SourceManifestRepoArgument =3D {'name' : 'source-manifest= -repo', 'required' : False, 'action' : 'store', 'help-text' : arguments.SOURCE_MANIFEST_REPO_HELP} + +PerformanceArgument =3D {'name': 'performance', + 'positional': False, + 'required': False, + 'help-text': arguments.PERFORMANCE_HELP} diff --git a/edkrepo/edkrepo_cli.py b/edkrepo/edkrepo_cli.py index 03061c9..4e7ff16 100644 --- a/edkrepo/edkrepo_cli.py +++ b/edkrepo/edkrepo_cli.py @@ -20,6 +20,7 @@ import site import inspect import imp import importlib.util +import datetime as dt =20 from git.exc import GitCommandError =20 @@ -157,6 +158,7 @@ def generate_command_completion_script(script_filename,= parser): f.write(' complete -F _edkrepo_completions edkrepo\nfi\n') =20 def main(): + start_time =3D dt.datetime.now() command =3D command_factory.create_composite_command() config =3D {} try: @@ -207,6 +209,8 @@ def main(): traceback.print_exc() print("Error: {}".format(str(e))) return 1 + if parsed_args.performance: + print('\nExecution Time: {}'.format(dt.datetime.now() - start_time= )) return 0 =20 if __name__ =3D=3D "__main__": --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#65905): https://edk2.groups.io/g/devel/message/65905 Mute This Topic: https://groups.io/mt/77331466/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-