fix handling of log vector in eNB

master
Andre Puschmann 7 years ago
parent b50672b0ef
commit bf25a5a05c

@ -188,7 +188,7 @@ private:
srslte::logger *logger; srslte::logger *logger;
srslte::log_filter rf_log; srslte::log_filter rf_log;
std::vector<void*> phy_log; std::vector<srslte::log_filter*> phy_log;
srslte::log_filter mac_log; srslte::log_filter mac_log;
srslte::log_filter rlc_log; srslte::log_filter rlc_log;
srslte::log_filter pdcp_log; srslte::log_filter pdcp_log;

@ -28,6 +28,7 @@
#define ENBPHY_H #define ENBPHY_H
#include "srslte/common/log.h" #include "srslte/common/log.h"
#include "srslte/common/log_filter.h"
#include "phy/txrx.h" #include "phy/txrx.h"
#include "phy/phch_worker.h" #include "phy/phch_worker.h"
#include "phy/phch_common.h" #include "phy/phch_common.h"
@ -54,8 +55,8 @@ class phy : public phy_interface_mac,
public: public:
phy(); phy();
bool init(phy_args_t *args, phy_cfg_t *common_cfg, srslte::radio *radio_handler, mac_interface_phy *mac, srslte::log* log_h); bool init(phy_args_t *args, phy_cfg_t *common_cfg, srslte::radio *radio_handler, mac_interface_phy *mac, srslte::log_filter* log_h);
bool init(phy_args_t *args, phy_cfg_t *common_cfg, srslte::radio *radio_handler, mac_interface_phy *mac, std::vector<void*> log_vec); bool init(phy_args_t *args, phy_cfg_t *common_cfg, srslte::radio *radio_handler, mac_interface_phy *mac, std::vector<srslte::log_filter *> log_vec);
void stop(); void stop();
/* MAC->PHY interface */ /* MAC->PHY interface */

@ -67,6 +67,9 @@ enb::enb() : started(false) {
enb::~enb() enb::~enb()
{ {
for (uint32_t i = 0; i < phy_log.size(); i++) {
delete (phy_log[i]);
}
} }
bool enb::init(all_args_t *args_) bool enb::init(all_args_t *args_)
@ -89,7 +92,7 @@ bool enb::init(all_args_t *args_)
char tmp[16]; char tmp[16];
sprintf(tmp, "PHY%d",i); sprintf(tmp, "PHY%d",i);
mylog->init(tmp, logger, true); mylog->init(tmp, logger, true);
phy_log.push_back((void*) mylog); phy_log.push_back(mylog);
} }
mac_log.init("MAC ", logger, true); mac_log.init("MAC ", logger, true);
rlc_log.init("RLC ", logger); rlc_log.init("RLC ", logger);

@ -93,11 +93,11 @@ bool phy::init(phy_args_t *args,
phy_cfg_t *cfg, phy_cfg_t *cfg,
srslte::radio* radio_handler_, srslte::radio* radio_handler_,
mac_interface_phy *mac, mac_interface_phy *mac,
srslte::log* log_h) srslte::log_filter* log_h)
{ {
std::vector<void*> log_vec; std::vector<srslte::log_filter*> log_vec;
for (int i=0;i<args->nof_phy_threads;i++) { for (int i=0;i<args->nof_phy_threads;i++) {
log_vec.push_back((void*)log_h); log_vec.push_back(log_h);
} }
init(args, cfg, radio_handler_, mac, log_vec); init(args, cfg, radio_handler_, mac, log_vec);
return true; return true;
@ -107,7 +107,7 @@ bool phy::init(phy_args_t *args,
phy_cfg_t *cfg, phy_cfg_t *cfg,
srslte::radio* radio_handler_, srslte::radio* radio_handler_,
mac_interface_phy *mac, mac_interface_phy *mac,
std::vector<void*> log_vec) std::vector<srslte::log_filter*> log_vec)
{ {
mlockall(MCL_CURRENT | MCL_FUTURE); mlockall(MCL_CURRENT | MCL_FUTURE);

Loading…
Cancel
Save