From 7155de91cacb4e986d0eb5a3a44e1ada4dd71194 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 23 Sep 2021 10:13:18 +0100 Subject: [PATCH] Added command to forcefully flush the buffers on srsenb and srsue. --- srsenb/src/main.cc | 8 ++++++++ srsue/src/main.cc | 3 +++ 2 files changed, 11 insertions(+) diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index ab7f1485a..fa8199aa3 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -495,6 +495,13 @@ static void execute_cmd(metrics_stdout* metrics, srsenb::enb_command_interface* // Set cell gain control->cmd_cell_gain(cell_id, gain_db); + } else if (cmd[0] == "flush") { + if (cmd.size() != 1) { + cout << "Usage: " << cmd[0] << endl; + return; + } + srslog::flush(); + cout << "Flushed log file buffers" << endl; } else { cout << "Available commands: " << endl; cout << " t: starts console trace" << endl; @@ -502,6 +509,7 @@ static void execute_cmd(metrics_stdout* metrics, srsenb::enb_command_interface* cout << " cell_gain: set relative cell gain" << endl; cout << " sleep: pauses the commmand line operation for a given time in seconds" << endl; cout << " p: starts MAC padding" << endl; + cout << " flush: flushes the buffers for the log file" << endl; cout << endl; } } diff --git a/srsue/src/main.cc b/srsue/src/main.cc index b80f8a292..4fcee9c0a 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -645,6 +645,9 @@ static void* input_loop(void*) } else if (key == "rlf") { simulate_rlf.store(true, std::memory_order_relaxed); cout << "Sending Radio Link Failure" << endl; + } else if (key == "flush") { + srslog::flush(); + cout << "Flushed log file buffers" << endl; } else if (key == "q") { // let the signal handler do the job raise(SIGTERM);