#! /bin/bash # Reset the counters echo "0" > /proc/timer_stats echo "1" > /proc/timer_stats # For a 1000 Hz kernel and for 40% probability of issue: # Apply a 6 percent load at 100 hertz for 20 seconds # taskset -c 5 /home/doug/c/consume 6.0 100.0 20.0 & # # Or, and also for 1000 Hz kernel and for 40% probability of issue: # Apply a 30 percent load at 500 hertz for 20 seconds. taskset -c 5 /home/doug/c/consume 30.0 500.0 20.0 & # # For a 250 Hz kernel and for 40% probability of issue: # Apply a 30 percent load at 125 hertz for 20 seconds # taskset -c 5 /home/doug/c/consume 30.0 125.0 20.0 & # # Or just do the math and create your own senario. # # taskset -c 5 /home/doug/c/consume ??.? ???.? 20.0 & # wait until somewhere in the middle of things sleep 10 # What is the CPU 5 frequency? echo -n "CPU 5 frequency (~ at or near minimum means forced low due to excessive timer deferral, ~~higher means O.K.): " cat /sys/devices/system/cpu/cpu5/cpufreq/cpuinfo_cur_freq # wait until after consume has finished. sleep 11 # Now observe the timer counters cat /proc/timer_stats | grep intel # And turn off timer stats. echo "0" > /proc/timer_stats