SandMark version 2.0


sandmark.watermark.ct.embed
Class PrepareTrace

java.lang.Object
  |
  +--sandmark.watermark.ct.embed.PrepareTrace

public class PrepareTrace
extends java.lang.Object


Nested Class Summary
(package private) static class PrepareTrace.TraceLocation
           
 
Constructor Summary
PrepareTrace()
           
 
Method Summary
static EmbedData[] allocate(TracePoint[] traceData, MethodID[] methods)
          Allocate the code fragments among the trace points.
(package private) static MethodID[][] distribute(MethodID[] flist, int n)
          Distributes a set of code fragments among insertion points.
static void main(java.lang.String[] args)
           
(package private) static void test(java.util.Properties props, java.lang.String header, TracePoint[] tracePoints, MethodID[] creators)
           
(package private) static TracePoint TP(java.lang.String value, java.lang.String callerName, java.lang.String callerLocation, int bytecodeLoc, int lineNumber)
           
(package private) static PrepareTrace.TraceLocation[] uniquify(TracePoint[] traceData)
          The LOCATION/VALUE flags are determined by looking at all the traces that come from the same location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrepareTrace

public PrepareTrace()
Method Detail

distribute

static MethodID[][] distribute(MethodID[] flist,
                               int n)
Distributes a set of code fragments among insertion points. Produces a list of lists, with one sublist for each insertion point.

Parameters:
flist - code fragment list
n - number of insertion points This method needs to be more random. It seems like the first trace point is always picked, for example.

uniquify

static PrepareTrace.TraceLocation[] uniquify(TracePoint[] traceData)
The LOCATION/VALUE flags are determined by looking at all the traces that come from the same location. If there's just one trace at a location, it's LOCATION based. If there's more than one, it's VALUE based. But if there are any duplicate values at a location, the location is discarded and not used as a trace point. Any location that has multiple identical values should be discarded. All values at a location should be unique or else that location should be discarded. (1) Insert all trace points into a table indexed by sandmark.util.ByteCodeLocation. Each entry is a list of the trace points generated at that location. 'table' is a Hashtable that maps the source location of a trace event (sandmark.util.ByteCodeLocation) to a list of the trace events that happened at that location (sandmark.watermark.ct.trace.TracePoint). (2) Walk 'table' and determine for each source location whether (a) there are multiple identical trace values at this location (in which case it should be discarded), or (b) there is exactly one trace point at this location (in which case it's a LOCATION trace point), or (c) there are multiple unique values at this source location (in which case it's a VALUE trace point). (3) Return an array of those tracepoints which have been determined to be unique.


allocate

public static EmbedData[] allocate(TracePoint[] traceData,
                                   MethodID[] methods)
                            throws java.lang.Exception
Allocate the code fragments among the trace points. Returns an array of EmbedData objects, each of which maps a TracePoint object to a list of method names. These methods should be inserted at the point in the code that TracePoint references.

Parameters:
traceData - annotation points hit during tracing
methods - array of methods to insert
java.lang.Exception

test

static void test(java.util.Properties props,
                 java.lang.String header,
                 TracePoint[] tracePoints,
                 MethodID[] creators)
          throws java.lang.Exception
java.lang.Exception

TP

static TracePoint TP(java.lang.String value,
                     java.lang.String callerName,
                     java.lang.String callerLocation,
                     int bytecodeLoc,
                     int lineNumber)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exception

SandMark version 2.0

Mon Jun 17 12:30:47 MST 2002