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

Method recordContendedLock

src/lockTracer.cpp:252–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void LockTracer::recordContendedLock(EventType event_type, u64 start_time, u64 end_time,
253 const char* lock_name, jobject lock, jlong timeout) {
254 LockEvent event;
255 event._class_id = 0;
256 event._start_time = start_time;
257 event._end_time = end_time;
258 event._address = *(uintptr_t*)lock;
259 event._timeout = timeout;
260
261 if (lock_name != NULL) {
262 if (lock_name[0] == 'L') {
263 event._class_id = Profiler::instance()->classMap()->lookup(lock_name + 1, strlen(lock_name) - 2);
264 } else {
265 event._class_id = Profiler::instance()->classMap()->lookup(lock_name);
266 }
267 }
268
269 u64 duration_nanos = (u64)((end_time - start_time) * _ticks_to_nanos);
270 Profiler::instance()->recordSample(NULL, duration_nanos, event_type, &event);
271}

Callers

nothing calls this directly

Calls 3

lookupMethod · 0.80
classMapMethod · 0.80
recordSampleMethod · 0.80

Tested by

no test coverage detected