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

java.lang.Object
  extended by de.uka.ipd.sdq.ByCounter.execution.BlockResultCalculation

public class BlockResultCalculation
extends java.lang.Object

Class class provides functions to calculate counting results for instrumentation results based on range block or basic block definitions.

Author:
Martin Krogmann

Constructor Summary
BlockResultCalculation(BlockDefinitionContext blockContext)
          New BlockResultCalculation context.
 
Method Summary
 CalculatedCounts calculateCountsFromBBCounts(java.lang.String qualifyingMethodName, long[] basicBlockExecutionCounts, long[] prevOpcodeCounts, java.util.SortedMap<java.lang.String,java.lang.Long> prevMethodCallCounts)
          This method uses the execution frequencies of basic blocks and calculates from these the actual opcode counts and method call counts.
 CalculatedCounts[] calculateCountsFromBlockExecutionSequence(ProtocolCountStructure result, boolean calculateRangeBlocks)
          Uses the results blockExecutionSequence to calculate counting results.
 CalculatedCounts[] calculateCountsFromRBCounts(java.lang.String qualifyingMethodName, long[] basicBlockExecutionCounts, long[] prevOpcodeCounts, java.util.SortedMap<java.lang.String,java.lang.Long> prevMethodCallCounts)
          This method uses the execution frequencies of basic blocks and calculates from these the actual opcode counts and method call counts for the specified range blocks.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockResultCalculation

public BlockResultCalculation(BlockDefinitionContext blockContext)
New BlockResultCalculation context.

Method Detail

calculateCountsFromBBCounts

public CalculatedCounts calculateCountsFromBBCounts(java.lang.String qualifyingMethodName,
                                                    long[] basicBlockExecutionCounts,
                                                    long[] prevOpcodeCounts,
                                                    java.util.SortedMap<java.lang.String,java.lang.Long> prevMethodCallCounts)
This method uses the execution frequencies of basic blocks and calculates from these the actual opcode counts and method call counts.

Parameters:
qualifyingMethodName - The descriptor of the method. This is the canonicalClassName + "." + methodName + methodSignatureDescriptor .
basicBlockExecutionCounts - The basic block execution frequencies.
prevOpcodeCounts - This array of opcode counters will be incremented for opcodes in executed basic blocks if calculateIndividualResults is false.
prevMethodCallCounts - This map of method counters will be incremented for method executions in executed basic blocks if calculateIndividualResults is false.

calculateCountsFromRBCounts

public CalculatedCounts[] calculateCountsFromRBCounts(java.lang.String qualifyingMethodName,
                                                      long[] basicBlockExecutionCounts,
                                                      long[] prevOpcodeCounts,
                                                      java.util.SortedMap<java.lang.String,java.lang.Long> prevMethodCallCounts)
This method uses the execution frequencies of basic blocks and calculates from these the actual opcode counts and method call counts for the specified range blocks.

Parameters:
qualifyingMethodName - The descriptor of the method. This is the canonicalClassName + "." + methodName + methodSignatureDescriptor .
basicBlockExecutionCounts - The basic block execution frequencies.
prevOpcodeCounts - This array of opcode counters will be incremented for opcodes in executed basic blocks if calculateIndividualResults is false.
prevMethodCallCounts - This map of method counters will be incremented for method executions in executed basic blocks if calculateIndividualResults is false.

calculateCountsFromBlockExecutionSequence

public CalculatedCounts[] calculateCountsFromBlockExecutionSequence(ProtocolCountStructure result,
                                                                    boolean calculateRangeBlocks)
Uses the results blockExecutionSequence to calculate counting results.

Parameters:
result - Result as reported by an instrumented method.
calculateRangeBlocks - True: range blocks; False: basic blocks
Returns:
CalculatedCounts.