[Windows] Implement support for the cpu-clock
perf pseudo-counter
#897
Labels
O-windows
An issue specific to the Windows OS
The Linux
perf
tool has a counter calledcpu-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 thecpu-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 theTime
(orTimerFixed
?) 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.
The text was updated successfully, but these errors were encountered: