Monitoring context switches in Linux

Is there a way to determine when context switching occurs without using profilographs? I wrote a C program to track the time taken to execute various processes in a program to complete execution. I want to show also process / thread context switching. Switch switching time and off prev_id -> curr_id. These 3 information would be helpful.

+5
source share
1 answer

In the / proc / self / status file, you can observe the values ​​of the voluntary_ctxt_switches and nonvoluntary_ctxt_switches.

+3
source

All Articles