| 119 | } |
| 120 | |
| 121 | void NativeLockTracer::recordNativeLock(void* address, u64 start_time, u64 end_time) { |
| 122 | const u64 duration_ticks = end_time - start_time; |
| 123 | if (updateCounter(_total_duration, duration_ticks, _interval)) { |
| 124 | u64 duration_nanos = (u64)(duration_ticks * _ticks_to_nanos); |
| 125 | NativeLockEvent event; |
| 126 | event._start_time = start_time; |
| 127 | event._end_time = end_time; |
| 128 | event._address = (uintptr_t)address; |
| 129 | |
| 130 | Profiler::instance()->recordSample(NULL, duration_nanos, NATIVE_LOCK_SAMPLE, &event); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | Error NativeLockTracer::start(Arguments& args) { |
| 135 | _ticks_to_nanos = 1e9 / TSC::frequency(); |
nothing calls this directly
no test coverage detected