27int main(
int argc,
char* argv[]) {
29 const char* apollo_runtime_path = std::getenv(
"APOLLO_RUNTIME_PATH");
30 if (apollo_runtime_path !=
nullptr) {
31 if (std::filesystem::is_directory(
32 std::filesystem::status(apollo_runtime_path))) {
33 std::filesystem::current_path(apollo_runtime_path);
36 google::ParseCommandLineFlags(&argc, &argv,
true);
39 std::signal(SIGTERM, [](
int sig) {
41 if (FLAGS_dv_cpu_profile) {
44 if (FLAGS_dv_heap_profile) {
45 HeapProfilerDump(
"Befor shutdown");
50 std::signal(SIGINT, [](
int sig) {
52 if (FLAGS_dv_cpu_profile) {
55 if (FLAGS_dv_heap_profile) {
56 HeapProfilerDump(
"Befor shutdown");
61 if (FLAGS_dv_cpu_profile) {
62 auto base_name_cpu = std::string(argv[0]) +
"_cpu" + std::string(
".prof");
63 ProfilerStart(base_name_cpu.c_str());
65 if (FLAGS_dv_heap_profile) {
66 auto base_name_heap = std::string(argv[0]) +
"_heap" + std::string(
".prof");
67 HeapProfilerStart(base_name_heap.c_str());
70 apollo::cyber::GlobalData::Instance()->SetProcessGroup(
"dreamview_sched");
74 const bool init_success = dreamview.
Init().
ok() && dreamview.
Start().
ok();
76 AERROR <<
"Failed to initialize dreamview server";
int main(int argc, char *argv[])