diff --git a/srsenb/hdr/enb.h b/srsenb/hdr/enb.h index 745096daa..3ab6e9a4c 100644 --- a/srsenb/hdr/enb.h +++ b/srsenb/hdr/enb.h @@ -126,6 +126,7 @@ typedef struct { mac_args_t mac; uint32_t rrc_inactivity_timer; float metrics_period_secs; + bool print_buffer_state; }expert_args_t; typedef struct { @@ -156,6 +157,8 @@ public: void start_plot(); + void print_pool(); + static void rf_msg(srslte_rf_error_t error); void handle_rf_msg(srslte_rf_error_t error); diff --git a/srsenb/src/enb.cc b/srsenb/src/enb.cc index e91aea7bf..fdf959a95 100644 --- a/srsenb/src/enb.cc +++ b/srsenb/src/enb.cc @@ -256,6 +256,10 @@ void enb::start_plot() { phy.start_plot(); } +void enb::print_pool() { + srslte::byte_buffer_pool::get_instance()->print_all_buffers(); +} + bool enb::get_metrics(enb_metrics_t &m) { m.rf = rf_metrics; diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index 45dd028b0..a4d7532f0 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -184,6 +184,9 @@ void parse_args(all_args_t *args, int argc, char* argv[]) { bpo::value(&args->expert.rrc_inactivity_timer)->default_value(10000), "Inactivity timer in ms") + ("expert.print_buffer_state", + bpo::value(&args->expert.print_buffer_state)->default_value(false), + "Prints on the console the buffer state every 10 seconds") ("rf_calibration.tx_corr_dc_gain", bpo::value(&args->rf_cal.tx_corr_dc_gain)->default_value(0.0), "TX DC offset gain correction") ("rf_calibration.tx_corr_dc_phase", bpo::value(&args->rf_cal.tx_corr_dc_phase)->default_value(0.0), "TX DC offset phase correction") @@ -385,11 +388,21 @@ int main(int argc, char *argv[]) bool plot_started = false; bool signals_pregenerated = false; - while(running) { + if(running) { if (!plot_started && args.gui.enable) { enb->start_plot(); plot_started = true; } + } + int cnt=0; + while (running) { + if (args.expert.print_buffer_state) { + cnt++; + if (cnt==10) { + cnt=0; + enb->print_pool(); + } + } sleep(1); } pthread_cancel(input);