From 67010257063f24052ee130e01b8f64ac0daa5a7e Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 21 Nov 2017 14:53:28 -0800 Subject: mpm: Let usrp_hwd.py --init-only show init status and duration Reviewed-By: Brent Stapleton --- mpm/python/usrp_hwd.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'mpm/python') diff --git a/mpm/python/usrp_hwd.py b/mpm/python/usrp_hwd.py index bc8b1e749..fef02087a 100755 --- a/mpm/python/usrp_hwd.py +++ b/mpm/python/usrp_hwd.py @@ -20,6 +20,7 @@ Main executable for the USRP Hardware Daemon """ from __future__ import print_function import sys +import time import argparse from gevent import signal from gevent.hub import BlockingSwitchOutError @@ -143,7 +144,15 @@ def main(): "product": mgr.get_device_info().get("product", "n/a") } if args.init_only: - mgr.init(args.default_args) + init_time_start = time.time() + init_result = mgr.init(args.default_args) + init_duration = time.time() - init_time_start + if init_result: + log.info("Initialization successful! Duration: {:.02f} s" + .format(init_duration)) + else: + log.warning("Initialization failed! Duration: {:.02f} s" + .format(init_duration)) log.info("Terminating on user request before launching RPC server.") mgr.deinit() return True -- cgit v1.2.3