disable RLC latency measure when ENABLE_TIMESTAMP flag is disabled

master
Francisco 4 years ago committed by Francisco Paisana
parent 92bc98e2f0
commit 951912d18a

@ -185,8 +185,10 @@ private:
pthread_mutex_t mutex; pthread_mutex_t mutex;
// Metrics // Metrics
uint64_t tx_byte_count = 0; uint64_t tx_byte_count = 0;
#ifdef ENABLE_TIMESTAMP
srslte::rolling_average<double> mean_pdu_latency_us; srslte::rolling_average<double> mean_pdu_latency_us;
#endif
}; };
// Receiver sub-class // Receiver sub-class

@ -65,9 +65,10 @@ private:
uint32_t vt_us = 0; // Send state. SN to be assigned for next PDU. uint32_t vt_us = 0; // Send state. SN to be assigned for next PDU.
// Metrics // Metrics
uint64_t tx_byte_count = 0; uint64_t tx_byte_count = 0;
#ifdef ENABLE_TIMESTAMP
srslte::rolling_average<double> mean_pdu_latency_us; srslte::rolling_average<double> mean_pdu_latency_us;
#endif
void debug_state(); void debug_state();
}; };

@ -837,12 +837,14 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt
tx_sdu->N_bytes -= to_move; tx_sdu->N_bytes -= to_move;
tx_sdu->msg += to_move; tx_sdu->msg += to_move;
if (tx_sdu->N_bytes == 0) { if (tx_sdu->N_bytes == 0) {
#ifdef ENABLE_TIMESTAMP
long latency_us = tx_sdu->get_latency_us(); long latency_us = tx_sdu->get_latency_us();
mean_pdu_latency_us.push(latency_us); mean_pdu_latency_us.push(latency_us);
log->debug("%s Complete SDU scheduled for tx. Stack latency (last/average): %ld/%ld us\n", log->debug("%s Complete SDU scheduled for tx. Stack latency (last/average): %ld/%ld us\n",
RB_NAME, RB_NAME,
latency_us, latency_us,
(long)mean_pdu_latency_us.value()); (long)mean_pdu_latency_us.value());
#endif
tx_sdu.reset(); tx_sdu.reset();
} }
if (pdu_space > to_move) { if (pdu_space > to_move) {
@ -881,12 +883,14 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt
tx_sdu->N_bytes -= to_move; tx_sdu->N_bytes -= to_move;
tx_sdu->msg += to_move; tx_sdu->msg += to_move;
if (tx_sdu->N_bytes == 0) { if (tx_sdu->N_bytes == 0) {
#ifdef ENABLE_TIMESTAMP
long latency_us = tx_sdu->get_latency_us(); long latency_us = tx_sdu->get_latency_us();
mean_pdu_latency_us.push(latency_us); mean_pdu_latency_us.push(latency_us);
log->debug("%s Complete SDU scheduled for tx. Stack latency (last/average): %ld/%ld us\n", log->debug("%s Complete SDU scheduled for tx. Stack latency (last/average): %ld/%ld us\n",
RB_NAME, RB_NAME,
latency_us, latency_us,
(long)mean_pdu_latency_us.value()); (long)mean_pdu_latency_us.value());
#endif
tx_sdu.reset(); tx_sdu.reset();
} }
if (pdu_space > to_move) { if (pdu_space > to_move) {

@ -145,13 +145,14 @@ int rlc_um_lte::rlc_um_lte_tx::build_data_pdu(unique_byte_buffer_t pdu, uint8_t*
tx_sdu->N_bytes -= to_move; tx_sdu->N_bytes -= to_move;
tx_sdu->msg += to_move; tx_sdu->msg += to_move;
if (tx_sdu->N_bytes == 0) { if (tx_sdu->N_bytes == 0) {
#ifdef ENABLE_TIMESTAMP
long latency_us = tx_sdu->get_latency_us(); long latency_us = tx_sdu->get_latency_us();
mean_pdu_latency_us.push(latency_us); mean_pdu_latency_us.push(latency_us);
log->debug("%s Complete SDU scheduled for tx. Stack latency (last/average): %ld/%ld us\n", log->debug("%s Complete SDU scheduled for tx. Stack latency (last/average): %ld/%ld us\n",
rb_name.c_str(), rb_name.c_str(),
latency_us, latency_us,
(long)mean_pdu_latency_us.value()); (long)mean_pdu_latency_us.value());
#endif
tx_sdu.reset(); tx_sdu.reset();
} }
pdu_space -= SRSLTE_MIN(to_move, pdu->get_tailroom()); pdu_space -= SRSLTE_MIN(to_move, pdu->get_tailroom());
@ -181,13 +182,14 @@ int rlc_um_lte::rlc_um_lte_tx::build_data_pdu(unique_byte_buffer_t pdu, uint8_t*
tx_sdu->N_bytes -= to_move; tx_sdu->N_bytes -= to_move;
tx_sdu->msg += to_move; tx_sdu->msg += to_move;
if (tx_sdu->N_bytes == 0) { if (tx_sdu->N_bytes == 0) {
#ifdef ENABLE_TIMESTAMP
long latency_us = tx_sdu->get_latency_us(); long latency_us = tx_sdu->get_latency_us();
mean_pdu_latency_us.push(latency_us); mean_pdu_latency_us.push(latency_us);
log->debug("%s Complete SDU scheduled for tx. Stack latency (last/average): %ld/%ld us\n", log->debug("%s Complete SDU scheduled for tx. Stack latency (last/average): %ld/%ld us\n",
rb_name.c_str(), rb_name.c_str(),
latency_us, latency_us,
(long)mean_pdu_latency_us.value()); (long)mean_pdu_latency_us.value());
#endif
tx_sdu.reset(); tx_sdu.reset();
} }
pdu_space -= to_move; pdu_space -= to_move;

Loading…
Cancel
Save