fix RF metrics/logging in eNB

master
Andre Puschmann 5 years ago
parent 44977bcdec
commit 343c30be4a

@ -113,7 +113,7 @@ filename = /tmp/enb.pcap
# configured. # configured.
# Format: e.g. phy_hex_limit = 32 # Format: e.g. phy_hex_limit = 32
# #
# Logging layers: phy, mac, rlc, pdcp, rrc, nas, gtpu, usim, all # Logging layers: rf, phy, mac, rlc, pdcp, rrc, nas, gtpu, usim, all
# Logging levels: debug, info, warning, error, none # Logging levels: debug, info, warning, error, none
# #
# filename: File path to use for log output. Can be set to stdout # filename: File path to use for log output. Can be set to stdout

@ -102,6 +102,7 @@ void parse_args(all_args_t *args, int argc, char* argv[]) {
("gui.enable", bpo::value<bool>(&args->gui.enable)->default_value(false), "Enable GUI plots") ("gui.enable", bpo::value<bool>(&args->gui.enable)->default_value(false), "Enable GUI plots")
("log.rf_level", bpo::value<string>(&args->rf.log_level), "RF log level")
("log.phy_level", bpo::value<string>(&args->phy.log.phy_level), "PHY log level") ("log.phy_level", bpo::value<string>(&args->phy.log.phy_level), "PHY log level")
("log.phy_hex_limit", bpo::value<int>(&args->phy.log.phy_hex_limit), "PHY log hex dump limit") ("log.phy_hex_limit", bpo::value<int>(&args->phy.log.phy_hex_limit), "PHY log hex dump limit")
("log.phy_lib_level", bpo::value<string>(&args->phy.log.phy_lib_level)->default_value("none"), "PHY lib log level") ("log.phy_lib_level", bpo::value<string>(&args->phy.log.phy_lib_level)->default_value("none"), "PHY lib log level")
@ -275,6 +276,9 @@ void parse_args(all_args_t *args, int argc, char* argv[]) {
// Apply all_level to any unset layers // Apply all_level to any unset layers
if (vm.count("log.all_level")) { if (vm.count("log.all_level")) {
if (!vm.count("log.rf_level")) {
args->rf.log_level = args->log.all_level;
}
if(!vm.count("log.phy_level")) { if(!vm.count("log.phy_level")) {
args->phy.log.phy_level = args->log.all_level; args->phy.log.phy_level = args->log.all_level;
} }

@ -62,7 +62,15 @@ void metrics_stdout::toggle_print(bool b)
void metrics_stdout::set_metrics(enb_metrics_t &metrics, const uint32_t period_usec) void metrics_stdout::set_metrics(enb_metrics_t &metrics, const uint32_t period_usec)
{ {
if (!do_print || enb == NULL || metrics.stack.rrc.n_ues == 0) { if (!do_print || enb == nullptr) {
return;
}
if (metrics.rf.rf_error) {
printf("RF status: O=%d, U=%d, L=%d\n", metrics.rf.rf_o, metrics.rf.rf_u, metrics.rf.rf_l);
}
if (metrics.stack.rrc.n_ues == 0) {
return; return;
} }
@ -130,10 +138,6 @@ void metrics_stdout::set_metrics(enb_metrics_t &metrics, const uint32_t period_u
cout << endl; cout << endl;
} }
if (metrics.rf.rf_error) {
printf("RF status: O=%d, U=%d, L=%d\n", metrics.rf.rf_o, metrics.rf.rf_u, metrics.rf.rf_l);
}
cout.flags(f); // For avoiding Coverity defect: Not restoring ostream format cout.flags(f); // For avoiding Coverity defect: Not restoring ostream format
} }

Loading…
Cancel
Save