From: "Nate DeSimone" <nathaniel.l.desimone@intel.com>
To: "Bjorge, Erik C" <erik.c.bjorge@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Desimone, Ashley E" <ashley.e.desimone@intel.com>,
"Pandya, Puja" <puja.pandya@intel.com>,
Bret Barkelew <Bret.Barkelew@microsoft.com>,
"Agyeman, Prince" <prince.agyeman@intel.com>
Subject: Re: [edk2-staging/EdkRepo] [PATCH v1] EdkRepo: Add timing for commands
Date: Fri, 2 Oct 2020 19:46:40 +0000 [thread overview]
Message-ID: <MWHPR1101MB21605C015D02224EFA41E46FCD310@MWHPR1101MB2160.namprd11.prod.outlook.com> (raw)
In-Reply-To: <8ae2a21328583856d405bc3d9215e3482dad580d.1601662737.git.erik.c.bjorge@intel.com>
I don't think we should print execution time every time. Maybe a --performance flag or something to that effect?
> -----Original Message-----
> From: Erik Bjorge <erik.c.bjorge@intel.com>
> Sent: Friday, October 2, 2020 11:21 AM
> To: devel@edk2.groups.io
> Cc: Desimone, Ashley E <ashley.e.desimone@intel.com>; Desimone,
> Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja
> <puja.pandya@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>;
> Agyeman, Prince <prince.agyeman@intel.com>
> Subject: [edk2-staging/EdkRepo] [PATCH v1] EdkRepo: Add timing for
> commands
>
> Added command timing in the entry point.
>
> Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Puja Pandya <puja.pandya@intel.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Prince Agyeman <prince.agyeman@intel.com>
> Cc: Erik Bjorge <erik.c.bjorge@intel.com>
> Signed-off-by: Erik Bjorge <erik.c.bjorge@intel.com>
> ---
> edkrepo/edkrepo_entry_point.py | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/edkrepo/edkrepo_entry_point.py
> b/edkrepo/edkrepo_entry_point.py index dd2b36e..e944b7a 100644
> --- a/edkrepo/edkrepo_entry_point.py
> +++ b/edkrepo/edkrepo_entry_point.py
> @@ -82,8 +82,11 @@ if __name__ == "__main__" or
> run_via_launcher_script:
> sys.exit(1)
>
> from edkrepo.config.config_factory import GlobalConfig
> +import datetime as dt
> +
>
> def main():
> + start = dt.datetime.now()
> cfg_file = GlobalConfig()
> pref_entry = (cfg_file.preferred_entry[0]).replace('.py', '')
> pref_entry_func = cfg_file.preferred_entry[1] @@ -91,12 +94,15 @@ def
> main():
> try:
> mod = importlib.import_module(pref_entry)
> func = getattr(mod, pref_entry_func)
> - return(func())
> - except Exception as e:
> + ret_code = func()
> + except Exception:
> print('Unable to launch preferred entry point. Launching default entry
> point edkrepo.edkrepo_cli.py')
> traceback.print_exc()
> import edkrepo.edkrepo_cli
> - return edkrepo.edkrepo_cli.main()
> + ret_code = edkrepo.edkrepo_cli.main()
> + print('\nExecution Time: {}'.format(dt.datetime.now() - start))
> + return ret_code
> +
>
> if __name__ == "__main__":
> try:
> --
> 2.21.0.windows.1
next prev parent reply other threads:[~2020-10-02 19:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-02 18:20 [edk2-staging/EdkRepo] [PATCH v1] EdkRepo: Add timing for commands Bjorge, Erik C
2020-10-02 19:46 ` Nate DeSimone [this message]
[not found] ` <MW3PR11MB455429AF451846632C7218F2AE310@MW3PR11MB4554.namprd11.prod.outlook.com>
2020-10-05 20:22 ` Nate DeSimone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MWHPR1101MB21605C015D02224EFA41E46FCD310@MWHPR1101MB2160.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox