| 84 | } |
| 85 | |
| 86 | StatusOr<bool> MemoryProfiler::GetProfilingStatus() { |
| 87 | #ifdef ENABLE_JEMALLOC |
| 88 | bool is_prof_enabled = false; |
| 89 | if (auto s = GetJemallocOption("opt.prof", &is_prof_enabled); !s.IsOK()) { |
| 90 | return s; |
| 91 | } |
| 92 | if (!is_prof_enabled) return false; |
| 93 | |
| 94 | bool is_prof_active = false; |
| 95 | if (auto s = GetJemallocOption("prof.active", &is_prof_active); !s.IsOK()) { |
| 96 | return s; |
| 97 | } |
| 98 | return is_prof_active; |
| 99 | #else |
| 100 | return {Status::NotOK, errProfilingUnsupported}; |
| 101 | #endif |
| 102 | } |
| 103 | |
| 104 | Status MemoryProfiler::Dump(std::string_view dir) { |
| 105 | #ifdef ENABLE_JEMALLOC |
no test coverage detected