Can anyone suggest some learning materials to accomplish my question? I'm working with the Linux kernel.
I'm planning on conducting an experiment, but need access to my process' page table, and so far have only found kernel space code to acc开发者_如何学运维omplish what I want.
Thanks
You'll probably find the information you want in the proc filesystem, under /proc/self
. In particular /proc/self/maps
contains the list of memory mappings in the process, with an indication of their permission and file when applicable. There is a little more information in /proc/self/smaps
. You'll have to look in the kernel documentation for the format, specifically Documentation/filesystems/proc.txt
.
Accurate memory metrics can be given by pagemap kernel interface - utilized in libpagemap library https://fedorahosted.org/libpagemap/. Library provides also userspace utils so you can start monitor memory immediately.
精彩评论