diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-10-18 15:14:36 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 12:21:32 -0800 |
commit | ba637e6d30fd99387e735e696b9c676d3767a45f (patch) | |
tree | 03b4469125f5b347dc77fc1dba76d4b4ab922cf0 /host/lib/usrp | |
parent | 1825f0885212d68205bc082d40e909c56ca3d5a6 (diff) | |
download | uhd-ba637e6d30fd99387e735e696b9c676d3767a45f.tar.gz uhd-ba637e6d30fd99387e735e696b9c676d3767a45f.tar.bz2 uhd-ba637e6d30fd99387e735e696b9c676d3767a45f.zip |
mpmd: Add skip_oldlog device arg
This device arg will avoid printing old log messages by dumping all log
messages in the buffer immediately after claiming a device. This can be
helpful because reading old log messages can be confusing during debug
situations, or simply during situations where we expect errors to
contain warnings or errors, but we want to hide them.
skip_oldlog defaults to off, i.e., the previous behaviour.
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_mboard_impl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp index e7bd0cff9..98e92e210 100644 --- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp @@ -364,6 +364,14 @@ uhd::task::sptr mpmd_mboard_impl::claim_device_and_make_task() // Save token for both RPC clients _claim_rpc->set_token(rpc_token); rpc->set_token(rpc_token); + // Optionally clear log buf + if (mb_args.has_key("skip_oldlog")) { + try { + this->dump_logs(true); + } catch (const uhd::runtime_error&) { + UHD_LOG_WARNING("MPMD", "Could not read back log queue!"); + } + } return uhd::task::make([this] { auto now = std::chrono::steady_clock::now(); if (not this->claim()) { |