aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-11-21 14:53:28 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:07 -0800
commit67010257063f24052ee130e01b8f64ac0daa5a7e (patch)
tree897466774d887de5c782907494dfc00d248192a2 /mpm/python
parentafe889af2b7dd13904cd2ce9f401a0221b047b3d (diff)
downloaduhd-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-xmpm/python/usrp_hwd.py11
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