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

Function JeProfileReset

src/brpc/details/jemalloc_profiler.cpp:149–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149static int JeProfileReset(size_t lg_sample) {
150 if (!HasJemalloc()) {
151 LOG(WARNING) << "no jemalloc";
152 return -1;
153 }
154
155 if (!HasEnableJemallocProfile()) {
156 LOG(WARNING) << "jemalloc have not set opt.prof before start";
157 return -1;
158 }
159
160 int ret = mallctl("prof.reset", nullptr, nullptr, &lg_sample, sizeof(lg_sample));
161 if (ret != 0) {
162 LOG(WARNING) << "mallctl set prof.reset:" << lg_sample << " err, ret:" << ret;
163 return ret;
164 }
165 LOG(INFO) << "mallctl set prof.reset:" << lg_sample << " succ";
166 return 0;
167}
168
169// https://github.com/jemalloc/jemalloc/blob/5.3.0/bin/jeprof.in#L211-L222
170static const std::unordered_set<const char*> g_extra_options_set = {

Callers 1

validate_je_prof_resetFunction · 0.85

Calls 2

HasJemallocFunction · 0.85
HasEnableJemallocProfileFunction · 0.85

Tested by

no test coverage detected