env need MALLOC_CONF="prof:true" before process start
| 68 | |
| 69 | // env need MALLOC_CONF="prof:true" before process start |
| 70 | static bool HasEnableJemallocProfile() { |
| 71 | bool prof = false; |
| 72 | size_t len = sizeof(prof); |
| 73 | int ret = mallctl("opt.prof", &prof, &len, nullptr, 0); |
| 74 | if (ret != 0) { |
| 75 | LOG(WARNING) << "mallctl get opt.prof err, ret:" << ret; |
| 76 | return false; |
| 77 | } |
| 78 | return prof; |
| 79 | } |
| 80 | |
| 81 | static void WriteCb(void *opaque, const char *str) { |
| 82 | // maybe call n times WriteCb by single malloc_stats_print |
no outgoing calls
no test coverage detected