36 {
37
40
42
43 std::string dag_info;
44 for (auto&& i = dag_list.begin(); i != dag_list.end(); i++) {
45 size_t pos = 0;
46 for (size_t j = 0; j < (*i).length(); j++) {
47 pos = ((*i)[j] == '/') ? j: pos;
48 }
49 if (i != dag_list.begin()) dag_info += "_";
50
51 if (pos == 0) {
52 dag_info += *i;
53 } else {
54 dag_info +=
55 (pos == (*i).length()-1) ? (*i).substr(pos): (*i).substr(pos+1);
56 }
57 }
58
60 apollo::cyber::mainboard::DEFAULT_process_group_) {
62 }
63
64
66
69 std::signal(SIGTERM, [](int sig){
71 if (enable_cpu_profile) {
72 ProfilerStop();
73 }
74
75 if (enable_mem_profile) {
76 HeapProfilerDump("Befor shutdown");
77 HeapProfilerStop();
78 }
79 });
80
84 }
85
86
88 if (!controller.Init()) {
89 controller.Clear();
90 AERROR <<
"module start error.";
91 return -1;
92 }
93
97 }
98
100
102 ProfilerStop();
103 }
104
106 HeapProfilerDump("Befor shutdown");
107 HeapProfilerStop();
108 }
109
110 controller.Clear();
111 AINFO <<
"exit mainboard.";
112
113 return 0;
114}
const bool GetEnableHeapprofile() const
const std::list< std::string > & GetDAGConfList() const
const bool GetEnableCpuprofile() const
const std::string & GetProcessGroup() const
void ParseArgument(int argc, char *const argv[])
const std::string GetHeapProfileFilename() const
const std::string GetProfileFilename() const
std::string profile_filename
bool Init(const char *binary_name, const std::string &dag_info)