From 4642216f70dd98134a79f9299b7ca4bc876649c7 Mon Sep 17 00:00:00 2001
From: Vito Caputo <vcaputo@gnugeneration.com>
Date: Sun, 28 Aug 2016 00:36:53 -0700
Subject: *: refactor all the things

Long overdue house cleaning.

The addition of compositing/monitoring overlays in vwm3 pushed vwm well past
what is a reasonable size for a simple thousand line file.  This is a first
step towards restoring sanity in the code, but no behavioral differences are
intended, this is mostly just shuffling around and organizing code.

I expect some performance regressions initially, follow-on commits will make
more improvements to that end as the dust settles.
---
 libvmon/defs/sys_vm.def | 169 ------------------------------------------------
 1 file changed, 169 deletions(-)
 delete mode 100644 libvmon/defs/sys_vm.def

(limited to 'libvmon/defs/sys_vm.def')

diff --git a/libvmon/defs/sys_vm.def b/libvmon/defs/sys_vm.def
deleted file mode 100644
index 33b4d3f..0000000
--- a/libvmon/defs/sys_vm.def
+++ /dev/null
@@ -1,169 +0,0 @@
-#include "_begin.def"
-
-
-		/* 		member name,		symbolic constant,		human label,		human description (think UI/help) */
-	/* /proc/meminfo */
-vmon_omit_literal("MemTotal:",				SYS_VM_TOTAL_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_TOTAL_KB_WHITESPACE)
-vmon_datum_ulong(		total_kb,		SYS_VM_TOTAL_KB,			"Total",		"Total memory in system")
-vmon_omit_literal(" kB\n",				SYS_VM_TOTAL_KB_UNIT_NL)
-vmon_omit_literal("MemFree:",				SYS_VM_FREE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_FREE_KB_WHITESPACE)
-vmon_datum_ulong(		free_kb,		SYS_VM_FREE_KB,				"Free",			"Free memory in system")
-vmon_omit_literal(" kB\n",				SYS_VM_FREE_KB_UNIT_NL)
-vmon_omit_literal("Buffers:",				SYS_VM_BUFFERS_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_BUFFERS_KB_WHITESPACE)
-vmon_datum_ulong(		buffers_kb,		SYS_VM_BUFFERS_KB,			"Buffers",		"Memory allocated to buffers")
-vmon_omit_literal(" kB\n",				SYS_VM_BUFFERS_KB_UNIT_NL)
-vmon_omit_literal("Cached:",				SYS_VM_CACHED_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_CACHED_KB_WHITESPACE)
-vmon_datum_ulong(		cached_kb,		SYS_VM_CACHED_KB,			"Cached",		"Memory allocated to caches")
-vmon_omit_literal(" kB\n",				SYS_VM_CACHED_KB_UNIT_NL)
-vmon_omit_literal("SwapCached:",			SYS_VM_SWAPCACHED_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_SWAPCACHED_KB_WHITESPACE)
-vmon_datum_ulong(		swapcached_kb,		SYS_VM_SWAPCACHED_KB,			"SwapCached",		"Memory allocated to swap caches")
-vmon_omit_literal(" kB\n",				SYS_VM_SWAPCACHED_KB_UNIT_NL)
-vmon_omit_literal("Active:",				SYS_VM_ACTIVE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_ACTIVE_KB_WHITESPACE)
-vmon_datum_ulong(		active_kb,		SYS_VM_ACTIVE_KB,			"Active",		"Active pages")
-vmon_omit_literal(" kB\n",				SYS_VM_ACTIVE_KB_UNIT_NL)
-vmon_omit_literal("Inactive:",				SYS_VM_INACTIVE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_INACTIVE_KB_WHITESPACE)
-vmon_datum_ulong(		inactive_kb,		SYS_VM_INACTIVE_KB,			"Inactive",		"Inactive pages")
-vmon_omit_literal(" kB\n",				SYS_VM_INACTIVE_KB_UNIT_NL)
-vmon_omit_literal("Active(anon):",			SYS_VM_ANON_ACTIVE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_ANON_ACTIVE_KB_WHITESPACE)
-vmon_datum_ulong(		anon_active_kb,		SYS_VM_ANON_ACTIVE_KB,			"AnonActive",		"Active anonymous pages")
-vmon_omit_literal(" kB\n",				SYS_VM_ANON_ACTIVE_KB_UNIT_NL)
-vmon_omit_literal("Inactive(anon):",			SYS_VM_ANON_INACTIVE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_ANON_INACTIVE_KB_WHITESPACE)
-vmon_datum_ulong(		anon_inactive_kb,	SYS_VM_ANON_INACTIVE_KB,		"AnonInactive",		"Inactive anonymous pages")
-vmon_omit_literal(" kB\n",				SYS_VM_ANON_INACTIVE_KB_UNIT_NL)
-vmon_omit_literal("Active(file):",			SYS_VM_FILE_ACTIVE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_FILE_ACTIVE_KB_WHITESPACE)
-vmon_datum_ulong(		file_active_kb,		SYS_VM_FILE_ACTIVE_KB,			"FileActive",		"Active file pages")
-vmon_omit_literal(" kB\n",				SYS_VM_FILE_ACTIVE_KB_UNIT_NL)
-vmon_omit_literal("Inactive(file):",			SYS_VM_FILE_INACTIVE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_FILE_INACTIVE_KB_WHITESPACE)
-vmon_datum_ulong(		file_inactive_kb,	SYS_VM_FILE_INACTIVE_KB,		"FileInactive",		"Inactive file pages")
-vmon_omit_literal(" kB\n",				SYS_VM_FILE_INACTIVE_KB_UNIT_NL)
-vmon_omit_literal("Unevictable:",			SYS_VM_UNEVICTABLE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_UNEVICTABLE_KB_WHITESPACE)
-vmon_datum_ulong(		unevictable_kb,		SYS_VM_UNEVICTABLE_KB,			"Unevictable",		"Unevictable pages")
-vmon_omit_literal(" kB\n",				SYS_VM_UNEVICTABLE_KB_UNIT_NL)
-vmon_omit_literal("Mlocked:",				SYS_VM_MLOCKED_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_MLOCKED_KB_WHITESPACE)
-vmon_datum_ulong(		mlocked_kb,		SYS_VM_MLOCKED_KB,			"Mlocked",		"Locked pages")
-vmon_omit_literal(" kB\n",				SYS_VM_MLOCKED_KB_UNIT_NL)
-vmon_omit_literal("SwapTotal:",				SYS_VM_SWAP_TOTAL_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_SWAP_TOTAL_KB_WHITESPACE)
-vmon_datum_ulong(		swap_total_kb,		SYS_VM_SWAP_TOTAL_KB,			"SwapTotal",		"Total swap")
-vmon_omit_literal(" kB\n",				SYS_VM_SWAP_TOTAL_KB_UNIT_NL)
-vmon_omit_literal("SwapFree:",				SYS_VM_SWAP_FREE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_SWAP_FREE_KB_WHITESPACE)
-vmon_datum_ulong(		swap_free_kb,		SYS_VM_SWAP_FREE_KB,			"SwapFree",		"Free swap")
-vmon_omit_literal(" kB\n",				SYS_VM_SWAP_FREE_KB_UNIT_NL)
-vmon_omit_literal("Dirty:",				SYS_VM_DIRTY_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_DIRTY_KB_WHITESPACE)
-vmon_datum_ulong(		dirty_kb,		SYS_VM_DIRTY_KB,			"Dirty",		"Dirty pages")
-vmon_omit_literal(" kB\n",				SYS_VM_DIRTY_KB_UNIT_NL)
-vmon_omit_literal("Writeback:",				SYS_VM_WRITEBACK_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_WRITEBACK_KB_WHITESPACE)
-vmon_datum_ulong(		writeback_kb,		SYS_VM_WRITEBACK_KB,			"Writeback",		"Dirtied pages in the process of being written back")
-vmon_omit_literal(" kB\n",				SYS_VM_WRITEBACK_KB_UNIT_NL)
-vmon_omit_literal("AnonPages:",				SYS_VM_ANONPAGES_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_ANONPAGES_KB_WHITESPACE)
-vmon_datum_ulong(		anonpages_kb,		SYS_VM_ANONPAGES_KB,			"AnonPages",		"Anonymous pages")
-vmon_omit_literal(" kB\n",				SYS_VM_ANONPAGES_KB_UNIT_NL)
-vmon_omit_literal("Mapped:",				SYS_VM_MAPPED_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_MAPPED_KB_WHITESPACE)
-vmon_datum_ulong(		mapped_kb,		SYS_VM_MAPPED_KB,			"Mapped",		"Mapped pages")
-vmon_omit_literal(" kB\n",				SYS_VM_MAPPED_KB_UNIT_NL)
-vmon_omit_literal("Shmem:",				SYS_VM_SHMEM_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_SHMEM_KB_WHITESPACE)
-vmon_datum_ulong(		shmem_kb,		SYS_VM_SHMEM_KB,			"Shmem",		"SysV IPC shmem")
-vmon_omit_literal(" kB\n",				SYS_VM_SHMEM_KB_UNIT_NL)
-vmon_omit_literal("Slab:",				SYS_VM_SLAB_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_SLAB_KB_WHITESPACE)
-vmon_datum_ulong(		slab_kb,		SYS_VM_SLAB_KB,				"Slab",			"Slab memory")
-vmon_omit_literal(" kB\n",				SYS_VM_SLAB_KB_UNIT_NL)
-vmon_omit_literal("SReclaimable:",			SYS_VM_SRECLAIMABLE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_SRECLAIMABLE_KB_WHITESPACE)
-vmon_datum_ulong(		sreclaimable_kb,	SYS_VM_SRECLAIMABLE_KB,			"SReclaimable",		"Slab (reclaimable) memory")
-vmon_omit_literal(" kB\n",				SYS_VM_SRECLAIMABLE_KB_UNIT_NL)
-vmon_omit_literal("SUnreclaim:",			SYS_VM_SUNRECLAIMABLE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_SUNRECLAIMABLE_KB_WHITESPACE)
-vmon_datum_ulong(		sunreclaimable_kb,	SYS_VM_SUNRECLAIMABLE_KB,		"SUnreclaim",		"Slab (unreclaimable) memory")
-vmon_omit_literal(" kB\n",				SYS_VM_SUNRECLAIMABLE_KB_UNIT_NL)
-vmon_omit_literal("KernelStack:",			SYS_VM_KERNELSTACK_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_KERNELSTACK_KB_WHITESPACE)
-vmon_datum_ulong(		kernelstack_kb,		SYS_VM_KERNELSTACK_KB,			"KernelStack",		"Kernel stack")
-vmon_omit_literal(" kB\n",				SYS_VM_KERNELSTACK_KB_UNIT_NL)
-vmon_omit_literal("PageTables:",			SYS_VM_PAGETABLES_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_PAGETABLES_KB_WHITESPACE)
-vmon_datum_ulong(		pagetables_kb,		SYS_VM_PAGETABLES_KB,			"PageTables",		"Page tables")
-vmon_omit_literal(" kB\n",				SYS_VM_PAGETABLES_KB_UNIT_NL)
-vmon_omit_literal("NFS_Unstable:",			SYS_VM_NFS_UNSTABLE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_NFS_UNSTABLE_KB_WHITESPACE)
-vmon_datum_ulong(		nfs_unstable_kb,	SYS_VM_NFS_UNSTABLE_KB,			"NFS_Unstable",		"NFS unstable")
-vmon_omit_literal(" kB\n",				SYS_VM_NFS_UNSTABLE_KB_UNIT_NL)
-vmon_omit_literal("Bounce:",				SYS_VM_BOUNCE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_BOUNCE_KB_WHITESPACE)
-vmon_datum_ulong(		bounce_kb,		SYS_VM_BOUNCE_KB,			"Bounce",		"Bounce")
-vmon_omit_literal(" kB\n",				SYS_VM_BOUNCE_KB_UNIT_NL)
-vmon_omit_literal("WritebackTmp:",			SYS_VM_WRITEBACKTMP_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_WRITEBACKTMP_KB_WHITESPACE)
-vmon_datum_ulong(		writebacktmp_kb,	SYS_VM_WRITEBACKTMP_KB,			"WritebackTmp",		"Writeback temp")
-vmon_omit_literal(" kB\n",				SYS_VM_WRITEBACKTMP_KB_UNIT_NL)
-vmon_omit_literal("CommitLimit:",			SYS_VM_COMMITLIMIT_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_COMMITLIMIT_KB_WHITESPACE)
-vmon_datum_ulong(		commitlimit_kb,		SYS_VM_COMMITLIMIT_KB,			"CommitLimit",		"Commit limit")
-vmon_omit_literal(" kB\n",				SYS_VM_COMMITLIMIT_KB_UNIT_NL)
-vmon_omit_literal("Committed_AS:",			SYS_VM_COMMITTED_AS_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_COMMITTED_AS_KB_WHITESPACE)
-vmon_datum_ulong(		commited_as_kb,		SYS_VM_COMMITTED_AS_KB,			"Commited_AS",		"Commited address space? TODO ")
-vmon_omit_literal(" kB\n",				SYS_VM_COMMITTED_AS_KB_UNIT_NL)
-vmon_omit_literal("VmallocTotal:",			SYS_VM_VMALLOC_TOTAL_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_VMALLOC_KB_WHITESPACE)
-vmon_datum_ulong(		vmalloctotal_kb,	SYS_VM_VMALLOC_TOTAL_KB,		"VmallocTotal",		"Vmalloc total")
-vmon_omit_literal(" kB\n",				SYS_VM_VMALLOC_TOTAL_KB_UNIT_NL)
-vmon_omit_literal("VmallocUsed:",			SYS_VM_VMALLOC_USED_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_VMALLOC_USED_KB_WHITESPACE)
-vmon_datum_ulong(		vmallocused_kb,		SYS_VM_VMALLOC_USED_KB,			"VmallocUsed",		"Vmalloc used")
-vmon_omit_literal(" kB\n",				SYS_VM_VMALLOC_USED_KB_UNIT_NL)
-vmon_omit_literal("VmallocChunk:",			SYS_VM_VMALLOC_CHUNK_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_VMALLOC_CHUNK_KB_WHITESPACE)
-vmon_datum_ulong(		vmallocchunk_kb,	SYS_VM_VMALLOC_CHUNK_KB,		"VmallocChunk",		"Vmalloc chunk")
-vmon_omit_literal(" kB\n",				SYS_VM_VMALLOC_CHUNK_KB_UNIT_NL)
-vmon_omit_literal("HugePages_Total:",			SYS_VM_HUGEPAGES_TOTAL_LABEL)
-vmon_omit_run(' ',					SYS_VM_HUGEPAGES_TOTAL_WHITESPACE)
-vmon_datum_ulong(		hugepages_total,	SYS_VM_HUGEPAGES_TOTAL,			"HugePages_Total",	"HugePages total")
-vmon_omit_literal("\n",					SYS_VM_HUGEPAGES_TOTAL_NL)
-vmon_omit_literal("HugePages_Free:",			SYS_VM_HUGEPAGES_FREE_LABEL)
-vmon_omit_run(' ',					SYS_VM_HUGEPAGES_FREE_WHITESPACE)
-vmon_datum_ulong(		hugepages_free,		SYS_VM_HUGEPAGES_FREE,			"HugePages_Free",	"HugePages free")
-vmon_omit_literal("\n",					SYS_VM_HUGEPAGES_FREE_NL)
-vmon_omit_literal("HugePages_Rsvd:",			SYS_VM_HUGEPAGES_RESERVED_LABEL)
-vmon_omit_run(' ',					SYS_VM_HUGEPAGES_RESERVED_WHITESPACE)
-vmon_datum_ulong(		hugepages_reserved,	SYS_VM_HUGEPAGES_RESERVED,		"HugePages_Rsvd",	"HugePages reserved")
-vmon_omit_literal("\n",					SYS_VM_HUGEPAGES_RESERVED_UNIT_NL)
-vmon_omit_literal("HugePages_Surp:",			SYS_VM_HUGEPAGES_SURPLUS_LABEL)
-vmon_omit_run(' ',					SYS_VM_HUGEPAGES_SURPLUS_WHITESPACE)
-vmon_datum_ulong(		hugepages_surplus,	SYS_VM_HUGEPAGES_SURPLUS,		"HugePages_Surp",	"HugePages surplus")
-vmon_omit_literal("\n",					SYS_VM_HUGEPAGES_SURPLUS_NL)
-vmon_omit_literal("Hugepagesize:",			SYS_VM_HUGEPAGE_SIZE_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_HUGEPAGE_SIZE_KB_WHITESPACE)
-vmon_datum_ulong(		hugepage_size_kb,	SYS_VM_HUGEPAGE_SIZE_KB,		"HugePage_Size",	"HugePage page size")
-vmon_omit_literal(" kB\n",				SYS_VM_HUGEPAGE_SIZE_KB_UNIT_NL)
-vmon_omit_literal("DirectMap4k:",			SYS_VM_DIRECTMAP_4K_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_DIRECTMAP_4K_KB_WHITESPACE)
-vmon_datum_ulong(		directmap4k_kb,		SYS_VM_DIRECTMAP_4K_KB,			"DirectMap4k",		"DirectMap 4K")
-vmon_omit_literal(" kB\n",				SYS_VM_DIRECTMAP_4K_KB_UNIT_NL)
-vmon_omit_literal("DirectMap4M:",			SYS_VM_DIRECTMAP_4M_KB_LABEL)
-vmon_omit_run(' ',					SYS_VM_DIRECTMAP_4M_KB_WHITESPACE)
-vmon_datum_ulong(		directmap2m_kb,		SYS_VM_DIRECTMAP_4M_KB,			"DirectMap4M",		"DirectMap 4M")
-vmon_omit_literal(" kB\n",				SYS_VM_DIRECTMAP_4M_KB_UNIT_NL)
-
-/* TODO: /proc/vmstat */
-
-#include "_end.def"
-- 
cgit v1.2.3

