| 1128 | } |
| 1129 | |
| 1130 | void recordProcessSample(Buffer* buf, const ProcessInfo* info) { |
| 1131 | int start = buf->skip(5); |
| 1132 | buf->put8(T_PROCESS_SAMPLE); |
| 1133 | buf->putVar64(TSC::ticks()); |
| 1134 | |
| 1135 | buf->putVar32(info->pid); |
| 1136 | buf->putVar32(info->ppid); |
| 1137 | buf->putByteString(info->name); |
| 1138 | buf->putByteString(info->cmdline); |
| 1139 | |
| 1140 | buf->putVar32(info->uid); |
| 1141 | buf->put8(info->state); |
| 1142 | |
| 1143 | buf->putVar64(info->start_time); |
| 1144 | buf->putFloat(info->cpu_user); |
| 1145 | buf->putFloat(info->cpu_system); |
| 1146 | buf->putFloat(info->cpu_percent); |
| 1147 | buf->putVar32(info->threads); |
| 1148 | |
| 1149 | buf->putVar64(info->vm_size); |
| 1150 | buf->putVar64(info->vm_rss); |
| 1151 | |
| 1152 | buf->putVar64(info->rss_anon); |
| 1153 | buf->putVar64(info->rss_files); |
| 1154 | buf->putVar64(info->rss_shmem); |
| 1155 | |
| 1156 | buf->putVar64(info->minor_faults); |
| 1157 | buf->putVar64(info->major_faults); |
| 1158 | |
| 1159 | buf->putVar64(info->io_read); |
| 1160 | buf->putVar64(info->io_write); |
| 1161 | |
| 1162 | buf->putVar32(start, buf->offset() - start); |
| 1163 | } |
| 1164 | |
| 1165 | void recordLiveObject(Buffer* buf, int tid, u32 call_trace_id, LiveObject* event) { |
| 1166 | int start = buf->skip(1); |