vmstate.c revision 1
1N/A/*********************************************************************** 1N/A* This software is part of the ast package * 1N/A* Copyright (c) 1992-2011 AT&T Intellectual Property * 1N/A* and is licensed under the * 1N/A* Common Public License, Version 1.0 * 1N/A* by AT&T Intellectual Property * 1N/A* A copy of the License is available at * 1N/A* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 1N/A* Information and Software Systems Research * 1N/A* Glenn Fowler <gsf@research.att.com> * 1N/A* David Korn <dgk@research.att.com> * 1N/A***********************************************************************/ 1N/A#
define FORMAT "region=%(region)p method=%(method)s flags=%(flags)s size=%(size)d segments=%(segments)d busy=(%(busy_size)d,%(busy_blocks)d,%(busy_max)d) free=(%(free_size)d,%(free_blocks)d,%(free_max)d)" 1N/A"[-?\n@(#)$Id: vmstate (AT&T Research) 2010-04-08 $\n]" 1N/A"[+NAME?vmstate - list the calling process vmalloc region state]" 1N/A"[+DESCRIPTION?When invoked as a shell builtin, \bvmstate\b lists the " 1N/A "calling process \bvmalloc\b(3) state for all regions.]" 1N/A"[f:format?List the ids specified by \aformat\a. \aformat\a follows " 1N/A "\bprintf\b(3) conventions, except that \bsfio\b(3) inline ids are used " 1N/A "instead of arguments: " 1N/A "%[-+]][\awidth\a[.\aprecis\a[.\abase\a]]]]]](\aid\a)\achar\a. The " 1N/A "supported \aid\as are:]:[format:=" FORMAT "]" 1N/A "[+method?The vmalloc method name.]" 1N/A "[+flags?The vmalloc method flags.]" 1N/A "[+size?The total region size.]" 1N/A "[+segments?The number of segments in the region.]" 1N/A "[+busy_size?The total busy block size.]" 1N/A "[+busy_blocks?The number of busy blocks.]" 1N/A "[+busy_max?The maximum busy block size.]" 1N/A "[+free_size?The total free block size.]" 1N/A "[+free_blocks?The number of free blocks.]" 1N/A "[+free_max?The maximum free block size.]" 1N/A"[+SEE ALSO?\bvmalloc\b(3)]" 1N/A * sfkeyprintf() lookup 1N/A * handle==0 for heading 1N/A error(
2,
"%s: unknown format identifier", s);
1N/A * the walk must do no allocations because it locks the regions 1N/A * now we can compute and list the state of each region