File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,8 +209,9 @@ TSC and MPERF frequencies can be easily measured in Linux by sampling counters o
209209interval. For example, this ` perf ` command takes samples every second on CPU 0:
210210
211211``` bash
212- # Sample every second while running a busy loop on CPU 0 to prevent idle states
213- perf stat -I 1000 -C 0 -A -e ' msr/tsc/,msr/mperf/' -- taskset -c 0 sh -c ' while true; do :; done'
212+ # Sample every second while running a busy loop on CPU 0 to prevent idle states. Use counters
213+ # grouping ("{}") to ensure that TSC and MPERF are sampled in a single system call.
214+ perf stat -I 1000 -C 0 -A -e ' {msr/tsc/,msr/mperf/}' -- taskset -c 0 sh -c ' while true; do :; done'
214215```
215216
216217In practice, the measured MPERF frequency is very close to TSC frequency on all platforms I have
You can’t perform that action at this time.
0 commit comments