0

From here, How to see how many context switches a process makes? I found the method to view the number of context switching of alive process. But I need to view the whole number of context switching from the time when it is created to the time when it is dead. But after it deads, there is no proc filesystem. Is it any method to do it? Thanks for help

laurent01
  • 5
  • 2

1 Answers1

1

On Linux, when a process dies, the kernel forgets most of the information about it, including context switches, and there’s no way to retrieve this information once it is gone. (Once a process is reaped, everything about it is forgotten.)

You need to instrument the processes you’re interested in ahead of time, using one of the approaches described in the question you linked to.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164