I need to examine how my CPU is performing. I could simply open the task manager, but I will have to sit in front of the monitor long time. My problem is that CPU seems to be spiking or overloading and crashing all the programs that are running. So, I want to be able to log it somewhere say every second or so. Is there way to log CPU load?
1 Answer
You can run top
without reloading and write its output to a log to analyze it later.
while sleep 1; do top -n1 >> cpu.log; done
top
but that doesn't log./proc/stat
).