| 158 | } |
| 159 | |
| 160 | void ContentionProfiler::init_if_needed() { |
| 161 | if (!_init) { |
| 162 | // Already output nanoseconds, always set cycles/second to 1000000000. |
| 163 | _disk_buf.append("--- contention\ncycles/second=1000000000\n"); |
| 164 | if (_dedup_map.init(1024, 60) != 0) { |
| 165 | LOG(WARNING) << "Fail to initialize dedup_map"; |
| 166 | } |
| 167 | _init = true; |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | void ContentionProfiler::dump_and_destroy(SampledContention* c) { |
| 172 | init_if_needed(); |
no test coverage detected