I have a binary which spawns a lot of worker threads to do some jobs asynchronously, I want to be able to use a profiler and record the time or percentage of time taken to do context switches in the profiled time. I cannot modify the binary in any way.
Tried to look at voluntary_ctxt_switches and nonvoluntary_ctxt_switches values from the /proc/self/status, but having some trouble parsing through the output, wondering if there are tooling made to more easily find out information like this.