LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-12-2015, 02:02 PM   #1
newbee15
LQ Newbie
 
Registered: Sep 2015
Posts: 1

Rep: Reputation: Disabled
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.

Last edited by newbee15; 09-12-2015 at 02:19 PM.
 
Old 09-12-2015, 09:48 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by newbee15 View Post
Or is there something I missed in the logic of calculation.
Certainly looks like it.
Have you read vmstat.h ?. Have you ascertained the (rough) ratio of your numbers to those reported in /proc/vmstat ?.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing brightness contrast and gamma values in ubuntu 12.10 abdoun Linux - Newbie 1 03-25-2013 06:33 AM
[SOLVED] Downloaded Ubuntu 12.04.2 from Linuxiso.org. Md5sum mismatch gcinglis Linux - Newbie 4 03-05-2013 10:38 PM
Ubuntu rep MD5Sum mismatch introuble Ubuntu 0 09-13-2006 03:05 PM
Monitoring disk activity with vmstat gives strange values. Why? tobikars Linux - Software 0 12-07-2005 12:07 AM
Ubuntu Mplayer Install Error: Md5Sum mismatch racket24 Linux - Software 4 07-12-2005 04:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration