library: add chaining provisions to meminfo and vmstat

If a caller chooses to reduce the overhead of repeated
function calls, this commit provides for acquiring all
the desired information in just a single library call.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2015-06-28 00:00:00 -05:00
committed by Craig Small
parent 7a98cab187
commit a05084f381
5 changed files with 127 additions and 0 deletions

View File

@@ -34,6 +34,12 @@ enum vmstat_item {
PROCPS_VMSTAT_PSWPOUT
};
struct vmstat_result {
enum vmstat_item item;
unsigned long result;
struct vmstat_result *next;
};
struct procps_vmstat;
int procps_vmstat_new (struct procps_vmstat **info);
@@ -43,6 +49,7 @@ struct procps_vmstat *procps_vmstat_ref (struct procps_vmstat *info);
struct procps_vmstat *procps_vmstat_unref (struct procps_vmstat *info);
unsigned long procps_vmstat_get (struct procps_vmstat *info, enum vmstat_item item);
int procps_vmstat_get_chain (struct procps_vmstat *info, struct vmstat_result *item);
__END_DECLS
#endif