diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-11-21 14:53:28 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:07 -0800 |
commit | 67010257063f24052ee130e01b8f64ac0daa5a7e (patch) | |
tree | 897466774d887de5c782907494dfc00d248192a2 /mpm/python | |
parent | afe889af2b7dd13904cd2ce9f401a0221b047b3d (diff) | |
download | uhd-67010257063f24052ee130e01b8f64ac0daa5a7e.tar.gz uhd-67010257063f24052ee130e01b8f64ac0daa5a7e.tar.bz2 uhd-67010257063f24052ee130e01b8f64ac0daa5a7e.zip |
mpm: Let usrp_hwd.py --init-only show init status and duration
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
Diffstat (limited to 'mpm/python')
-rwxr-xr-x | mpm/python/usrp_hwd.py | 11 |
1 files changed, 10 insertions, 1 deletions
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 |