From 0deda67930a1b9f2af221ef49f0c1f047fae2b4a Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 1 Oct 2018 21:44:16 +0200 Subject: [PATCH] print build-info during epc startup --- srsepc/src/main.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/srsepc/src/main.cc b/srsepc/src/main.cc index 95883cd44..984f81dd6 100644 --- a/srsepc/src/main.cc +++ b/srsepc/src/main.cc @@ -22,6 +22,7 @@ * */ #include +#include #include #include #include @@ -30,6 +31,7 @@ #include "srslte/common/crash_handler.h" #include "srslte/common/bcd_helpers.h" #include "srslte/common/config_file.h" +#include "srslte/build_info.h" #include "srsepc/hdr/mme/mme.h" #include "srsepc/hdr/hss/hss.h" #include "srsepc/hdr/spgw/spgw.h" @@ -280,6 +282,26 @@ level(std::string l) } } +std::string get_build_mode() +{ + return std::string(srslte_get_build_mode()); +} + +std::string get_build_info() +{ + if (std::string(srslte_get_build_info()) == "") { + return std::string(srslte_get_version()); + } + return std::string(srslte_get_build_info()); +} + +std::string get_build_string() +{ + std::stringstream ss; + ss << "Built in " << get_build_mode() << " mode using " << get_build_info() << "." << std::endl; + return ss.str(); +} + int main (int argc,char * argv[] ) { @@ -287,6 +309,9 @@ main (int argc,char * argv[] ) signal(SIGTERM, sig_int_handler); signal(SIGKILL, sig_int_handler); + // print build info + cout << endl << get_build_string() << endl; + cout << endl <<"--- Software Radio Systems EPC ---" << endl << endl; srslte_debug_handle_crash(argc, argv);