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?


1 Answer 1


About 1.2 microseconds which is about a thousand Cycles


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .