开发者

How can I get page faults statistics from kernel

How can I get page faults statistics from kernel for my application while it is running? What about other events, like inter-cpu migrations count in SMP nodes, or number of context swit开发者_JS百科ches?

I want to count such events for various small parts of the program.

Thanks.


The procfs records some of that information, but (I believe) not all of it, and definitely not "for various small parts", but only for the process as a whole. I doubt the kernel records e.g. context switches or page faults "for various small parts" anywhere. Maybe you can take snapshots of the applicable /proc pseudofiles at the start and end of each "small part" and take the difference -- for some applications (that don't branch every which way all of the time) that might be an acceptable substitute.


You'll be wanting to use the "perf" tools packaged with the kernel. See here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜