0

When I use the command cat /proc/<pid>/pagemap, I'm not getting any output. Usually I get some binary output but now I am not getting anything at first.

The output starts coming an hour or so after entering the command cat /proc/<pid>/pagemap. I have tried different kernel versions bu the problem still exists.

2
1

/proc/[pid]/pagemap is a virtual file with 225, 64-bit wide entries for pages. For a given program most of the entries will be 0x00000000. There are two problems to your approch of cat /proc/[pid]/pagemap:

  • To print such a file would take an enormous amount of time.
  • The file consists of entries which are not ASCII Printable chars.

We can solve the above problems by:

  • Use /proc/[pid]/maps to get the virtual address and seek to position on pagemap file.
  • Use hexdump instead of cat to print the entry.

You may refer to Viewing pagetable for a process for more detailed research regarding same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.