Added configuration options for stack logging.

master
Pedro Alvarez 5 years ago
parent e79fc9bf08
commit 2ea78c8feb

@ -121,7 +121,7 @@ s1ap_filename = /tmp/enb_s1ap.pcap
# configured. # configured.
# Format: e.g. phy_hex_limit = 32 # Format: e.g. phy_hex_limit = 32
# #
# Logging layers: rf, phy, phy_lib, mac, rlc, pdcp, rrc, gtpu, s1ap, all # Logging layers: rf, phy, phy_lib, mac, rlc, pdcp, rrc, gtpu, s1ap, stack, 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

@ -44,6 +44,7 @@ typedef struct {
std::string rrc_level; std::string rrc_level;
std::string gtpu_level; std::string gtpu_level;
std::string s1ap_level; std::string s1ap_level;
std::string stack_level;
int mac_hex_limit; int mac_hex_limit;
int rlc_hex_limit; int rlc_hex_limit;
@ -51,6 +52,7 @@ typedef struct {
int rrc_hex_limit; int rrc_hex_limit;
int gtpu_hex_limit; int gtpu_hex_limit;
int s1ap_hex_limit; int s1ap_hex_limit;
int stack_hex_limit;
} stack_log_args_t; } stack_log_args_t;
typedef struct { typedef struct {

@ -111,6 +111,8 @@ void parse_args(all_args_t* args, int argc, char* argv[])
("log.gtpu_hex_limit",bpo::value<int>(&args->stack.log.gtpu_hex_limit), "GTPU log hex dump limit") ("log.gtpu_hex_limit",bpo::value<int>(&args->stack.log.gtpu_hex_limit), "GTPU log hex dump limit")
("log.s1ap_level", bpo::value<string>(&args->stack.log.s1ap_level), "S1AP log level") ("log.s1ap_level", bpo::value<string>(&args->stack.log.s1ap_level), "S1AP log level")
("log.s1ap_hex_limit",bpo::value<int>(&args->stack.log.s1ap_hex_limit), "S1AP log hex dump limit") ("log.s1ap_hex_limit",bpo::value<int>(&args->stack.log.s1ap_hex_limit), "S1AP log hex dump limit")
("log.stack_level", bpo::value<string>(&args->stack.log.stack_level), "Stack log level")
("log.stack_hex_limit",bpo::value<int>(&args->stack.log.stack_hex_limit), "Stack log hex dump limit")
("log.all_level", bpo::value<string>(&args->log.all_level)->default_value("info"), "ALL log level") ("log.all_level", bpo::value<string>(&args->log.all_level)->default_value("info"), "ALL log level")
("log.all_hex_limit", bpo::value<int>(&args->log.all_hex_limit)->default_value(32), "ALL log hex dump limit") ("log.all_hex_limit", bpo::value<int>(&args->log.all_hex_limit)->default_value(32), "ALL log hex dump limit")
@ -316,6 +318,9 @@ void parse_args(all_args_t* args, int argc, char* argv[])
if (!vm.count("log.s1ap_level")) { if (!vm.count("log.s1ap_level")) {
args->stack.log.s1ap_level = args->log.all_level; args->stack.log.s1ap_level = args->log.all_level;
} }
if (!vm.count("log.stack_level")) {
args->stack.log.stack_level = args->log.all_level;
}
} }
// Apply all_hex_limit to any unset layers // Apply all_hex_limit to any unset layers
@ -341,6 +346,9 @@ void parse_args(all_args_t* args, int argc, char* argv[])
if (!vm.count("log.s1ap_hex_limit")) { if (!vm.count("log.s1ap_hex_limit")) {
args->stack.log.s1ap_hex_limit = args->log.all_hex_limit; args->stack.log.s1ap_hex_limit = args->log.all_hex_limit;
} }
if (!vm.count("log.stack_hex_limit")) {
args->stack.log.stack_hex_limit = args->log.all_hex_limit;
}
} }
// Check remaining eNB config files // Check remaining eNB config files

@ -30,10 +30,7 @@ using namespace srslte;
namespace srsenb { namespace srsenb {
enb_stack_lte::enb_stack_lte(srslte::logger* logger_) : enb_stack_lte::enb_stack_lte(srslte::logger* logger_) :
timers(128), timers(128), logger(logger_), pdcp(this, "PDCP"), thread("STACK")
logger(logger_),
pdcp(this, "PDCP"),
thread("STACK")
{ {
enb_queue_id = pending_tasks.add_queue(); enb_queue_id = pending_tasks.add_queue();
sync_queue_id = pending_tasks.add_queue(); sync_queue_id = pending_tasks.add_queue();
@ -81,14 +78,14 @@ int enb_stack_lte::init(const stack_args_t& args_, const rrc_cfg_t& rrc_cfg_)
rrc_log->set_level(args.log.rrc_level); rrc_log->set_level(args.log.rrc_level);
gtpu_log->set_level(args.log.gtpu_level); gtpu_log->set_level(args.log.gtpu_level);
s1ap_log->set_level(args.log.s1ap_level); s1ap_log->set_level(args.log.s1ap_level);
stack_log->set_level(LOG_LEVEL_INFO); stack_log->set_level(args.log.stack_level);
rlc_log->set_hex_limit(args.log.rlc_hex_limit); rlc_log->set_hex_limit(args.log.rlc_hex_limit);
pdcp_log->set_hex_limit(args.log.pdcp_hex_limit); pdcp_log->set_hex_limit(args.log.pdcp_hex_limit);
rrc_log->set_hex_limit(args.log.rrc_hex_limit); rrc_log->set_hex_limit(args.log.rrc_hex_limit);
gtpu_log->set_hex_limit(args.log.gtpu_hex_limit); gtpu_log->set_hex_limit(args.log.gtpu_hex_limit);
s1ap_log->set_hex_limit(args.log.s1ap_hex_limit); s1ap_log->set_hex_limit(args.log.s1ap_hex_limit);
stack_log->set_hex_limit(128); stack_log->set_hex_limit(args.log.stack_hex_limit);
// Set up pcap and trace // Set up pcap and trace
if (args.mac_pcap.enable) { if (args.mac_pcap.enable) {

@ -47,6 +47,7 @@ typedef struct {
std::string gw_level; std::string gw_level;
std::string nas_level; std::string nas_level;
std::string usim_level; std::string usim_level;
std::string stack_level;
int mac_hex_limit; int mac_hex_limit;
int rlc_hex_limit; int rlc_hex_limit;
@ -55,6 +56,7 @@ typedef struct {
int gw_hex_limit; int gw_hex_limit;
int nas_hex_limit; int nas_hex_limit;
int usim_hex_limit; int usim_hex_limit;
int stack_hex_limit;
} stack_log_args_t; } stack_log_args_t;
typedef struct { typedef struct {

@ -48,8 +48,8 @@ namespace bpo = boost::program_options;
* Local static variables * Local static variables
***********************************************************************/ ***********************************************************************/
static bool do_metrics = false; static bool do_metrics = false;
static metrics_stdout* metrics_screen = nullptr; static metrics_stdout* metrics_screen = nullptr;
/********************************************************************** /**********************************************************************
* Program arguments processing * Program arguments processing
@ -150,6 +150,8 @@ static int parse_args(all_args_t* args, int argc, char* argv[])
("log.nas_hex_limit", bpo::value<int>(&args->stack.log.nas_hex_limit), "NAS log hex dump limit") ("log.nas_hex_limit", bpo::value<int>(&args->stack.log.nas_hex_limit), "NAS log hex dump limit")
("log.usim_level", bpo::value<string>(&args->stack.log.usim_level), "USIM log level") ("log.usim_level", bpo::value<string>(&args->stack.log.usim_level), "USIM log level")
("log.usim_hex_limit", bpo::value<int>(&args->stack.log.usim_hex_limit), "USIM log hex dump limit") ("log.usim_hex_limit", bpo::value<int>(&args->stack.log.usim_hex_limit), "USIM log hex dump limit")
("log.stack_level", bpo::value<string>(&args->stack.log.stack_level), "Stack log level")
("log.stack_hex_limit", bpo::value<int>(&args->stack.log.stack_hex_limit), "Stack log hex dump limit")
("log.all_level", bpo::value<string>(&args->log.all_level)->default_value("info"), "ALL log level") ("log.all_level", bpo::value<string>(&args->log.all_level)->default_value("info"), "ALL log level")
("log.all_hex_limit", bpo::value<int>(&args->log.all_hex_limit)->default_value(32), "ALL log hex dump limit") ("log.all_hex_limit", bpo::value<int>(&args->log.all_hex_limit)->default_value(32), "ALL log hex dump limit")
@ -508,6 +510,9 @@ static int parse_args(all_args_t* args, int argc, char* argv[])
if (!vm.count("log.usim_level")) { if (!vm.count("log.usim_level")) {
args->stack.log.usim_level = args->log.all_level; args->stack.log.usim_level = args->log.all_level;
} }
if (!vm.count("log.stack_level")) {
args->stack.log.stack_level = args->log.all_level;
}
} }
// Apply all_hex_limit to any unset layers // Apply all_hex_limit to any unset layers
@ -536,6 +541,9 @@ static int parse_args(all_args_t* args, int argc, char* argv[])
if (!vm.count("log.usim_hex_limit")) { if (!vm.count("log.usim_hex_limit")) {
args->stack.log.usim_hex_limit = args->log.all_hex_limit; args->stack.log.usim_hex_limit = args->log.all_hex_limit;
} }
if (!vm.count("log.stack_hex_limit")) {
args->stack.log.stack_hex_limit = args->log.all_hex_limit;
}
} }
return SRSLTE_SUCCESS; return SRSLTE_SUCCESS;
@ -584,7 +592,7 @@ int main(int argc, char* argv[])
// Setup logging // Setup logging
srslte::logger_stdout logger_stdout; srslte::logger_stdout logger_stdout;
srslte::logger* logger = nullptr; srslte::logger* logger = nullptr;
if (args.log.filename == "stdout") { if (args.log.filename == "stdout") {
logger = &logger_stdout; logger = &logger_stdout;
} else { } else {
@ -640,4 +648,4 @@ int main(int argc, char* argv[])
cout << "--- exiting ---" << endl; cout << "--- exiting ---" << endl;
return SRSLTE_SUCCESS; return SRSLTE_SUCCESS;
} }

@ -87,7 +87,8 @@ int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_)
logger = logger_; logger = logger_;
// init own log // init own log
stack_log->set_level(srslte::LOG_LEVEL_INFO); stack_log->set_level(args.log.stack_level);
stack_log->set_hex_limit(args.log.stack_hex_limit);
pool_log->set_level(srslte::LOG_LEVEL_WARNING); pool_log->set_level(srslte::LOG_LEVEL_WARNING);
byte_buffer_pool::get_instance()->set_log(pool_log.get()); byte_buffer_pool::get_instance()->set_log(pool_log.get());

@ -85,7 +85,7 @@ nas_filename = /tmp/nas.pcap
# configured. # configured.
# Format: e.g. phy_hex_limit = 32 # Format: e.g. phy_hex_limit = 32
# #
# Logging layers: rf, phy, mac, rlc, pdcp, rrc, nas, gw, usim, all # Logging layers: rf, phy, mac, rlc, pdcp, rrc, nas, gw, usim, stack, 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
@ -380,4 +380,4 @@ enable = false
#metrics_csv_enable = false #metrics_csv_enable = false
#metrics_period_secs = 1 #metrics_period_secs = 1
#metrics_csv_filename = /tmp/ue_metrics.csv #metrics_csv_filename = /tmp/ue_metrics.csv
#have_tti_time_stats = true #have_tti_time_stats = true

Loading…
Cancel
Save