1 #include "otsdaq/ARTDAQSupervisor/ARTDAQSupervisorTRACEController.h"
4 ots::ARTDAQSupervisorTRACEController::ARTDAQSupervisorTRACEController() {}
6 const ots::ITRACEController::HostTraceLevelMap&
9 traceLevelsMap_.clear();
11 ots::ITRACEController::addTraceLevelsForThisHost();
14 auto commanders = theSupervisor_->makeCommandersFromProcessInfo();
16 for(
auto& comm : commanders)
18 if(traceLevelsMap_.count(comm.first.host) == 0)
20 auto lvlstring = comm.second->send_trace_get(
"ALL");
21 auto lvls = ARTDAQSupervisor::tokenize_(lvlstring);
25 std::istringstream iss(lvl);
27 uint64_t lvlM, lvlS, lvlT;
29 iss >> name >> lvlM >> lvlS >> lvlT;
33 traceLevelsMap_[
"artdaq.." + comm.first.host][name].M = lvlM;
34 traceLevelsMap_[
"artdaq.." + comm.first.host][name].S = lvlS;
35 traceLevelsMap_[
"artdaq.." + comm.first.host][name].T = lvlT;
41 return traceLevelsMap_;
45 const std::string& label,
47 const std::string& host ,
48 std::string
const& mode )
52 auto commanders = theSupervisor_->makeCommandersFromProcessInfo();
54 bool allMode = mode ==
"ALL";
56 for(
auto& comm : commanders)
60 if(
"artdaq.." + comm.first.host == host)
62 if(allMode || mode ==
"FAST")
63 comm.second->send_trace_set(label,
"M", std::to_string(lvl.M));
64 if(allMode || mode ==
"SLOW")
65 comm.second->send_trace_set(label,
"S", std::to_string(lvl.S));
66 if(allMode || mode ==
"TRIGGER")
67 comm.second->send_trace_set(label,
"T", std::to_string(lvl.T));
73 ots::ITRACEController::setTraceLevelsForThisHost(label, lvl, mode);
const ITRACEController::HostTraceLevelMap & getTraceLevels(void) final
pure virtual
virtual void setTraceLevelMask(std::string const &label, TraceMasks const &lvl, std::string const &hostname="localhost", std::string const &mode="ALL") final
pure virtual