Add stats from ninja subprocesses to build.trace.gz

Propagate the subprocess stats from ninja to build.trace.gz.

There is too much data here to put into separate counters for each
statistic, so put them into args on each duration event for now.

We would like to track max RSS for each subprocess, but the Linux
kernel inherits the max RSS of the ninja process in each subprocess,
which sets a lower bound on the measurable max RSS to the size of
the ninja process.  The ninja process is large due to the multi-GB
build.ninja files.

Bug: 170701554
Test: examine build.trace.gz
Change-Id: I8aaaafe627a57f1a500af098c097c6381c583ba5
This commit is contained in:
Colin Cross
2020-10-15 13:46:32 -07:00
parent ce4c7cd55d
commit d888b6b4fc
5 changed files with 190 additions and 39 deletions

View File

@@ -65,6 +65,20 @@ message Status {
optional uint32 user_time = 5;
// Number of milliseconds spent executing in kernel mode
optional uint32 system_time = 6;
// Max resident set size in kB
optional uint64 max_rss_kb = 7;
// Minor page faults
optional uint64 minor_page_faults = 8;
// Major page faults
optional uint64 major_page_faults = 9;
// IO input in kB
optional uint64 io_input_kb = 10;
// IO output in kB
optional uint64 io_output_kb = 11;
// Voluntary context switches
optional uint64 voluntary_context_switches = 12;
// Involuntary context switches
optional uint64 involuntary_context_switches = 13;
}
message Message {