Is it possible to get a count of how many times a process has changed its state? (from running to interruptible sleep for example)

I have a process that calls another process and i would like to track how many calls happened (Neither processes were written by me), the called process is in interruptible sleep until called, then changes to running, then changes back to interruptible sleep until called again.

  • The two paragraphs seems to ask two completely separate questions. One is "how to track state changes" and the other is "how many times is one process called from another". Could you please clarify whether you have two or one question? – Kusalananda Oct 27 '18 at 9:22
  • Sorry, the second paragraph explains why i would like to get this information, did i clarify? – Binyamin Oct 27 '18 at 10:43
  • Interruptible sleep could mean that it's waiting for input. Counting the state changes of the second process may not give you the same answer as counting the number of times that the first process sends data to it. Have you tried running strace on the processes? – Kusalananda Oct 27 '18 at 10:46
  • When i run strace i see a lot of read writes to a socket file descriptor, perhaps that is a good enough approximation to what i need – Binyamin Oct 27 '18 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.