-
Notifications
You must be signed in to change notification settings - Fork 157
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
// FIXME(wesleywiser): We should be properly calculating this value by taking the total time | |
// each rustc thread runs per core and adding them togther. This placeholder value is here | |
// so that we can still render the detailed query statistics page (although the "Time (%)" | |
// column will show the wrong value). | |
cpu_clock: 1.0, |
rustc-perf/collector/src/etw_parser.rs
Lines 398 to 399 in c648f39
// FIXME(wesleywiser): see comment in `<Counters as Default>::default()`. | |
cpu_clock: 0.0, |
After this is implemented, the detailed self-profile query results page should show reasonable numbers in the total "Time %" cell.