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

Method recordEventOnly

src/profiler.cpp:530–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528}
529
530void Profiler::recordEventOnly(EventType event_type, Event* event) {
531 if (!_jfr.active()) {
532 return;
533 }
534
535 int tid = OS::threadId();
536 u32 lock_index = getLockIndex(tid);
537 if (!_locks[lock_index].tryLock() &&
538 !_locks[lock_index = (lock_index + 1) % CONCURRENCY_LEVEL].tryLock() &&
539 !_locks[lock_index = (lock_index + 2) % CONCURRENCY_LEVEL].tryLock())
540 {
541 return;
542 }
543
544 _jfr.recordEvent(lock_index, tid, 0, event_type, event);
545
546 _locks[lock_index].unlock();
547}
548
549void Profiler::tryResetCounters() {
550 // Reset counters only for non-JFR recording, otherwise resetting may cause missing stack traces for some

Callers 2

recordFreeMethod · 0.80

Calls 4

activeMethod · 0.80
tryLockMethod · 0.45
recordEventMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected