示例#1
0
 def test_fixture(self, fakevmprof):
     assert isinstance(fakevmprof, FakeVMProf)
     assert rvmprof._get_vmprof() is fakevmprof
     #
     # tweak sampling using the "real" API, and check that we actually used
     # the fake
     rvmprof.start_sampling()
     assert fakevmprof.is_sampling_enabled
     rvmprof.stop_sampling()
     assert not fakevmprof.is_sampling_enabled
示例#2
0
def new_stacklet_callback(h, arg):
    self = global_state.origin
    self.h = h
    global_state.clear()
    try:
        rvmprof.start_sampling()
        frame = self.bottomframe
        w_result = frame.execute_frame()
    except Exception as e:
        global_state.propagate_exception = e
    else:
        global_state.w_value = w_result
    finally:
        rvmprof.stop_sampling()
    self.sthread.ec.topframeref = jit.vref_None
    global_state.origin = self
    global_state.destination = self
    return self.h
示例#3
0
def stop_sampling(space):
    return space.newint(rvmprof.stop_sampling(space))