예제 #1
0
def traceback(estimate_number_of_entries):
    """Build and return a vmprof-like traceback, as a pair (array_p,
    array_length).  The caller must free array_p.  Not for signal handlers:
    for these, call vmprof_get_traceback() from C code.
    """
    _cintf = rvmprof._get_vmprof().cintf
    size = estimate_number_of_entries * 2 + 4
    stack = cintf.get_rvmprof_stack()
    array_p = lltype.malloc(rffi.SIGNEDP.TO, size, flavor='raw')
    NULL = llmemory.NULL
    array_length = _cintf.vmprof_get_traceback(stack, NULL, array_p, size)
    return (array_p, array_length)
예제 #2
0
def get_profile_path(space):
    vmp = _get_vmprof()
    if not vmp.is_enabled:
        return None

    with rffi.scoped_alloc_buffer(4096) as buf:
        length = vmp.cintf.vmprof_get_profile_path(buf.raw, buf.size)
        if length == -1:
            return ""
        return buf.str(length)

    return None
예제 #3
0
def start_sampling():
    return _get_vmprof().start_sampling()
예제 #4
0
def stop_sampling():
    return _get_vmprof().stop_sampling()
예제 #5
0
def is_enabled():
    vmp = _get_vmprof()
    return vmp.is_enabled
예제 #6
0
def enable(fileno, interval, memory=0, native=0, real_time=0):
    _get_vmprof().enable(fileno, interval, memory, native, real_time)
예제 #7
0
def disable():
    _get_vmprof().disable()
예제 #8
0
def register_code_object_class(CodeClass, full_name_func):
    _get_vmprof().register_code_object_class(CodeClass, full_name_func)
예제 #9
0
def register_code(code, name):
    _get_vmprof().register_code(code, name)
예제 #10
0
파일: __init__.py 프로젝트: cimarieta/usp
def enable(fileno, interval):
    _get_vmprof().enable(fileno, interval)
예제 #11
0
파일: __init__.py 프로젝트: cimarieta/usp
def disable():
    _get_vmprof().disable()
예제 #12
0
파일: __init__.py 프로젝트: cimarieta/usp
def register_code(code, name):
    _get_vmprof().register_code(code, name)
예제 #13
0
파일: __init__.py 프로젝트: cimarieta/usp
def register_code_object_class(CodeClass, full_name_func):
    _get_vmprof().register_code_object_class(CodeClass, full_name_func)
예제 #14
0
파일: __init__.py 프로젝트: yuanleilei/pypy
def start_sampling(space):
    _get_vmprof().cintf.vmprof_start_sampling()
예제 #15
0
파일: __init__.py 프로젝트: yuanleilei/pypy
def stop_sampling(space):
    fd = _get_vmprof().cintf.vmprof_stop_sampling()
    return rffi.cast(lltype.Signed, fd)
예제 #16
0
파일: __init__.py 프로젝트: sota/pypy-old
def enable(fileno, interval):
    _get_vmprof().enable(fileno, interval)