I was wondering if there is any utility/code in Linux (x86-64) that could dump each page table entries for a given process's (user) address space?
Thanks
I was wondering if there is any utility/code in Linux (x86-64) that could dump each page table entries for a given process's (user) address space?
Thanks
我认为/proc/pid/pagemap
并/proc/pid/maps
包含此信息,但我不知道有任何工具以更有意义的格式转储它们。
您始终可以使用内核文档自己编写它:
我最近用来执行此操作的脚本:
cat /proc/self/maps | while read line
do
echo ${line}
echo ${line} | awk '{print $1}' | (
IFS=- read start end
start=$(( 0x${start} ))
end=$(( 0x${end} ))
addr=${start}
while [ ${addr} -lt ${end} ]
do
printf "%08x: " ${addr}
dd if=/proc/self/pagemap bs=8 skip=$(( addr / 4096 )) count=1 2>/dev/null | od -v -t x8 -A none
addr=$(( addr + 4096 ))
done
)
done