procps/proc
Jim Warner d69a2b6899 library: normalize/standardize interface, <VMSTAT> api
This interface represented a 2nd generation attempt at
the opaque newlib approach. In other words, it did not
involve the 1st generation 'chains'. Instead, 'stacks'
were employed. But the interface wasn't user friendly.

Users were required to create their own stacks, before
calling 'getstack' to retrieve multiple results with a
single call. Even worse, sometimes 'read' was required
before calling 'get' when working with single results.

So this commit represents the 3rd generation approach.
We eliminate the burden of 'read' and creating stacks.
Rather, beyond those standard 'new', 'ref' and 'unref'
functions, we'll offer just 'get' (single result) plus
a 'select' function (for multiple results in 1 stack).

And along the way, this commit vastly expands the data
extracted from /proc/vmstat. All values that currently
exist (and their delta equivalents) are now available.
Deltas were included for everything because there's no
real runtime costs beyond using a little extra memory.

The only problem is a lack of documentation for all of
those fields, as is reflected in the references below.
Oh well, maybe someday someone will dig through kernel
sources & finally plug that rather large document gap.

[ as an aside, rather than using a 'strcmp' approach ]
[ when parsing the /proc/vmstat file, as is found in ]
[ the <meminfo> module, we exploit those hash search ]
[ provisions that are found in the <search.h> header ]

Reference(s):
http://www.spinics.net/lists/linux-man/msg09096.html
http://www.linuxinsight.com/proc_vmstat.html

Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-06-07 21:04:43 +10:00
..
.gitignore tests: update template and add pids 2016-04-19 21:33:02 +10:00
alloc.c library: cleanup of library includes 2016-04-16 17:03:57 +10:00
alloc.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
COPYING miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
devname.c library: Remove tty_to_dev() 2015-09-01 20:41:25 +10:00
devname.h library: cleanup of readproc functions 2016-04-17 14:14:27 +10:00
diskstat.c misc: Few more resource leak fixes 2016-05-03 21:58:13 +10:00
diskstat.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
escape.c library: re-arrange escape commands 2016-04-17 14:45:19 +10:00
escape.h library: re-arrange escape commands 2016-04-17 14:45:19 +10:00
libprocps.pc.in Renaming libprocfs to libprocps 2011-12-23 09:18:43 +11:00
libprocps.sym library: normalize/standardize interface, <VMSTAT> api 2016-06-07 21:04:43 +10:00
meminfo.c library: add parameter checks for 'get', <MEMINFO> api 2016-06-07 21:04:43 +10:00
meminfo.h library: remove the ull_int result type, <MEMINFO> api 2016-05-12 21:15:01 +10:00
namespace.c miscellaneous: silence a whole bunch of clang warnings 2015-09-21 22:34:27 +10:00
namespace.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
openproc.3 documentation: fix man pages due to refactor for wchan 2015-06-19 19:09:21 +10:00
pids.c library: eliminated a final potential NULL, <PIDS> api 2016-05-22 21:59:18 +10:00
pids.h library: try different alignment for types, <PIDS> api 2016-05-16 19:58:20 +10:00
procps-private.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
procps.h library: rename those readstat.c & h sources to 'stat' 2016-04-26 22:27:16 +10:00
pwcache.c library: export pwcache functions correctly 2015-06-26 22:37:53 +10:00
pwcache.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
readproc.3 misc: result after checking all files for misspellings 2014-08-08 22:14:21 +02:00
readproc.c library: eliminated a final potential NULL, <PIDS> api 2016-05-22 21:59:18 +10:00
readproc.h library: eliminated a final potential NULL, <PIDS> api 2016-05-22 21:59:18 +10:00
readproctab.3 misc: result after checking all files for misspellings 2014-08-08 22:14:21 +02:00
slab.c library: slab sort derefence after check 2016-05-14 22:32:35 +10:00
slab.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
stat.c library: improve internal 'get' processing, <STAT> api 2016-06-07 21:04:43 +10:00
stat.h library: improve internal 'get' processing, <STAT> api 2016-06-07 21:04:43 +10:00
sysinfo.c library: correct the procps_pid_length() +1 distortion 2016-04-18 19:29:41 +10:00
sysinfo.h library: remove an obsolete 'jiffs' typedef in sysinfo 2016-05-08 21:12:22 +10:00
test_namespace.c tests: update template and add pids 2016-04-19 21:33:02 +10:00
test_pids.c library: Fix pids API tests 2016-05-22 22:12:54 +10:00
test_sysinfo.c tests: update template and add pids 2016-04-19 21:33:02 +10:00
test_uptime.c library: procps_uptime() return value is a status 2016-05-01 16:50:25 +10:00
test_version.c library: Fix LINUX_VERSION macro 2016-05-01 17:46:25 +10:00
uptime.c library: procps_uptime() return value is a status 2016-05-01 16:50:25 +10:00
uptime.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
version.c miscellaneous: remove some trailing whitespace buildup 2015-06-20 07:46:23 +10:00
version.h library: Fix LINUX_VERSION macro 2016-05-01 17:46:25 +10:00
vmstat.c library: normalize/standardize interface, <VMSTAT> api 2016-06-07 21:04:43 +10:00
vmstat.h library: normalize/standardize interface, <VMSTAT> api 2016-06-07 21:04:43 +10:00
wchan.c library: refactor and rely on modern kernels for wchan 2015-06-19 19:09:20 +10:00
wchan.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00