Added command to forcefully flush the buffers on srsenb and srsue.

This commit is contained in:
Pedro Alvarez 2021-09-23 10:13:18 +01:00
parent 0b948d4098
commit 7155de91ca
2 changed files with 11 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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);