|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Instrumentation.AllocationStatistics.AllocationStatistics
public class AllocationStatistics
AllocationStatistics
reads the output produced by the
allocation instrumentation and offers support for gathering and
displaying statistics about the number of times each allocation
site from an instrumented program was executed.
InstrumentAllocs
Constructor Summary | |
---|---|
AllocationStatistics(AllocationNumberingInterf ani,
String instrumentationResultsFileName)
Create an AllocationStatistics object. |
|
AllocationStatistics(Linker linker,
String allocNumberingFileName,
String instrumentationResultsFileName)
Create a AllocationStatistics . |
Method Summary | |
---|---|
int |
allocID(Quad alloc)
Returns the unique ID for alloc . |
static Collection |
getAllocs(Set methods,
HCodeFactory hcf)
Return a collection of all the allocation sites (quads) from the methods from the set methods . |
long |
getCount(Quad alloc)
Returns the number of times the allocation alloc
was executed. |
long |
getMemAmount(Quad alloc)
Returns the total amount of memory allocated at the allocation alloc . |
static Map |
parseInstrumentationResults(String instrumentationResultsFileName)
Parse the text file produced by an instrumented program. |
void |
printStatistics(Collection allocs)
|
void |
printStatistics(Collection allocs,
QuadVisitor visitor)
Prints statitistics about the allocation sites from the collection allocs . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AllocationStatistics(AllocationNumberingInterf ani, String instrumentationResultsFileName)
AllocationStatistics
object.
ani
- AllocationNumberingInterf
object that
provides the mapping between allocation sites and globally
unique integer IDs.instrumentationResultFileName
- name of the file that
holds the result of the instrumentation: for each unique ID,
the number of times the associated allocation site was
executed and the total amount of memory allocated there.public AllocationStatistics(Linker linker, String allocNumberingFileName, String instrumentationResultsFileName)
AllocationStatistics
.
linker
- Linker
used to load the classes.allocNumberingFileName
- name of the file that stores the
textualized form of the AllocationNumberingStub
(that associates to each allocation site a unique integer ID).instrumentationResultFileName
- name of the file that
holds the result of the instrumentation: for each unique ID,
the number of times the associated allocation site was
executed.Method Detail |
---|
public long getCount(Quad alloc)
alloc
was executed.
alloc
- allocation site
alloc
was executedpublic long getMemAmount(Quad alloc)
alloc
.
alloc
- allocation site
alloc
public int allocID(Quad alloc)
alloc
.
public void printStatistics(Collection allocs, QuadVisitor visitor)
allocs
. If visitor
is
non-null, it is called on each allocation site (this way, one
can customize the displayed statistics). The allocation sites
are listed/visited in the decreasing order of the number of
objects allocated there. Sites that allocate too few objects
(less than 1% of the total objects) are not considered.
public void printStatistics(Collection allocs)
public static Map parseInstrumentationResults(String instrumentationResultsFileName) throws IOException
instrumentationResultsFileName
- name of the file holding the
instrumentation results
IOException
public static Collection getAllocs(Set methods, HCodeFactory hcf)
methods
.
methods
- methods where we look for allocation siteshcf
- code factory that provides the code of the methods
methods
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |