示例#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
def start_sampling(space):
    _get_vmprof().cintf.vmprof_start_sampling()
示例#15
0
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)