Could some one direct me to a command or a way on Linux to measure the number of migrations experienced by a thread or a process? Thank you.
1 Answer
I'm not sure if you have a better tool, but you can use perf
tool for that.
Perf is a profiler tool for Linux 2.6+ based systems that abstracts away CPU hardware differences in Linux performance measurements and presents a simple commandline interface. Perf is based on the perf_events interface exported by recent versions of the Linux kernel.
I have never personally used it, but on their website you have a tutorial and an output example of Counting with perf stat, where the number of migrations is part of the output.
I hope it helps.
-
Thank you very much. But the data getting from the tool is somewhat mysterious. So much variation from run to run.– samarasaCommented Jan 14, 2012 at 17:41
-
2The data that you are collecting depends on a number of factors such as the load of your system, the scheduling policy, input/output operations etc. Most probably, the variations that you are obtaining in the data that you are analyzing are due to those factors.– CRMCommented Jan 14, 2012 at 18:16