I'm new in Perl and what I would like to do ,for a given pid,is to parse from all virtual addresses to physical ones and the related information about PTE soft-dirty bit at each time interval . So what I would like to get ,by supposing an overall duration of 1 second and an observation time of 0.1 s(Thus I should get an array/list of 10 elements zero or one) is a data structure like this:
I'm thinking something like each hash key is linked to a list of values(array), but before that I need to parse the binary file proc/pid/pagemap in linux and then getting the above structure. I read something around ,but I got stuck at the moment. The structure of that file can be found at https://www.kernel.org/doc/Documentation/vm/pagemap.txt . I read something around ,but I got stuck at the moment. Thanks for reading.Any help/solution is very appreciated . PS: I also asked for help at stackoverflow so that I might have more chance to get an answer!#PageNumberKey Soft_dirty-bit [pageframenumber#1]-> [0 1 0 0 1 1 0 0 1 1] [pageframenumber#2]-> [0 0 0 1 1 0 0 0 0 0] [pageframenumber#3]-> [0 0 0 0 0 1 0 0 1 0] [pageframenumber#4]-> [1 1 0 0 1 1 1 0 0 1] [pageframenumber#5]-> [1 1 0 0 0 0 0 0 1 1] ........................ ..........................
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |