Linux – Seeing when was the last time a process ran in linux

linuxmonitoringprocesstop

Looking at top output on my linux server, I see a root owned process that is always in S mode whenever I look. How can I find out when was the last time it actually ran on a cpu and did something?

Thanks!

Best Answer

Not terribly elegant, but you could run strace on it -- e.g. strace -ft -p PID and you won't get any output while it's sleeping. The -f will follow any forked child processes and the -t will prefix the output with the time of day (more t's = more precision). It can't look into the past but will show you the next time it does something (and what it's doing).