| 250 | } |
| 251 | |
| 252 | void 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 | } |
nothing calls this directly
no test coverage detected