📄 mptrace.1
字号:
.\" mpatrol.\" A library for controlling and tracing dynamic memory allocations..\" Copyright (C) 1997-2002 Graeme S. Roy <graeme.roy@analog.com>.\".\" This library is free software; you can redistribute it and/or.\" modify it under the terms of the GNU Library General Public.\" License as published by the Free Software Foundation; either.\" version 2 of the License, or (at your option) any later version..\".\" This library is distributed in the hope that it will be useful,.\" but WITHOUT ANY WARRANTY; without even the implied warranty of.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU.\" Library General Public License for more details..\".\" You should have received a copy of the GNU Library General Public.\" License along with this library; if not, write to the Free.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,.\" MA 02111-1307, USA..\".\" UNIX Manual Page.\".\" $Id: mptrace.1,v 1.13 2002/01/08 20:28:41 graeme Exp $.\".TH MPTRACE 1 "8 January 2002" "Release 1.4" "mpatrol library".SH NAMEmptrace \- displays tracing information produced by the mpatrol library.SH SYNOPSIS\fBmptrace\fP [\fIoptions\fP] [\fIfile\fP].SH DESCRIPTIONThe \fBmptrace\fP command is a tool designed to read a tracing output fileproduced by the mpatrol library and display the tracing information that wasobtained. The tracing information is a concise encoded trace of all of thememory allocation events that occurred during a program's execution, and can bedecoded into tabular or graphical form, along with any relevant statistics thatcan be calculated..PPWhen the \fBTRACE\fP option is used with the mpatrol library, statistics for alldynamic memory allocations, reallocations and deallocations are written to atracing output file. The name of this file can be changed with the\fBTRACEFILE\fP option..PPOnly allocations, reallocations and deallocations are recorded. The intentionof tracing is to gather concise details about each memory allocation eventrather than complete information about some or all memory allocations. As aresult, the mpatrol log files and profiling output files contain more detailedinformation about individual memory allocations, whereas the tracing outputfiles contain a broader view of allocation behaviour throughout the entireprogram..PPThe \fIfile\fP argument must be a valid mpatrol tracing output filename but if\fIfile\fP is omitted then \fBmptrace\fP will use \fImpatrol.trace\fP as thename of the tracing output file to use. If \fIfile\fP is given as \fI\-\fP thenthe standard input file stream will be used as the tracing output file..PPA C source file containing a trace-driven memory allocation simulation programcan be written with the \fB\-\-sim\-file\fP option. This program will have theidentical memory allocation behaviour to the program which produced the originaltrace file. This option can be useful to use if you wish to determine whichmalloc library is most suitable to use for a specific application..PPA trace file in Heap Allocation Trace Format (HATF) can also be written out bythe \fBmptrace\fP command by using the \fB\-\-hatf\-file\fP option. It takesthe name of the HATF trace file to be written as an argument and writes out theHATF version of the mpatrol tracing output file given as input when it is beingprocessed. The HATF file format is an attempt to standardise trace file formatsfor memory allocation tracing, and is being developed by Benjamin Zorn andRichard Jones. There is a HATF DTD located in the \fIextra\fP directory in thempatrol distribution..PPThe \fBmptrace\fP command will normally be built with GUI support on UNIXplatforms that are running X Windows. This means that a graphical memory mapdisplay of the heap will be shown in a window every time \fBmptrace\fP is runwith the \fB\-\-gui\fP option. This display is updated every time a new eventis read from the tracing output file and by default uses the colour red forinternal heap memory (used by the mpatrol library), blue for unallocated heapmemory, black for allocated memory and white for free memory. Options exist tochange this colour scheme, as well as the dimensions of the drawing area and thewindow..PPBy default, it is assumed that the start address of the first event that appearsin the tracing output file is the base address of the memory map displayed inthe window. If the heap grows downwards then this assumption will be incorrect(since nothing will be displayed) and so the \fB\-\-base\fP option must be usedto specify a reasonable lower bound for the final memory map. In addition, thevisible address space displayed in the memory map is fixed to a certain size (4megabytes by default), but this can be changed with the \fB\-\-space\fP option.A small delay can also be added after drawing each memory allocation eventthrough the use of the \fB\-\-delay\fP option..PPNote that any options that are specific to the GUI version of \fBmptrace\fP areread by the X command line parser rather than directly by \fBmptrace\fP. As aresult they are parsed according to X toolkit rules and do not appear in thequick-reference option summary produced by the \fB\-\-help\fP option. Theapplication class for setting \fBmptrace\fP X resources is called \fIMPTrace\fP..PPThe idea for graphically displaying a memory map of the heap comes from the\fBxmem\fP tool supplied with the University of Toronto Computer SystemsResearch Institute malloc library, written by Mark Moraes. However, thedocumentation for that tool remarks that it was written as a quick and dirtyhack. The \fBmptrace\fP command is hopefully more stable and contains a lotmore functionality..SH OPTIONS.TP\fB\-\-gui\fP [\fB\-w\fP]Displays the GUI (if supported)..TP\fB\-\-hatf\-file\fP \fIfile\fP [\fB\-H\fP]Specifies that the trace should also be written to a file in Heap AllocationTrace Format (HATF)..TP\fB\-\-help\fP [\fB\-h\fP]Displays a quick-reference option summary..TP\fB\-\-sim\-file\fP \fIfile\fP [\fB\-S\fP]Specifies that a trace-driven memory allocation simulation program written in Cshould be written to a file..TP\fB\-\-source\fP [\fB\-s\fP]Displays source-level information for each event in the tracing table, ifavailable..TP\fB\-\-verbose\fP [\fB\-v\fP]Specifies that the tracing table should be displayed..TP\fB\-\-version\fP [\fB\-V\fP]Displays the version number of the \fBmptrace\fP command..SH GUI OPTIONS.TP\fB\-\-alloc\fP \fIcolour\fPSpecifies the colour to use for displaying allocated memory. The default colouris \fIblack\fP..TP\fB\-\-base\fP \fIaddress\fPSpecifies the base address of the visible address space displayed in the memorymap. The default address is calculated at run-time from the start address ofthe first memory allocation event in the tracing output file..TP\fB\-\-delay\fP \fIlength\fPSpecifies that a small delay of a certain length should be added after drawingeach memory allocation event. The delay does not correspond to a specific unitof time, but experimentation with the length should yield satisfactory results.The default delay is \fI0\fP..TP\fB\-\-free\fP \fIcolour\fPSpecifies the colour to use for displaying free memory. The default colour is\fIwhite\fP..TP\fB\-\-height\fP \fIsize\fPSpecifies the height (in pixels) of the drawing area. The default height is\fI512\fP..TP\fB\-\-internal\fP \fIcolour\fPSpecifies the colour to use for displaying internal heap memory. The defaultcolour is \fIred\fP..TP\fB\-\-space\fP \fIsize\fPSpecifies the size (in megabytes) of the visible address space displayed in thememory map. The default size is \fI4\fP..TP\fB\-\-unalloc\fP \fIcolour\fPSpecifies the colour to use for displaying unallocated heap memory. The defaultcolour is \fIblue\fP..TP\fB\-\-view\-height\fP \fIsize\fPSpecifies the height (in pixels) of the window. The default height is\fI256\fP..TP\fB\-\-view\-width\fP \fIsize\fPSpecifies the width (in pixels) of the window. The default width is \fI256\fP..TP\fB\-\-width\fP \fIsize\fPSpecifies the width (in pixels) of the drawing area. The default width is\fI512\fP..SH SEE ALSO\fBmpatrol\fP(1), \fBmprof\fP(1), \fBmleak\fP(1), \fBmpsym\fP(1),\fBmpedit\fP(1), \fBhexwords\fP(1), \fBX\fP(1), \fBlibmpatrol\fP(3),\fBlibmpalloc\fP(3)..PPThe mpatrol manual and reference card..PPhttp://www.cbmamiga.demon.co.uk/mpatrol/.SH AUTHORGraeme S. Roy <graeme.roy@analog.com>.SH COPYRIGHTCopyright (C) 1997-2002 Graeme S. Roy <graeme.roy@analog.com>.PPThis library is free software; you can redistribute it and/or modify it underthe terms of the GNU Library General Public License as published by the FreeSoftware Foundation; either version 2 of the License, or (at your option) anylater version..PPThis library is distributed in the hope that it will be useful, but WITHOUTANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESSFOR A PARTICULAR PURPOSE. See the GNU Library General Public License for moredetails..PPYou should have received a copy of the GNU Library General Public Licensealong with this library; if not, write to the Free Software Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -