Basically I want to have all processes that have been sleeping for more than one hour.
I know that there is etime in ps, but sadly it shows the overall lifetime.
How can this be done under linux (preferably with ps)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
/proc/pid/schedfile contains a metric ton of scheduling data:I suggest reading through the
/proc/*/schedfiles looking forse.statistics.nr_wakeupsorse.statistics.wait_countlines that don’t change for an hour. I don’t know off-hand which one would give you ‘better’ results, but try both 🙂 and see which one gives you answers like you expect.