| 81 | } |
| 82 | |
| 83 | void 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 | |
| 99 | Error AllocTracer::start(Arguments& args) { |
| 100 | if (args._live && !args._all) { |