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

Method recordProcessSample

src/flightRecorder.cpp:1130–1163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected