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

Method recordExternalSamples

src/profiler.cpp:514–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514void 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
530void Profiler::recordEventOnly(EventType event_type, Event* event) {
531 if (!_jfr.active()) {

Callers 2

recordWallClockMethod · 0.80
dumpMethod · 0.80

Calls 4

addMethod · 0.45
tryLockMethod · 0.45
recordEventMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected