uhd: log useful information on monotonic errors
Track the current errant and previous timestamp values. Signed-off-by: Thomas Tsou <ttsou@vt.edu>
This commit is contained in:
parent
6c51f54909
commit
39f0bcfd18
|
@ -380,18 +380,23 @@ void uhd_device::setPriority()
|
|||
|
||||
static int check_rx_md_err(uhd::rx_metadata_t &md, uhd::time_spec_t &prev_ts)
|
||||
{
|
||||
uhd::time_spec_t ts;
|
||||
|
||||
// Missing timestamp
|
||||
if (!md.has_time_spec) {
|
||||
LOG(ERROR) << "UHD: Received packet missing timestamp";
|
||||
return -1;
|
||||
}
|
||||
|
||||
ts = md.time_spec;
|
||||
|
||||
// Monotonicity check
|
||||
if (md.time_spec < prev_ts) {
|
||||
LOG(ERROR) << "Loss of monotonicity";
|
||||
if (ts < prev_ts) {
|
||||
LOG(ERROR) << "UHD: Loss of monotonic: " << ts.get_real_secs();
|
||||
LOG(ERROR) << "UHD: Previous time: " << prev_ts.get_real_secs();
|
||||
return -1;
|
||||
} else {
|
||||
prev_ts = md.time_spec;
|
||||
prev_ts = ts;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -398,18 +398,23 @@ void uhd_device::setPriority()
|
|||
|
||||
static int check_rx_md_err(uhd::rx_metadata_t &md, uhd::time_spec_t &prev_ts)
|
||||
{
|
||||
uhd::time_spec_t ts;
|
||||
|
||||
// Missing timestamp
|
||||
if (!md.has_time_spec) {
|
||||
LOG(ERROR) << "UHD: Received packet missing timestamp";
|
||||
return -1;
|
||||
}
|
||||
|
||||
ts = md.time_spec;
|
||||
|
||||
// Monotonicity check
|
||||
if (md.time_spec < prev_ts) {
|
||||
LOG(ERROR) << "Loss of monotonicity";
|
||||
if (ts < prev_ts) {
|
||||
LOG(ERROR) << "UHD: Loss of monotonic: " << ts.get_real_secs();
|
||||
LOG(ERROR) << "UHD: Previous time: " << prev_ts.get_real_secs();
|
||||
return -1;
|
||||
} else {
|
||||
prev_ts = md.time_spec;
|
||||
prev_ts = ts;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Reference in New Issue