I'm interessted in getting the number of context switches a two processes in a KVM vm takes on a singel CPU over some time.

Earlier i have used perf, is this best practice?

And how much time is used on a context switch per CPU?


About 1.2 microseconds which is about a thousand Cycles


| improve this answer | |
  • And most of that time is taken up by the Linux scheduler doing its work – JanKanis Jun 12 at 6:29

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.