Description
The Linux perf
tool has a counter called cpu-clock
which is basically just the total time the process was running on each thread. (As a simple example, suppose a process runs for 3 seconds on 1 core and, at the same time, 1 second on another core, then the cpu-clock
would read 4 seconds)
This counter isn't backed by a hardware performance counter, rather it is a metric derived from some hardware performance counters and as such, doesn't exist on Windows. However, we can replicate the counter ourselves.
To do that, we'll need to keep track of the times each thread we care about spends active on a core and sum the total times together. We may be able to use the Timestamp
data already collected in the trace file for this purpose or we may need to use the Time
(or TimerFixed
?) PMC.
rustc-perf/collector/src/etw_parser.rs
Lines 384 to 388 in c648f39
rustc-perf/collector/src/etw_parser.rs
Lines 398 to 399 in c648f39
After this is implemented, the detailed self-profile query results page should show reasonable numbers in the total "Time %" cell.