1

I have a case in which a process is forked() in a heavy loaded system. I wish to know if the process has started running (started consuming cpu). I have to monitor this child process cpu consumption from parent process.

Can you please suggest what are all the possible ways I can do this. I can check for pr_time in prusage_t to get the cpu time used by child process but I am looking for more options.

Paul R
  • 208,748
  • 37
  • 389
  • 560
Arpit
  • 4,259
  • 10
  • 38
  • 43

1 Answers1

4

Please check this to get the cpu utilization. https://github.com/fho/code_snippets/blob/master/c/getusage.c

You can get the child process id when you fork the process.So at parent process just check for the child process id.

Gaurav Pant
  • 4,029
  • 6
  • 31
  • 54