diff --git a/srsenb/enb.conf.example b/srsenb/enb.conf.example index 062f2d73e..0490a4519 100644 --- a/srsenb/enb.conf.example +++ b/srsenb/enb.conf.example @@ -314,6 +314,7 @@ enable = false #alarms_log_enable = true #alarms_filename = /tmp/enb_alarms.log #tracing_enable = true +#tracing_filename = /tmp/enb_tracing.log #pregenerate_signals = false #tx_amplitude = 0.6 #rrc_inactivity_timer = 30000 diff --git a/srsenb/hdr/enb.h b/srsenb/hdr/enb.h index f4c412345..e6c8c020b 100644 --- a/srsenb/hdr/enb.h +++ b/srsenb/hdr/enb.h @@ -90,6 +90,7 @@ struct general_args_t { std::string alarms_filename; bool print_buffer_state; bool tracing_enable; + std::string tracing_filename; std::string eia_pref_list; std::string eea_pref_list; }; diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index 3eafad4a4..1e5072347 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -209,6 +209,7 @@ void parse_args(all_args_t* args, int argc, char* argv[]) ("expert.alarms_log_enable", bpo::value(&args->general.alarms_log_enable)->default_value(false), "Log alarms") ("expert.alarms_filename", bpo::value(&args->general.alarms_filename)->default_value("/tmp/enb_alarms.log"), "Alarms filename") ("expert.tracing_enable", bpo::value(&args->general.tracing_enable)->default_value(false), "Events tracing") + ("expert.tracing_filename", bpo::value(&args->general.tracing_filename)->default_value("/tmp/enb_tracing.log"), "Tracing events filename") ("expert.rrc_inactivity_timer", bpo::value(&args->general.rrc_inactivity_timer)->default_value(30000), "Inactivity timer in ms.") ("expert.print_buffer_state", bpo::value(&args->general.print_buffer_state)->default_value(false), "Prints on the console the buffer state every 10 seconds") ("expert.eea_pref_list", bpo::value(&args->general.eea_pref_list)->default_value("EEA0, EEA2, EEA1"), "Ordered preference list for the selection of encryption algorithm (EEA) (default: EEA0, EEA2, EEA1).") @@ -505,7 +506,9 @@ int main(int argc, char* argv[]) #ifdef ENABLE_SRSLOG_EVENT_TRACE if (args.general.tracing_enable) { - srslog::event_trace_init(); + srslog::sink& tracing_sink = srslog::fetch_file_sink(args.general.tracing_filename); + srslog::log_channel& c = srslog::fetch_log_channel("tracing", tracing_sink, {"TRACE", '\0', false}); + srslog::event_trace_init(c); } #endif