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

Function JeProfileActive

src/brpc/details/jemalloc_profiler.cpp:96–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96static 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
116static std::string JeProfileDump() {
117 if (!HasJemalloc()) {

Callers 1

validate_je_prof_activeFunction · 0.85

Calls 2

HasJemallocFunction · 0.85
HasEnableJemallocProfileFunction · 0.85

Tested by

no test coverage detected