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

Method initialize

src/nativeLockTracer.cpp:84–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82volatile u64 NativeLockTracer::_total_duration; // for interval sampling
83
84void NativeLockTracer::initialize() {
85 CodeCache* lib = Profiler::instance()->findLibraryByAddress((void*)NativeLockTracer::initialize);
86 assert(lib);
87
88 lib->mark(
89 [](const char* s) -> bool {
90 return strcmp(s, "pthread_mutex_lock_hook") == 0
91 || strcmp(s, "pthread_rwlock_rdlock_hook") == 0
92 || strcmp(s, "pthread_rwlock_wrlock_hook") == 0;
93 },
94 MARK_ASYNC_PROFILER);
95}
96
97void NativeLockTracer::patchLibraries() {
98 MutexLocker ml(_patch_lock);

Callers

nothing calls this directly

Calls 2

findLibraryByAddressMethod · 0.80
markMethod · 0.45

Tested by

no test coverage detected