| 94 | } |
| 95 | |
| 96 | static int JeProfileActive(bool active) { |
| 97 | if (!HasJemalloc()) { |
| 98 | LOG(WARNING) << "no jemalloc"; |
| 99 | return -1; |
| 100 | } |
| 101 | |
| 102 | if (!HasEnableJemallocProfile()) { |
| 103 | LOG(WARNING) << "jemalloc have not set opt.prof before start"; |
| 104 | return -1; |
| 105 | } |
| 106 | |
| 107 | int ret = mallctl("prof.active", nullptr, nullptr, &active, sizeof(active)); |
| 108 | if (ret != 0) { |
| 109 | LOG(WARNING) << "mallctl set prof.active:" << active << " err, ret:" << ret; |
| 110 | return ret; |
| 111 | } |
| 112 | LOG(INFO) << "mallctl set prof.active:" << active << " succ"; |
| 113 | return 0; |
| 114 | } |
| 115 | |
| 116 | static std::string JeProfileDump() { |
| 117 | if (!HasJemalloc()) { |
no test coverage detected