Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#3 Patch to fix reading of /proc/vmstat on newer kernels

open
nobody
None
5
2010-03-18
2010-03-18
Paul Koetsier
No

On our SLES 10 and SLES 11 machines, the Nmon VM data was mostly invalid. This is because newer kernels have additional fields in /proc/vmstat, which no longer matches the static list of fields that read_vmstat() has. In our case, the pswpin field of the VM records in the Nmon data files actually contained the pgpgout counter, leading one to think the machines were paging in from paging space all the time while in fact they weren't.

The attached patch uses proc_read() to read /proc/vmstat and uses a slightly modified version of proc_mem_search() to find the VM fields in proc[P_VMSTAT].line[].

The patch also has a modified version of args_output() which writes the same fields to UARG records as the AIX version does. Compared to Nmon for Linux 13d, it adds ppid, thcount, user and group.

Discussion

  • Paul Koetsier
    Paul Koetsier
    2010-03-18

    Patch to fix reading of /proc/vmstat on newer kernels

     
  • Denis Cerkvin
    Denis Cerkvin
    2013-04-30

    Hi Paul, thank you for this info, it seems like it has been implemented long time ago, but I just checked again anyway :-) Piece of mind, you know ...

    I have checked 14g with:
    $ cat /proc/vmstat | egrep "(pgfree|pgfault|pgpgin|pgpgout)"; tail -4 /tmp/nmon.err
    pgpgin 1633171
    pgpgout 4779157
    pgfree 20275945
    pgfault 12233041
    ... pgpgin:1633171
    ... pgpgout:4779157
    ... pgfree:20275747
    ... pgfault:12232511

    Was also cross-checking other functionality and results of "nmon" while working on my Infiniband patch - and it seems that now NMon can be used without any fear to monitor my hadoop clusters! :-)

    Thanks again.

    Sincerely,
    Denis Cerkvin

    The Bible for command line people.
    http://www.read-and-think.org/kjv.html
    =================================================