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

Method recordAllocation

src/allocTracer.cpp:83–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void AllocTracer::recordAllocation(void* ucontext, EventType event_type, uintptr_t rklass,
84 uintptr_t total_size, uintptr_t instance_size) {
85 AllocEvent event;
86 event._start_time = TSC::ticks();
87 event._class_id = 0;
88 event._total_size = total_size;
89 event._instance_size = instance_size;
90
91 if (VMStructs::hasClassNames()) {
92 VMSymbol* symbol = VMKlass::fromHandle(rklass)->name();
93 event._class_id = Profiler::instance()->classMap()->lookup(symbol->body(), symbol->length());
94 }
95
96 Profiler::instance()->recordSample(ucontext, total_size, event_type, &event);
97}
98
99Error AllocTracer::start(Arguments& args) {
100 if (args._live && !args._all) {

Callers

nothing calls this directly

Calls 6

lookupMethod · 0.80
classMapMethod · 0.80
bodyMethod · 0.80
recordSampleMethod · 0.80
nameMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected