Exemple #1
0
 def main():
     loop(30)
     assert jit_hooks.stats_get_counter_value(None,
                                    Counters.TOTAL_COMPILED_LOOPS) == 1
     assert jit_hooks.stats_get_counter_value(None,
                                    Counters.TOTAL_COMPILED_BRIDGES) == 1
     assert jit_hooks.stats_get_counter_value(None,
                                              Counters.TRACING) == 2
     assert jit_hooks.stats_get_times_value(None, Counters.TRACING) >= 0
Exemple #2
0
 def main():
     loop(30)
     assert jit_hooks.stats_get_counter_value(
         None, Counters.TOTAL_COMPILED_LOOPS) == 1
     assert jit_hooks.stats_get_counter_value(
         None, Counters.TOTAL_COMPILED_BRIDGES) == 1
     assert jit_hooks.stats_get_counter_value(None,
                                              Counters.TRACING) == 2
     assert jit_hooks.stats_get_times_value(None, Counters.TRACING) >= 0
Exemple #3
0
def get_stats_snapshot(space):
    """ Get the jit status in the specific moment in time. Note that this
    is eager - the attribute access is not lazy, if you need new stats
    you need to call this function again.
    """
    ll_times = jit_hooks.stats_get_loop_run_times(None)
    w_times = space.newdict()
    for i in range(len(ll_times)):
        w_key = space.newtuple([space.wrap(ll_times[i].type), space.wrap(ll_times[i].number)])
        space.setitem(w_times, w_key, space.wrap(ll_times[i].counter))
    w_counters = space.newdict()
    for i, counter_name in enumerate(Counters.counter_names):
        v = jit_hooks.stats_get_counter_value(None, i)
        space.setitem_str(w_counters, counter_name, space.wrap(v))
    w_counter_times = space.newdict()
    tr_time = jit_hooks.stats_get_times_value(None, Counters.TRACING)
    space.setitem_str(w_counter_times, "TRACING", space.wrap(tr_time))
    b_time = jit_hooks.stats_get_times_value(None, Counters.BACKEND)
    space.setitem_str(w_counter_times, "BACKEND", space.wrap(b_time))
    return space.wrap(W_JitInfoSnapshot(space, w_times, w_counters, w_counter_times))
Exemple #4
0
def get_stats_snapshot(space):
    """ Get the jit status in the specific moment in time. Note that this
    is eager - the attribute access is not lazy, if you need new stats
    you need to call this function again.
    """
    ll_times = jit_hooks.stats_get_loop_run_times(None)
    w_times = space.newdict()
    for i in range(len(ll_times)):
        w_key = space.newtuple(
            [space.wrap(ll_times[i].type),
             space.wrap(ll_times[i].number)])
        space.setitem(w_times, w_key, space.wrap(ll_times[i].counter))
    w_counters = space.newdict()
    for i, counter_name in enumerate(Counters.counter_names):
        v = jit_hooks.stats_get_counter_value(None, i)
        space.setitem_str(w_counters, counter_name, space.wrap(v))
    w_counter_times = space.newdict()
    tr_time = jit_hooks.stats_get_times_value(None, Counters.TRACING)
    space.setitem_str(w_counter_times, 'TRACING', space.wrap(tr_time))
    b_time = jit_hooks.stats_get_times_value(None, Counters.BACKEND)
    space.setitem_str(w_counter_times, 'BACKEND', space.wrap(b_time))
    return space.wrap(
        W_JitInfoSnapshot(space, w_times, w_counters, w_counter_times))