From cff9f03a110b88bd88642565c2878e4b32faceb4 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 30 Nov 2020 16:26:05 +0100 Subject: [PATCH] rlc_am_lte: remove unused rx/tx metrics members those variables aren't used and are included in the bearer metrics already --- lib/include/srslte/upper/rlc_am_lte.h | 9 --------- lib/src/phy/utils/debug.c | 3 +-- lib/src/upper/rlc_am_lte.cc | 29 +-------------------------- 3 files changed, 2 insertions(+), 39 deletions(-) diff --git a/lib/include/srslte/upper/rlc_am_lte.h b/lib/include/srslte/upper/rlc_am_lte.h index cf1581faf..74527d1a8 100644 --- a/lib/include/srslte/upper/rlc_am_lte.h +++ b/lib/include/srslte/upper/rlc_am_lte.h @@ -106,8 +106,6 @@ private: bool has_data(); uint32_t get_buffer_state(); - uint32_t get_num_tx_bytes(); - void reset_metrics(); // Timeout callback interface void timer_expired(uint32_t timeout_id); @@ -184,9 +182,6 @@ private: // Mutexes pthread_mutex_t mutex; - - // Metrics - uint32_t num_tx_bytes = 0; }; // Receiver sub-class @@ -203,7 +198,6 @@ private: void write_pdu(uint8_t* payload, uint32_t nof_bytes); uint32_t get_num_rx_bytes(); - void reset_metrics(); // Timeout callback interface void timer_expired(uint32_t timeout_id); @@ -255,9 +249,6 @@ private: std::map rx_window; std::map rx_segments; - // Metrics - uint32_t num_rx_bytes = 0; - bool poll_received = false; bool do_status = false; diff --git a/lib/src/phy/utils/debug.c b/lib/src/phy/utils/debug.c index c0dbb4556..44b3bb636 100644 --- a/lib/src/phy/utils/debug.c +++ b/lib/src/phy/utils/debug.c @@ -18,11 +18,10 @@ int handler_registered = 0; void get_time_interval(struct timeval* tdata) { - tdata[0].tv_sec = tdata[2].tv_sec - tdata[1].tv_sec; tdata[0].tv_usec = tdata[2].tv_usec - tdata[1].tv_usec; if (tdata[0].tv_usec < 0) { tdata[0].tv_sec--; tdata[0].tv_usec += 1000000; } -} +} \ No newline at end of file diff --git a/lib/src/upper/rlc_am_lte.cc b/lib/src/upper/rlc_am_lte.cc index 4bf881d94..a04491cf9 100644 --- a/lib/src/upper/rlc_am_lte.cc +++ b/lib/src/upper/rlc_am_lte.cc @@ -104,8 +104,7 @@ rlc_bearer_metrics_t rlc_am_lte::get_metrics() void rlc_am_lte::reset_metrics() { - tx.reset_metrics(); - rx.reset_metrics(); + metrics = {}; } /**************************************************************************** @@ -424,7 +423,6 @@ int rlc_am_lte::rlc_am_lte_tx::read_pdu(uint8_t* payload, uint32_t nof_bytes) pdu_size = build_data_pdu(payload, nof_bytes); unlock_and_exit: - num_tx_bytes += pdu_size; pthread_mutex_unlock(&mutex); return pdu_size; } @@ -464,18 +462,6 @@ void rlc_am_lte::rlc_am_lte_tx::retransmit_random_pdu() } } -uint32_t rlc_am_lte::rlc_am_lte_tx::get_num_tx_bytes() -{ - return num_tx_bytes; -} - -void rlc_am_lte::rlc_am_lte_tx::reset_metrics() -{ - pthread_mutex_lock(&mutex); - num_tx_bytes = 0; - pthread_mutex_unlock(&mutex); -} - /**************************************************************************** * Helper functions ***************************************************************************/ @@ -1577,25 +1563,12 @@ bool rlc_am_lte::rlc_am_lte_rx::get_do_status() return do_status; } -uint32_t rlc_am_lte::rlc_am_lte_rx::get_num_rx_bytes() -{ - return num_rx_bytes; -} - -void rlc_am_lte::rlc_am_lte_rx::reset_metrics() -{ - pthread_mutex_lock(&mutex); - num_rx_bytes = 0; - pthread_mutex_unlock(&mutex); -} - void rlc_am_lte::rlc_am_lte_rx::write_pdu(uint8_t* payload, const uint32_t nof_bytes) { if (nof_bytes < 1) return; pthread_mutex_lock(&mutex); - num_rx_bytes += nof_bytes; if (rlc_am_is_control_pdu(payload)) { // unlock mutex and pass to Tx subclass