- 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 byte
APP_TYPE
protected static byte
ASSERT_TYPE
protected static StringBuffer
BASE_INDENT
protected byte[]
buffer
protected int
bufferSize
protected static String[]
Chars
protected byte[]
currentBuffer
protected int
currentLength
protected int
currentOffset
protected BigInteger
currentTimeStamp
protected int
currentTraceID
protected static byte
DEBUG_EXCPT_TYPE
protected static byte
DEBUG_TYPE
protected static byte
ENTRY_EXCPT_TYPE
protected static byte
ENTRY_TYPE
protected static byte
ERROR_TYPE
protected static byte
EVENT_TYPE
protected static byte
EXCEPTION_TYPE
protected static byte
EXIT_EXCPT_TYPE
protected static byte
EXIT_TYPE
protected int
headerSize
protected static Hashtable
indentLevels
protected static long
lastThread
protected Stack
longEntryTraceIDs
protected static byte
MEM_EXCPT_TYPE
protected static byte
MEM_TYPE
protected byte[]
nextEight
protected long
nextEntry
protected boolean
notFormatted
protected int
offset
protected static byte
PERF_EXCPT_TYPE
protected static byte
PERF_TYPE
protected boolean
recordFinished
protected long
start
protected static String
TAB
protected long
threadID
protected String
threadName
protected long
threadSyn1
protected long
threadSyn2
protected BigInteger
timeStamp
protected static int
TIMESTAMP_OFFSET
protected TraceFile
traceFile
protected static int
TRACEID_OFFSET
protected TraceThread
traceThread
protected static String[]
types
protected BigInteger
upperWord
protected BigInteger
wrapTime
protected Stack
wrapTimes
protected BigInteger
writePlatform
protected BigInteger
writeSystem
-
Constructor Summary
Constructors Modifier Constructor Description protected
TraceRecord(TraceFile traceFile, long start)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object other)
compares this TraceRecord to another based on the time stamp.protected String
formatCurrentEntry()
return: the formatted trace entry.protected BigInteger
getCurrentTimeStamp()
returns the latest time stamp read so farprotected static StringBuffer
getIndent(String threadID, boolean doIndent)
sets the indent associated with a given thread idprotected int
getNextEntry()
protected TraceRecord
getNextRecord()
returns the latest time stamp read so farprotected static void
initStatics()
Initializes static variables.protected void
prime()
protected int
processNextEntryHeader(byte[] entry, int start)
sets up current* fields for later formattingprotected void
release()
release the record data for this TraceRecord so GC can do it's stuffprotected static void
setIndent(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 IOException
sets 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:
compareTo
in 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
-
-