Question

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

Était-ce utile?

La solution

I think /proc/pid/pagemap and /proc/pid/maps contain this info, but I am not aware of any tool dumping them in a more meaningful format.

You can always write it yourself using the kernel doc:

http://www.kernel.org/doc/Documentation/vm/pagemap.txt

Autres conseils

A script I recently used to do this:

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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top