| 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 |