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

Method writeNativeLibraries

src/flightRecorder.cpp:803–822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

801 }
802
803 void writeNativeLibraries(Buffer* buf) {
804 if (_recorded_lib_count < 0) return;
805
806 Profiler* profiler = Profiler::instance();
807 CodeCacheArray& native_libs = profiler->_native_libs;
808 int native_lib_count = native_libs.count();
809
810 for (int i = _recorded_lib_count; i < native_lib_count; i++) {
811 flushIfNeeded(buf, RECORDING_BUFFER_LIMIT - MAX_STRING_LENGTH);
812 int start = buf->skip(5);
813 buf->put8(T_NATIVE_LIBRARY);
814 buf->putVar64(_start_ticks);
815 buf->putUtf8(native_libs[i]->name());
816 buf->putVar64((uintptr_t) native_libs[i]->minAddress());
817 buf->putVar64((uintptr_t) native_libs[i]->maxAddress());
818 buf->putVar32(start, buf->offset() - start);
819 }
820
821 _recorded_lib_count = native_lib_count;
822 }
823
824 void writeCpool(Buffer* buf) {
825 buf->skip(5); // size will be patched later

Callers

nothing calls this directly

Calls 10

skipMethod · 0.80
putVar64Method · 0.80
putUtf8Method · 0.80
minAddressMethod · 0.80
maxAddressMethod · 0.80
putVar32Method · 0.80
countMethod · 0.45
put8Method · 0.45
nameMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected