The temperatures of the individual cores can be obtained easily with the lm-sensors package. To put a little stress on the CPU, cpuburn is very helpful.
Here is a little Python script that records the temperatures and frequencies of the CPU over time and another Octave script that visualizes the temperature data. The package cpufrequtils is required to obtain the CPU frequencies. For validation purposes, mpstat is used to record the CPU utilization. If you benchmark your CPU with a program that does not fully utilize the CPU during certain periods of time, this data might be helpful to correct for strange effects in the temperature curve.
Assuming a CPU with 2 cores and using burnP6 to create some stress , the script might be executed as follows:
$python rec_sensor_log 5000 sensors_log.csv & burnP6 & burnP6
The first parameter is the time between two temperature samples in milliseconds and the second is the name of the output file. Depending on the amount of available cores in the CPU, several instances of burnP6 (or equivalent) should be started. The script parses the output from lm-sensors in a not very sophisticated way. If you have more/less cores, you will probably have to make modifications to the script.
The visualization script (vis_log.m) will prompt for the input filename. Frequency scaling might occur at high temperatures. If this is detected, a vertical line is drawn into the plot.
Here is a sample plot that was created during a quick test on my laptop. Under stress the temperature rises up to approx. 70°C and the fan spins faster to keep the temperature at about this level. As soon as the stress is removed, the temperature quickly falls below 50°C.
No comments:
Post a Comment