MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / recordNativeLock

Method recordNativeLock

src/nativeLockTracer.cpp:121–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121void 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
134Error NativeLockTracer::start(Arguments& args) {
135 _ticks_to_nanos = 1e9 / TSC::frequency();

Callers

nothing calls this directly

Calls 1

recordSampleMethod · 0.80

Tested by

no test coverage detected