- java.lang.Object
-
- com.ibm.jvm.format.TraceRecord
-
- All Implemented Interfaces:
Comparable
- Direct Known Subclasses:
TraceRecordExternal,TraceRecordInternal
public class TraceRecord extends Object implements Comparable
The Trace Record corresponds to a runtime Trace Buffer, it is responsible for formatting individual trace entries.
-
-
Field Summary
Fields Modifier and Type Field Description protected static byteAPP_TYPEprotected static byteASSERT_TYPEprotected static StringBufferBASE_INDENTprotected byte[]bufferprotected intbufferSizeprotected static String[]Charsprotected byte[]currentBufferprotected intcurrentLengthprotected intcurrentOffsetprotected BigIntegercurrentTimeStampprotected intcurrentTraceIDprotected static byteDEBUG_EXCPT_TYPEprotected static byteDEBUG_TYPEprotected static byteENTRY_EXCPT_TYPEprotected static byteENTRY_TYPEprotected static byteERROR_TYPEprotected static byteEVENT_TYPEprotected static byteEXCEPTION_TYPEprotected static byteEXIT_EXCPT_TYPEprotected static byteEXIT_TYPEprotected intheaderSizeprotected static HashtableindentLevelsprotected static longlastThreadprotected StacklongEntryTraceIDsprotected static byteMEM_EXCPT_TYPEprotected static byteMEM_TYPEprotected byte[]nextEightprotected longnextEntryprotected booleannotFormattedprotected intoffsetprotected static bytePERF_EXCPT_TYPEprotected static bytePERF_TYPEprotected booleanrecordFinishedprotected longstartprotected static StringTABprotected longthreadIDprotected StringthreadNameprotected longthreadSyn1protected longthreadSyn2protected BigIntegertimeStampprotected static intTIMESTAMP_OFFSETprotected TraceFiletraceFileprotected static intTRACEID_OFFSETprotected TraceThreadtraceThreadprotected static String[]typesprotected BigIntegerupperWordprotected BigIntegerwrapTimeprotected StackwrapTimesprotected BigIntegerwritePlatformprotected BigIntegerwriteSystem
-
Constructor Summary
Constructors Modifier Constructor Description protectedTraceRecord(TraceFile traceFile, long start)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object other)compares this TraceRecord to another based on the time stamp.protected StringformatCurrentEntry()return: the formatted trace entry.protected BigIntegergetCurrentTimeStamp()returns the latest time stamp read so farprotected static StringBuffergetIndent(String threadID, boolean doIndent)sets the indent associated with a given thread idprotected intgetNextEntry()protected TraceRecordgetNextRecord()returns the latest time stamp read so farprotected static voidinitStatics()Initializes static variables.protected voidprime()protected intprocessNextEntryHeader(byte[] entry, int start)sets up current* fields for later formattingprotected voidrelease()release the record data for this TraceRecord so GC can do it's stuffprotected static voidsetIndent(String threadID, StringBuffer buffer)sets the indent associated with a given thread id
-
-
-
Field Detail
-
indentLevels
protected static Hashtable indentLevels
-
lastThread
protected static long lastThread
-
EVENT_TYPE
protected static final byte EVENT_TYPE
- See Also:
- Constant Field Values
-
EXCEPTION_TYPE
protected static final byte EXCEPTION_TYPE
- See Also:
- Constant Field Values
-
ENTRY_TYPE
protected static final byte ENTRY_TYPE
- See Also:
- Constant Field Values
-
ENTRY_EXCPT_TYPE
protected static final byte ENTRY_EXCPT_TYPE
- See Also:
- Constant Field Values
-
EXIT_TYPE
protected static final byte EXIT_TYPE
- See Also:
- Constant Field Values
-
EXIT_EXCPT_TYPE
protected static final byte EXIT_EXCPT_TYPE
- See Also:
- Constant Field Values
-
MEM_TYPE
protected static final byte MEM_TYPE
- See Also:
- Constant Field Values
-
MEM_EXCPT_TYPE
protected static final byte MEM_EXCPT_TYPE
- See Also:
- Constant Field Values
-
DEBUG_TYPE
protected static final byte DEBUG_TYPE
- See Also:
- Constant Field Values
-
DEBUG_EXCPT_TYPE
protected static final byte DEBUG_EXCPT_TYPE
- See Also:
- Constant Field Values
-
PERF_TYPE
protected static final byte PERF_TYPE
- See Also:
- Constant Field Values
-
PERF_EXCPT_TYPE
protected static final byte PERF_EXCPT_TYPE
- See Also:
- Constant Field Values
-
ASSERT_TYPE
protected static final byte ASSERT_TYPE
- See Also:
- Constant Field Values
-
APP_TYPE
protected static final byte APP_TYPE
- See Also:
- Constant Field Values
-
ERROR_TYPE
protected static final byte ERROR_TYPE
- See Also:
- Constant Field Values
-
Chars
protected static final String[] Chars
-
types
protected static final String[] types
-
BASE_INDENT
protected static final StringBuffer BASE_INDENT
-
TAB
protected static final String TAB
- See Also:
- Constant Field Values
-
TRACEID_OFFSET
protected static final int TRACEID_OFFSET
- See Also:
- Constant Field Values
-
TIMESTAMP_OFFSET
protected static final int TIMESTAMP_OFFSET
- See Also:
- Constant Field Values
-
buffer
protected byte[] buffer
-
nextEight
protected byte[] nextEight
-
timeStamp
protected BigInteger timeStamp
-
wrapTime
protected BigInteger wrapTime
-
writePlatform
protected BigInteger writePlatform
-
writeSystem
protected BigInteger writeSystem
-
threadID
protected long threadID
-
threadSyn1
protected long threadSyn1
-
threadSyn2
protected long threadSyn2
-
threadName
protected String threadName
-
nextEntry
protected long nextEntry
-
recordFinished
protected boolean recordFinished
-
traceThread
protected TraceThread traceThread
-
traceFile
protected TraceFile traceFile
-
bufferSize
protected int bufferSize
-
start
protected long start
-
offset
protected int offset
-
currentBuffer
protected byte[] currentBuffer
-
currentOffset
protected int currentOffset
-
currentTraceID
protected int currentTraceID
-
currentLength
protected int currentLength
-
currentTimeStamp
protected BigInteger currentTimeStamp
-
upperWord
protected BigInteger upperWord
-
wrapTimes
protected Stack wrapTimes
-
longEntryTraceIDs
protected Stack longEntryTraceIDs
-
notFormatted
protected boolean notFormatted
-
headerSize
protected int headerSize
-
-
Constructor Detail
-
TraceRecord
protected TraceRecord(TraceFile traceFile, long start) throws IOException
- Throws:
IOException
-
-
Method Detail
-
initStatics
protected static final void initStatics()
Initializes static variables.This is called each time the TraceFormatter is started, from the initStatics() method in TraceFormat.java
-
getCurrentTimeStamp
protected final BigInteger getCurrentTimeStamp()
returns the latest time stamp read so far- Parameters:
info-- Returns:
- a biginteger that is that timestamp
-
getNextRecord
protected final TraceRecord getNextRecord()
returns the latest time stamp read so far- Parameters:
info-- Returns:
- a biginteger that is that timestamp
-
processNextEntryHeader
protected final int processNextEntryHeader(byte[] entry, int start) throws IOExceptionsets up current* fields for later formatting- Throws:
IOException
-
formatCurrentEntry
protected final String formatCurrentEntry() throws IOException
return: the formatted trace entry.- Throws:
IOException
-
release
protected final void release()
release the record data for this TraceRecord so GC can do it's stuff
-
compareTo
public final int compareTo(Object other)
compares this TraceRecord to another based on the time stamp.- Specified by:
compareToin interfaceComparable- Parameters:
other- the object to be compared.- Returns:
- an int which is negative if this entry is older than other, 0, if they are the same age, and positive if this is newer
-
getIndent
protected static final StringBuffer getIndent(String threadID, boolean doIndent)
sets the indent associated with a given thread id- Parameters:
threadid- a string that is the id of the thread which is to be indented- Returns:
- a stringbuffer of spaces that is the amount to indent the entry associates with the specified thread id
-
setIndent
protected static final void setIndent(String threadID, StringBuffer buffer)
sets the indent associated with a given thread id- Parameters:
threadid- a string that is the id of the thread which is to have its indent level setbuffer- a stringbuffer of spaces that is the amount to indent the entries associates with the specified thread id
-
prime
protected void prime() throws IOException- Throws:
IOException
-
getNextEntry
protected int getNextEntry() throws IOException- Throws:
IOException
-
-