From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.1859.1601662870098697529 for ; Fri, 02 Oct 2020 11:21:10 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: erik.c.bjorge@intel.com) IronPort-SDR: f/0SJiM06nS6Izyni5EGudfOiveXGXo1sUKlmdOGeQXkp1Baa5uXrcyvDnEUwJQEo3YYdDqvH9 m2WxXodyauRg== X-IronPort-AV: E=McAfee;i="6000,8403,9762"; a="227176094" X-IronPort-AV: E=Sophos;i="5.77,328,1596524400"; d="scan'208";a="227176094" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2020 11:21:08 -0700 IronPort-SDR: kQoBnsTiCiB8XWLKGyIZe5aBMRgS6qW9S98PLzOHxCUmDnHxRoBana4hkXENER5GepQ9lf3Ruq aZEjHTwV8h4A== X-IronPort-AV: E=Sophos;i="5.77,328,1596524400"; d="scan'208";a="325889704" Received: from ecbjorge-mobl1.amr.corp.intel.com ([10.209.157.76]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2020 11:21:08 -0700 From: "Bjorge, Erik C" To: devel@edk2.groups.io Cc: Ashley E Desimone , Nate DeSimone , Puja Pandya , Bret Barkelew , Prince Agyeman Subject: [edk2-staging/EdkRepo] [PATCH v1] EdkRepo: Add timing for commands Date: Fri, 2 Oct 2020 11:20:37 -0700 Message-Id: <8ae2a21328583856d405bc3d9215e3482dad580d.1601662737.git.erik.c.bjorge@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Added command timing in the entry point. Cc: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Bret Barkelew Cc: Prince Agyeman Cc: Erik Bjorge Signed-off-by: Erik Bjorge --- 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