MCPcopy Create free account
hub / github.com/apache/brpc / HasEnableJemallocProfile

Function HasEnableJemallocProfile

src/brpc/details/jemalloc_profiler.cpp:70–79  ·  view source on GitHub ↗

env need MALLOC_CONF="prof:true" before process start

Source from the content-addressed store, hash-verified

68
69// env need MALLOC_CONF="prof:true" before process start
70static 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
81static void WriteCb(void *opaque, const char *str) {
82 // maybe call n times WriteCb by single malloc_stats_print

Callers 4

JeProfileActiveFunction · 0.85
JeProfileDumpFunction · 0.85
JeProfileResetFunction · 0.85
JeControlProfileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected