| 512 | } |
| 513 | |
| 514 | void Profiler::recordExternalSamples(u64 samples, u64 counter, int tid, u32 call_trace_id, EventType event_type, Event* event) { |
| 515 | _call_trace_storage.add(call_trace_id, samples, counter); |
| 516 | |
| 517 | u32 lock_index = getLockIndex(tid); |
| 518 | if (!_locks[lock_index].tryLock() && |
| 519 | !_locks[lock_index = (lock_index + 1) % CONCURRENCY_LEVEL].tryLock() && |
| 520 | !_locks[lock_index = (lock_index + 2) % CONCURRENCY_LEVEL].tryLock()) |
| 521 | { |
| 522 | return; |
| 523 | } |
| 524 | |
| 525 | _jfr.recordEvent(lock_index, tid, call_trace_id, event_type, event); |
| 526 | |
| 527 | _locks[lock_index].unlock(); |
| 528 | } |
| 529 | |
| 530 | void Profiler::recordEventOnly(EventType event_type, Event* event) { |
| 531 | if (!_jfr.active()) { |
no test coverage detected