forsyth20121205-174063a80cc13 years agoHistory
173 lines · 4.0 KB · Text
RawDownload
.TH MPROF 1.SH NAMEmprof, wm/mprof \- memory profiling limbo programs.SH SYNOPSIS.B mprof[.B -bcMflnve123] [.BI -m " modname"] ... [.BI "cmd arg ..."].PP.B wm/mprof[.B -e12] [.BI -m " modname"] ... [.BI "cmd arg ..."].PP.SH DESCRIPTION.I Mprofis a simple memory profiling tool which calculates the amount of main, heap and image memoryused on a particular line of limbo source or in a particular limbo function or module. The main memoryin question covers the space taken by dis code, jit code, runtime stacks and dynamic C module text, data and relocation areas. The heap memory covers all other limbo data structures. The source inquestion should be compiled with the .B -gflag so that the relevant symbol table files exist. In its simplest form, the memoryprofiler shows a line number, the current memory in bytes allocatedwhen executing this line, the high water memory in bytes allocated when executingthis line and the limbo source. This information is also available at the function andmodule level..PPThe tk version of the profiler.I wm/mprofshows this information in a text widget and colours the lines of source accordingto the amount of memory allocated by the line. The darker the colour, themore memory used..PPThe.B -boption starts profiling..PPThe.B -coption clears all profiling statistics and state in the memory profiling device. If any commands are specified to.B mprof, this is done automatically. It's specificuse is to end the accumulation of statistics when profiling interactively. See theexample below..PPThe.B -Moption shows the memory statistics for each moduleThe.B -foption shows the memory statistics for each function..PPThe.B -loption shows the memory statistics for each line. If neither this option nor the.B -Mand.B -foptions are given, .B -Mand.B -lare assumed..PPThe.B -noption lists the name of the file along with the line number..PPThe.B -voption outputs all functions and/or lines even when they do not involve memoryallocating or freeing operations..PPThe.B -moption lists the module names which are to be profiled. If none are given, all themodules loaded by the kernel will be profiled. The name may be the actual name ofthe module or its path name..PPThe.B -eoption profiles the module that is loaded first in any following command. In this casethere is no need to give a.B -moption as this is added automatically..PPThe.B -1option profiles only main memory (pool number 1 in the kernel). The default isto profile main, heap and image memory..PPThe.B -2option profiles only heap memory (pool number 2 in the kernel). The default isto profile main, heap and image memory..PPThe.B -3option profiles only image memory (pool number 3 in the kernel). The default isto profile main, heap and image memory..PPAny remaining arguments are assumed tospecify a command and set of arguments to the command. If this is the case,.B mprofwill automatically start profiling, run the command to completion and thenstop profiling before showing the profile statistics..PP.B Mprofdisplays the profile statistics (unless the.B -boption is being used) according to the output format required..PP.SH EXAMPLE.EXTo profile a particular command	mprof /dis/math/parts 10000	wm/mprof /dis/math/parts 10000To profile the same command but restrict attention to its own module (Partitions).	mprof -m Partitions /dis/math/parts 10000	wm/mprof -m Partitions /dis/math/parts 10000A shorter version of the above	mprof -e /dis/math/parts 10000	wm/mprof -e /dis/math/parts 10000To profile interactively	mprof -b -m Polyhedra	wm/polyhedra &	mprof -M -f -l -n	<interact with wm/polyhedra ...>	mprof -M -f -l -n	wm/mprof	mprof -c.EE.PPNote that the output format options (.B -M,.B -f, .B -l, .B -n, .B -v) are ignored when .B -bis present..SH SOURCE.B /appl/cmd/mprof.b.PP.B /appl/wm/mprof.b.SH BUGSCan take quite a time to present statistics when profiling all modules in thesystem..SH SEE ALSO.IR cprof (1),.IR cprof (1),.IR prof (2),.IR prof (3)