Add source of Late message

master
Ismael Gomez 7 years ago
parent db4045f214
commit 931cfa2db9

@ -76,9 +76,10 @@ static void log_overflow(rf_uhd_handler_t *h) {
} }
} }
static void log_late(rf_uhd_handler_t *h) { static void log_late(rf_uhd_handler_t *h, bool is_rx) {
if (h->uhd_error_handler) { if (h->uhd_error_handler) {
srslte_rf_error_t error; srslte_rf_error_t error;
error.opt = is_rx?1:0;
bzero(&error, sizeof(srslte_rf_error_t)); bzero(&error, sizeof(srslte_rf_error_t));
error.type = SRSLTE_RF_ERROR_LATE; error.type = SRSLTE_RF_ERROR_LATE;
h->uhd_error_handler(error); h->uhd_error_handler(error);
@ -109,7 +110,7 @@ static void* async_thread(void *h) {
event_code == UHD_ASYNC_METADATA_EVENT_CODE_UNDERFLOW_IN_PACKET) { event_code == UHD_ASYNC_METADATA_EVENT_CODE_UNDERFLOW_IN_PACKET) {
log_underflow(handler); log_underflow(handler);
} else if (event_code == UHD_ASYNC_METADATA_EVENT_CODE_TIME_ERROR) { } else if (event_code == UHD_ASYNC_METADATA_EVENT_CODE_TIME_ERROR) {
log_late(handler); log_late(handler, false);
} }
} }
} else { } else {
@ -647,7 +648,7 @@ int rf_uhd_recv_with_time_multi(void *h,
if (error_code == UHD_RX_METADATA_ERROR_CODE_OVERFLOW) { if (error_code == UHD_RX_METADATA_ERROR_CODE_OVERFLOW) {
log_overflow(handler); log_overflow(handler);
} else if (error_code == UHD_RX_METADATA_ERROR_CODE_LATE_COMMAND) { } else if (error_code == UHD_RX_METADATA_ERROR_CODE_LATE_COMMAND) {
log_late(handler); log_late(handler, true);
} else if (error_code == UHD_RX_METADATA_ERROR_CODE_TIMEOUT) { } else if (error_code == UHD_RX_METADATA_ERROR_CODE_TIMEOUT) {
fprintf(stderr, "Error timed out while receiving samples from UHD.\n"); fprintf(stderr, "Error timed out while receiving samples from UHD.\n");
return -1; return -1;

@ -88,7 +88,7 @@ void ue_base::handle_rf_msg(srslte_rf_error_t error)
} else if(error.type == srslte_rf_error_t::SRSLTE_RF_ERROR_LATE) { } else if(error.type == srslte_rf_error_t::SRSLTE_RF_ERROR_LATE) {
rf_metrics.rf_l++; rf_metrics.rf_l++;
rf_metrics.rf_error = true; rf_metrics.rf_error = true;
rf_log.warning("Late\n"); rf_log.warning("Late (detected in %s)\n", error.opt?"rx call":"asynchronous thread");
} else if (error.type == srslte_rf_error_t::SRSLTE_RF_ERROR_OTHER) { } else if (error.type == srslte_rf_error_t::SRSLTE_RF_ERROR_OTHER) {
std::string str(error.msg); std::string str(error.msg);
str.erase(std::remove(str.begin(), str.end(), '\n'), str.end()); str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());

Loading…
Cancel
Save