Package dalvik.system.profiler
Class HprofData
- java.lang.Object
-
- dalvik.system.profiler.HprofData
-
public final class HprofData extends Object
Represents sampling profiler data. Can be converted to ASCII or binary hprof-style output usingAsciiHprofWriterorBinaryHprofWriter.The data includes:
- the start time of the last sampling period
- the history of thread start and end events
- stack traces with frequency counts
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHprofData.SampleA read only container combining a stack trace with its frequency.static classHprofData.StackTraceA unique stack trace for a specific thread.static classHprofData.ThreadEventThreadEvent represents thread creation and death events for reporting.static classHprofData.ThreadEventType
-
Constructor Summary
Constructors Constructor Description HprofData(Map<HprofData.StackTrace,int[]> stackTraces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStackTrace(HprofData.StackTrace stackTrace, int[] countCell)Record an stack trace and an associated int[] cell of sample cound for the stack trace.voidaddThreadEvent(HprofData.ThreadEvent event)Record an event in the thread history.intgetDepth()Get the stack sampling depthintgetFlags()Get theBinaryHprof.ControlSettingsflagsSet<HprofData.Sample>getSamples()Return a new set containing the current sample data.longgetStartMillis()The start time in milliseconds of the last profiling period.List<HprofData.ThreadEvent>getThreadHistory()Return an unmodifiable history of start and end thread events.voidsetDepth(int depth)Set the stack sampling depthvoidsetFlags(int flags)Set theBinaryHprof.ControlSettingsflagsvoidsetStartMillis(long startMillis)Set the time for the start of the current sampling period.
-
-
-
Constructor Detail
-
HprofData
public HprofData(Map<HprofData.StackTrace,int[]> stackTraces)
-
-
Method Detail
-
getStartMillis
public long getStartMillis()
The start time in milliseconds of the last profiling period.
-
setStartMillis
public void setStartMillis(long startMillis)
Set the time for the start of the current sampling period.
-
getFlags
public int getFlags()
Get theBinaryHprof.ControlSettingsflags
-
setFlags
public void setFlags(int flags)
Set theBinaryHprof.ControlSettingsflags
-
getDepth
public int getDepth()
Get the stack sampling depth
-
setDepth
public void setDepth(int depth)
Set the stack sampling depth
-
getThreadHistory
public List<HprofData.ThreadEvent> getThreadHistory()
Return an unmodifiable history of start and end thread events.
-
getSamples
public Set<HprofData.Sample> getSamples()
Return a new set containing the current sample data.
-
addThreadEvent
public void addThreadEvent(HprofData.ThreadEvent event)
Record an event in the thread history.
-
addStackTrace
public void addStackTrace(HprofData.StackTrace stackTrace, int[] countCell)
Record an stack trace and an associated int[] cell of sample cound for the stack trace. The caller is allowed retain a pointer to the cell to update the count. The SamplingProfiler intentionally does not present a mutable view of the count.
-
-