From dc65061dbb2ccf0e78abfaea1886ff7e3da7912a Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 6 Mar 2018 12:37:45 +0100 Subject: [PATCH] Print buffer pool status every 10s (Debugging commit) --- lib/include/srslte/common/buffer_pool.h | 3 +++ srsue/hdr/ue.h | 2 ++ srsue/hdr/ue_base.h | 2 ++ srsue/src/main.cc | 3 ++- srsue/src/ue.cc | 4 ++++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/common/buffer_pool.h b/lib/include/srslte/common/buffer_pool.h index 4edc50fc6..035fbc661 100644 --- a/lib/include/srslte/common/buffer_pool.h +++ b/lib/include/srslte/common/buffer_pool.h @@ -173,6 +173,9 @@ public: pool->deallocate(b); b = NULL; } + void print_all_buffers() { + pool->print_all_buffers(); + } private: buffer_pool *pool; }; diff --git a/srsue/hdr/ue.h b/srsue/hdr/ue.h index e6c66b540..d1343c68f 100644 --- a/srsue/hdr/ue.h +++ b/srsue/hdr/ue.h @@ -72,6 +72,8 @@ public: bool is_attached(); void start_plot(); + void print_pool(); + static void rf_msg(srslte_rf_error_t error); // UE metrics interface diff --git a/srsue/hdr/ue_base.h b/srsue/hdr/ue_base.h index 201f63843..7baa0dfc6 100644 --- a/srsue/hdr/ue_base.h +++ b/srsue/hdr/ue_base.h @@ -157,6 +157,8 @@ public: virtual bool is_attached() = 0; virtual void start_plot() = 0; + virtual void print_pool() = 0; + virtual void radio_overflow() = 0; void handle_rf_msg(srslte_rf_error_t error); diff --git a/srsue/src/main.cc b/srsue/src/main.cc index 1cac2092d..e687756ed 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -474,7 +474,8 @@ int main(int argc, char *argv[]) plot_started = true; } } - sleep(1); + ue->print_pool(); + sleep(10); } pthread_cancel(input); metricshub.stop(); diff --git a/srsue/src/ue.cc b/srsue/src/ue.cc index 23175fa46..e9afcec41 100644 --- a/srsue/src/ue.cc +++ b/srsue/src/ue.cc @@ -278,6 +278,10 @@ void ue::start_plot() { phy.start_plot(); } +void ue::print_pool() { + byte_buffer_pool::get_instance()->print_all_buffers(); +} + bool ue::get_metrics(ue_metrics_t &m) { m.rf = rf_metrics;