title: Monitoring context switches in Linux
body: <p>Is there any way to determine whenever a context switch takes place without the use of profilers? I have written a C program to monitor the time taken for different processes in a program to finish execution. I want to show the process/thread context switching as well. The time at which the switch takes place and from <code>prev_id -&gt; curr_id</code>. These 3 informations would be helpful. </p>