de.uka.ipd.sdq.ByCounter.execution
Class ProtocolCountStructure

java.lang.Object
  extended by de.uka.ipd.sdq.ByCounter.execution.ProtocolCountStructure
Direct Known Subclasses:
ProtocolCountUpdateStructure

public class ProtocolCountStructure
extends java.lang.Object

A container used for all information that is reported by instrumented methods to the CountingResultCollector.

Author:
Martin Krogmann

Changing or adding fields requires additional changes in ByCounter. 1) In insertResultCollectorCall, make sure that the stack is filled correctly before the visitMethodInsn calls to match the changed signature. 2) The directResultWriting method that is inserted into instrumented classes if chosen may need to be adapted as it mostly shares the parameter list of the protocol methods. For this, adapt the methods template in MethodCountClassAdapter and follow the instructions in the javadoc of the template that instruct you to change the asm code that is generated from the template.


Field Summary
 BlockCountingMode blockCountingMode
          Mode in which the instructions have been grouped for counting.
 java.util.ArrayList<java.lang.Integer> blockExecutionSequence
          When execution order recording is enabled, this is a list of integers in which each item represents the execution of a block with the index of that number.
 java.lang.String[] calledMethods
          An array of strings where each element is a method signature.
 java.util.UUID callerID
          This ID is a reference to the calling method.
static boolean COUNTER_PRECISION_INT
          Use integer variables as counters.
static boolean COUNTER_PRECISION_LONG
          Use long variables as counters.
 boolean counterPrecisionLong
          Counter precision
 long executionStart
          Time at which the reporting method started the execution
 boolean inliningSpecified
          Inlining of the method was specified when true.
 long[] methodCallCounts
           
 int[] methodCallCountsInt
          An array of integers where each element represents the number of times, the method was called.
 long[] newArrayCounts
           
 int[] newArrayCountsInt
          The counts for the specific *newarray call.
 java.lang.String[] newArrayDescr
          For array consisting of object types, this is the type descriptor.
 int[] newArrayTypeOrDim
          Depending on the type of the specific *newarray call, this is either a type integer or the dimension for the array.
 long[] opcodeCounts
           
 int[] opcodeCountsInt
          An array of integers where each bytecode instruction is the index for which the value represents the number of calls to a specific instruction.
 java.util.UUID ownID
          This ID is a reference passed to the methods called by the method.
 java.lang.String qualifyingMethodName
          Fully qualified method name.
 java.util.ArrayList<java.lang.Integer> rangeBlockExecutionSequence
          When execution order recording is enabled, this is a list of integers in which each item represents the execution of a range block with the index of that number.
 java.util.UUID requestID
          This is a unique identifier that allows to group CountingResults that result from a common request.
static java.lang.String SIGNATURE_CONSTRUCTOR_INT
          Signature of constructor.
static java.lang.String SIGNATURE_CONSTRUCTOR_LONG
          Signature of constructor.
 
Constructor Summary
ProtocolCountStructure()
          Constructor that only nulls all fields.
ProtocolCountStructure(long executionStart, java.lang.String qualifyingMethodName, int[] opcodeCounts, int[] methodCallCounts, java.lang.String[] calledMethods, int[] newArrayCounts, int[] newArrayTypeOrDim, java.lang.String[] newArrayDescr, java.util.UUID requestID, java.util.UUID ownID, java.util.UUID callerID, boolean inliningSpecified, int blockCountingMode)
          Constructor for integer typed counters.
ProtocolCountStructure(long executionStart, java.lang.String qualifyingMethodName, long[] opcodeCounts, long[] methodCallCounts, java.lang.String[] calledMethods, long[] newArrayCounts, int[] newArrayTypeOrDim, java.lang.String[] newArrayDescr, java.util.UUID requestID, java.util.UUID ownID, java.util.UUID callerID, boolean inliningSpecified, int blockCountingMode)
          Constructor for long typed counters.
 
Method Summary
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIGNATURE_CONSTRUCTOR_INT

public static final java.lang.String SIGNATURE_CONSTRUCTOR_INT
Signature of constructor.

See Also:
Constant Field Values

SIGNATURE_CONSTRUCTOR_LONG

public static final java.lang.String SIGNATURE_CONSTRUCTOR_LONG
Signature of constructor.

See Also:
Constant Field Values

COUNTER_PRECISION_INT

public static final boolean COUNTER_PRECISION_INT
Use integer variables as counters.

See Also:
Constant Field Values

COUNTER_PRECISION_LONG

public static final boolean COUNTER_PRECISION_LONG
Use long variables as counters.

See Also:
Constant Field Values

executionStart

public long executionStart
Time at which the reporting method started the execution


qualifyingMethodName

public java.lang.String qualifyingMethodName
Fully qualified method name.


counterPrecisionLong

public boolean counterPrecisionLong
Counter precision

See Also:
InstrumentationParameters.getCounterPrecision()

opcodeCountsInt

public int[] opcodeCountsInt
An array of integers where each bytecode instruction is the index for which the value represents the number of calls to a specific instruction.


opcodeCounts

public long[] opcodeCounts
See Also:
opcodeCountsInt

methodCallCountsInt

public int[] methodCallCountsInt
An array of integers where each element represents the number of times, the method was called. The index is the same as for calledMethods.


methodCallCounts

public long[] methodCallCounts
See Also:
methodCallCountsInt

calledMethods

public java.lang.String[] calledMethods
An array of strings where each element is a method signature. The index is the same as for methodCallCounts.


newArrayCountsInt

public int[] newArrayCountsInt
The counts for the specific *newarray call. The index is the same as for newArrayTypeOrDim and newArrayDesc.


newArrayCounts

public long[] newArrayCounts
See Also:
newArrayCountsInt

newArrayTypeOrDim

public int[] newArrayTypeOrDim
Depending on the type of the specific *newarray call, this is either a type integer or the dimension for the array. The index is the same as for newArrayCounts and newArrayDesc.


newArrayDescr

public java.lang.String[] newArrayDescr
For array consisting of object types, this is the type descriptor. The index is the same as for newArrayCounts and newArrayTypeOrDim.


requestID

public java.util.UUID requestID
This is a unique identifier that allows to group CountingResults that result from a common request.


ownID

public java.util.UUID ownID
This ID is a reference passed to the methods called by the method.


callerID

public java.util.UUID callerID
This ID is a reference to the calling method.


blockExecutionSequence

public java.util.ArrayList<java.lang.Integer> blockExecutionSequence
When execution order recording is enabled, this is a list of integers in which each item represents the execution of a block with the index of that number.


rangeBlockExecutionSequence

public java.util.ArrayList<java.lang.Integer> rangeBlockExecutionSequence
When execution order recording is enabled, this is a list of integers in which each item represents the execution of a range block with the index of that number.


blockCountingMode

public BlockCountingMode blockCountingMode
Mode in which the instructions have been grouped for counting.


inliningSpecified

public boolean inliningSpecified
Inlining of the method was specified when true.

Constructor Detail

ProtocolCountStructure

public ProtocolCountStructure()
Constructor that only nulls all fields.


ProtocolCountStructure

public ProtocolCountStructure(long executionStart,
                              java.lang.String qualifyingMethodName,
                              int[] opcodeCounts,
                              int[] methodCallCounts,
                              java.lang.String[] calledMethods,
                              int[] newArrayCounts,
                              int[] newArrayTypeOrDim,
                              java.lang.String[] newArrayDescr,
                              java.util.UUID requestID,
                              java.util.UUID ownID,
                              java.util.UUID callerID,
                              boolean inliningSpecified,
                              int blockCountingMode)
Constructor for integer typed counters.

Parameters:
executionStart - executionStart
qualifyingMethodName - qualifyingMethodName
opcodeCounts - opcodeCountsInt
methodCallCounts - methodCallCountsInt
calledMethods - calledMethods
newArrayCounts - newArrayCountsInt
newArrayTypeOrDim - newArrayTypeOrDim
newArrayDescr - newArrayDescr
requestID - requestID
ownID - ownID
callerID - callerID
inliningSpecified - inliningSpecified
blockCountingMode - blockCountingMode

ProtocolCountStructure

public ProtocolCountStructure(long executionStart,
                              java.lang.String qualifyingMethodName,
                              long[] opcodeCounts,
                              long[] methodCallCounts,
                              java.lang.String[] calledMethods,
                              long[] newArrayCounts,
                              int[] newArrayTypeOrDim,
                              java.lang.String[] newArrayDescr,
                              java.util.UUID requestID,
                              java.util.UUID ownID,
                              java.util.UUID callerID,
                              boolean inliningSpecified,
                              int blockCountingMode)
Constructor for long typed counters.

Parameters:
executionStart - executionStart
qualifyingMethodName - qualifyingMethodName
opcodeCounts - opcodeCountsInt
methodCallCounts - methodCallCountsInt
calledMethods - calledMethods
newArrayCounts - newArrayCountsInt
newArrayTypeOrDim - newArrayTypeOrDim
newArrayDescr - newArrayDescr
requestID - requestID
ownID - ownID
callerID - callerID
inliningSpecified - inliningSpecified
blockCountingMode - blockCountingMode
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object