| 41 | } |
| 42 | |
| 43 | void checkProfilingEnabled() |
| 44 | { |
| 45 | bool active = true; |
| 46 | size_t active_size = sizeof(active); |
| 47 | je_mallctl("opt.prof", &active, &active_size, nullptr, 0); |
| 48 | |
| 49 | if (!active) |
| 50 | throw Exception( |
| 51 | ErrorCodes::BAD_ARGUMENTS, |
| 52 | "ClickHouse was started without enabling profiling for jemalloc. To use jemalloc's profiler, following env variable should be " |
| 53 | "set: MALLOC_CONF=background_thread:true,prof:true"); |
| 54 | } |
| 55 | |
| 56 | std::string_view flushProfile(const char * file_prefix) |
| 57 | { |
no test coverage detected