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

Method recordMallocSample

src/flightRecorder.cpp:1099–1110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1097 }
1098
1099 void recordMallocSample(Buffer* buf, int tid, u32 call_trace_id, MallocEvent* event) {
1100 int start = buf->skip(1);
1101 buf->put8(event->_size != 0 ? T_MALLOC : T_FREE);
1102 buf->putVar64(event->_start_time);
1103 buf->putVar32(tid);
1104 buf->putVar32(call_trace_id);
1105 buf->putVar64(event->_address);
1106 if (event->_size != 0) {
1107 buf->putVar64(event->_size);
1108 }
1109 buf->put8(start, buf->offset() - start);
1110 }
1111
1112 void recordUserEvent(Buffer* buf, int tid, UserEvent* event) {
1113 // estimate of size of non-string fields of this event

Callers 1

recordEventMethod · 0.80

Calls 5

skipMethod · 0.80
putVar64Method · 0.80
putVar32Method · 0.80
put8Method · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected