The number of context switches as reported by vmstat doesn't match up with the total of pidstat
<p>I am monitoring the number of context switches in a java application. <code>vmstat 1</code> gives cs per second globally. <code>pidstat -wt</code> also reports the cs per second for all the threads. This doesn't match up at all. The former is of the order of 40k whereas the latter is around 20-40 per second at max for a given process (much lower around 1 for most processes).</p>

<p>What is the reason for this mismatch? What is getting missed in the pidstat output?</p>