From 6cafe3abecdfb758259fabe48b6e0e4b74cd484e Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Fri, 5 Aug 2016 00:00:00 -0500 Subject: [PATCH] library: expand VAL macros to include the context parm This patch will set the stage for validating the types referenced in the result union. For now, the parameter representing that 'info' structure will remain unused. [ and while we're at it, let us correct a faulty GET ] [ macro in the diskstats header. that puppy missed a ] [ parm which ain't so good if that guy is ever used! ] Signed-off-by: Jim Warner --- proc/diskstats.h | 6 +++--- proc/meminfo.h | 2 +- proc/pids.h | 2 +- proc/slabinfo.h | 2 +- proc/stat.h | 2 +- proc/vmstat.h | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/proc/diskstats.h b/proc/diskstats.h index 55e67636..cebbd46f 100644 --- a/proc/diskstats.h +++ b/proc/diskstats.h @@ -89,10 +89,10 @@ struct diskstats_reap { #define DISKSTATS_TYPE_DISK -11111 #define DISKSTATS_TYPE_PARTITION -22222 -#define DISKSTATS_GET( info, actual_enum, type ) \ - procps_diskstats_get( info, actual_enum ) -> result . type +#define DISKSTATS_GET( info, name, actual_enum, type ) \ + procps_diskstats_get( info, name, actual_enum ) -> result . type -#define DISKSTATS_VAL( relative_enum, type, stack) \ +#define DISKSTATS_VAL( relative_enum, type, stack, info ) \ stack -> head [ relative_enum ] . result . type diff --git a/proc/meminfo.h b/proc/meminfo.h index cc24afa7..9b3b0192 100644 --- a/proc/meminfo.h +++ b/proc/meminfo.h @@ -140,7 +140,7 @@ struct meminfo_stack { #define MEMINFO_GET( info, actual_enum, type ) \ procps_meminfo_get( info, actual_enum ) -> result . type -#define MEMINFO_VAL( relative_enum, type, stack) \ +#define MEMINFO_VAL( relative_enum, type, stack, info ) \ stack -> head [ relative_enum ] . result . type diff --git a/proc/pids.h b/proc/pids.h index 0b27f847..20af3e00 100644 --- a/proc/pids.h +++ b/proc/pids.h @@ -195,7 +195,7 @@ struct pids_fetch { }; -#define PIDS_VAL( relative_enum, type, stack ) \ +#define PIDS_VAL( relative_enum, type, stack, info ) \ stack -> head [ relative_enum ] . result . type diff --git a/proc/slabinfo.h b/proc/slabinfo.h index e36b60fd..30ad06b6 100644 --- a/proc/slabinfo.h +++ b/proc/slabinfo.h @@ -98,7 +98,7 @@ struct slabinfo_reap { #define SLABINFO_GET( info, actual_enum, type ) \ procps_slabinfo_get( info, actual_enum ) -> result . type -#define SLABINFO_VAL( relative_enum, type, stack ) \ +#define SLABINFO_VAL( relative_enum, type, stack, info ) \ stack -> head [ relative_enum ] . result . type diff --git a/proc/stat.h b/proc/stat.h index b2fa3b97..e6f74a47 100644 --- a/proc/stat.h +++ b/proc/stat.h @@ -108,7 +108,7 @@ struct stat_reaped { #define STAT_GET( info, actual_enum, type ) \ procps_stat_get( info, actual_enum ) -> result . type -#define STAT_VAL( relative_enum, type, stack ) \ +#define STAT_VAL( relative_enum, type, stack, info ) \ stack -> head [ relative_enum ] . result . type diff --git a/proc/vmstat.h b/proc/vmstat.h index 0ff8590f..483c0e28 100644 --- a/proc/vmstat.h +++ b/proc/vmstat.h @@ -288,7 +288,7 @@ struct vmstat_stack { #define VMSTAT_GET( info, actual_enum, type ) \ procps_vmstat_get( info, actual_enum ) -> result . type -#define VMSTAT_VAL( relative_enum, type, stack ) \ +#define VMSTAT_VAL( relative_enum, type, stack, info ) \ stack -> head [ relative_enum ] . result . type