bart.sched.SchedMatrix module

The SchedMatrix provides an ability to compare two executions of benchmarks with multiple processes.

For example, consider a benchmark that spawns 4 identical threads and any two threads should exhibit a certain behaviours and the remaining another identical but different behaviour.

SchedMatrix creates a Matrix of Scheduler Waveform Correlations

A = Reference Execution B = Execution to be Evaluated

           +---+  +---+
           |   |  |   |
A1, B3 +---+   +--+   +--------------+
                      +---+  +---+
                      |   |  |   |
A2, B4 +--------------+   +--+   +---+
           +---+  +---+
           |   |  |   |
A3, B1 +---+   +--+   +--------------+
                      +---+  +---+
                      |   |  |   |
A4, B2 +--------------+   +--+   +---+

Correlation Matrix

         
A1 1 0 1 0
A2 0 1 0 1
A3 1 0 1 0
A4 0 1 0 1

Thus a success criteria can be defined as A1 having two similar threads in the evaluated execution

assertSiblings(A1, 2, operator.eq)
assertSiblings(A2, 2, operator.eq)
assertSiblings(A3, 2, operator.eq)
assertSiblings(A4, 2, operator.eq)
class bart.sched.SchedMatrix.SchedMatrix(reference_trace, trace, topology, execnames, aggfunc=<function csum>)[source]

Bases: object

Parameters:
  • reference_trace (str, trappy.ftrace.FTrace) – The trace file path/ftrace object to be used as a reference
  • trace (str, trappy.ftrace.FTrace) – The trace file path/ftrace object to be verified
  • topology (trappy.stats.Topology.Topology) – A topology that describes the arrangement of CPU’s on a system. This is useful for multi-cluster systems where data needs to be aggregated at different topological levels
  • execnames

    The execnames of the task to be analysed

    A single execname or a list of execnames can be passed. There can be multiple processes associated with a single execname parameter. The execnames are searched using a prefix match.

Consider the following processes which need to be analysed:

  • Reference Trace

    PID execname
    11 task_1
    22 task_2
    33 task_3
  • Trace to be verified

    PID execname
    77 task_1
    88 task_2
    99 task_3

A bart.sched.SchedMatrix.SchedMatrix instance be created following different ways:

  • Using execname prefix match

    SchedMatrix(r_trace, trace, topology,
                execnames="task_")
    
  • Individual Task names

    SchedMatrix(r_trace, trace, topology,
                execnames=["task_1", "task_2", "task_3"])
    
assertSiblings(pid, expected_value, operator, tolerance=0.8)[source]

Assert that the number of siblings in the reference trace match the expected value and the operator

Parameters:
  • pid (int) – The PID of the process in the reference trace
  • operator

    A binary operator function that returns a boolean. For example:

    import operator
    op = operator.eq
    getSiblings(pid, expected_value, op)
    

    Will do the following check:

    getSiblings(pid) == expected_value
    
  • tolerance (float) – A correlation value > tolerance will classify the resultant process as a sibling
getSiblings(pid, tolerance=0.8)[source]

Return the number of processes in the reference trace that have a correlation greater than tolerance

Parameters:
  • pid (int) – The PID of the process in the reference trace
  • tolerance (float) – A correlation value > tolerance will classify the resultant process as a sibling
print_matrix()[source]

Print the correlation matrix