Mismatch in Pagefault and vmstat values in Ubuntu
I want to capture the Pagefault values in Ubuntu.
Below is my code logic to capture Pagefaults : "(vm_event_states.event[PGFAULT])" But when I run the following commands there is a huge difference in the values : db@ubuntu:~/pgfault$ grep pgfault /proc/vmstat pgfault 4648883 db@ubuntu:~/pgfault$ cat /proc/pgfault 2358120 db@ubuntu:~/pgfault$ grep pgfault /proc/vmstat pgfault 4649312 db@ubuntu:~/pgfault$ grep pgfault /proc/vmstat pgfault 4649663 db@ubuntu:~/pgfault$ cat /proc/pgfault 2291317 student@ubuntu:~/pgfault$ grep pgfault /proc/vmstat pgfault 4650279 Can someone please help me to understand why there is such a huge difference in the values of pagefaults? Or is there something I missed in the logic of calculation. I also tried for the "major fault" and the "minor fault" but it didn't work. Please suggest. |
Quote:
Have you read vmstat.h ?. Have you ascertained the (rough) ratio of your numbers to those reported in /proc/vmstat ?. |
All times are GMT -5. The time now is 03:20 AM. |