|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensolaris.os.dtrace.UserStackRecord
public final class UserStackRecord
A value generated by the DTrace ustack()
or jstack()
action.
Immutable. Supports persistence using XMLEncoder
.
Constructor Summary | |
---|---|
UserStackRecord(int pid,
StackFrame[] frames,
byte[] rawBytes)
Creates a UserStackRecord with the given stack frames,
user process ID, and raw stack data. |
Method Summary | |
---|---|
KernelStackRecord |
asKernelStackRecord()
Gets a KernelStackRecord view of this record. |
java.util.List<StackFrame> |
asList()
Gets a read-only List view of this record's stack frames. |
int |
compareTo(UserStackRecord r)
Compares this record with the given UserStackRecord . |
boolean |
equals(java.lang.Object o)
Compares the specified object with this UserStackRecord
for equality. |
int |
getProcessID()
Gets the process ID associated with this record's user stack. |
byte[] |
getRawStackData()
Gets the native DTrace representation of this record's stack as an array of raw bytes. |
StackFrame[] |
getStackFrames()
Gets a copy of this record's stack frames, or an empty array if this record's raw stack data was not converted to human-readable stack frames by DTrace. |
java.lang.Object |
getValue()
Gets the raw bytes used to represent this record's stack value in the native DTrace library. |
int |
hashCode()
Overridden to ensure that equal instances have equal hash codes. |
java.lang.String |
toString()
Gets the string
representation of the view returned by asKernelStackRecord() preceded by the user process ID on its
own line. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UserStackRecord(int pid, StackFrame[] frames, byte[] rawBytes)
UserStackRecord
with the given stack frames,
user process ID, and raw stack data. Supports XML persistence.
frames
- array of human-readable stack frames, copied so
that later modifying the given frames array will not affect this
UserStackRecord
; may be null
or empty to indicate
that the raw stack data was not converted to human-readable stack
frames (see StackValueRecord.getStackFrames()
)pid
- non-negative user process IDrawBytes
- array of raw bytes used to represent this stack
value in the native DTrace library, needed to distinguish stacks
that have the same display value but are considered distinct by
DTrace; copied so that later modifying the given array will not
affect this UserStackRecord
java.lang.NullPointerException
- if the given array of raw bytes is
null
or if any element of the frames
array is
null
java.lang.IllegalArgumentException
- if the given process ID is
negativeMethod Detail |
---|
public StackFrame[] getStackFrames()
StackValueRecord
printa()
format string is specified without including the %k
placeholder for the stack value represented by this record.
(The stack()
, ustack()
, and jstack()
actions are all usable as members of an aggregation tuple.) See
the
printa()
section of the Output
Formatting chapter of the Solaris Dynamic Tracing
Guide for details about printa()
format strings.
Human-readable stack frames are generated by default if printa()
is called without specifying a format string, or when
using Consumer.getAggregate()
as an alternative to printa()
. They are also generated when stack()
, ustack()
, or jstack()
is used as a stand-alone action
outside of an aggregation tuple.
The returned array is a copy and modifying it has no effect on
this record. Elements of the returned array are not null
.
getStackFrames
in interface StackValueRecord
null
public byte[] getRawStackData()
equals()
and compareTo()
to test equality and
to determine the natural ordering of user stack records.
getRawStackData
in interface StackValueRecord
public java.lang.Object getValue()
toString()
.
getValue
in interface StackValueRecord
getValue
in interface ValueRecord
getRawStackData()
public int getProcessID()
public java.util.List<StackFrame> asList()
StackValueRecord
List
view of this record's stack frames.
The returned list implements RandomAccess
. It
is empty if StackValueRecord.getStackFrames()
returns an empty array.
asList
in interface StackValueRecord
List
view of this record's
stack framespublic KernelStackRecord asKernelStackRecord()
KernelStackRecord
view of this record.
KernelStackRecord
view of this recordpublic boolean equals(java.lang.Object o)
UserStackRecord
for equality. Returns true
if and only if the specified
object is also a UserStackRecord
and both stacks have the
same raw stack data (including process ID).
This implementation first checks if the specified object is this
UserStackRecord
. If so, it returns true
.
equals
in class java.lang.Object
true
if and only if the specified object is also
a UserStackRecord
and both stacks have the same raw stack
data (including process ID)public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(UserStackRecord r)
UserStackRecord
.
Compares the first unequal pair of bytes at the same index in
each record's raw stack data, or if all corresponding bytes are
equal, compares the length of each record's array of raw stack
data. Corresponding bytes are compared as unsigned values. The
compareTo()
method is compatible with equals()
.
This implementation first checks if the specified object is this
UserStackRecord
. If so, it returns 0
.
compareTo
in interface java.lang.Comparable<UserStackRecord>
public java.lang.String toString()
string
representation
of the view returned by asKernelStackRecord()
preceded by the user process ID on its
own line. The process ID is in the format process ID:
pid
(where pid is a decimal integer) and is indented by
the same number of spaces as the stack frames. The exact format
is subject to change.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |