Class TraceRecord

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 Details

    • indentLevels

      protected static Hashtable indentLevels
    • lastThread

      protected static long lastThread
    • EVENT_TYPE

      protected static final byte EVENT_TYPE
      See Also:
    • EXCEPTION_TYPE

      protected static final byte EXCEPTION_TYPE
      See Also:
    • ENTRY_TYPE

      protected static final byte ENTRY_TYPE
      See Also:
    • ENTRY_EXCPT_TYPE

      protected static final byte ENTRY_EXCPT_TYPE
      See Also:
    • EXIT_TYPE

      protected static final byte EXIT_TYPE
      See Also:
    • EXIT_EXCPT_TYPE

      protected static final byte EXIT_EXCPT_TYPE
      See Also:
    • MEM_TYPE

      protected static final byte MEM_TYPE
      See Also:
    • MEM_EXCPT_TYPE

      protected static final byte MEM_EXCPT_TYPE
      See Also:
    • DEBUG_TYPE

      protected static final byte DEBUG_TYPE
      See Also:
    • DEBUG_EXCPT_TYPE

      protected static final byte DEBUG_EXCPT_TYPE
      See Also:
    • PERF_TYPE

      protected static final byte PERF_TYPE
      See Also:
    • PERF_EXCPT_TYPE

      protected static final byte PERF_EXCPT_TYPE
      See Also:
    • ASSERT_TYPE

      protected static final byte ASSERT_TYPE
      See Also:
    • APP_TYPE

      protected static final byte APP_TYPE
      See Also:
    • ERROR_TYPE

      protected static final byte ERROR_TYPE
      See Also:
    • 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:
    • TRACEID_OFFSET

      protected static final int TRACEID_OFFSET
      See Also:
    • TIMESTAMP_OFFSET

      protected static final int TIMESTAMP_OFFSET
      See Also:
    • 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 Details

  • Method Details

    • 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 interface Comparable
      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 set
      buffer - 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