Exemple #1
0
def measure_link_vsize(output_file, args):
    """
    Execute |args|, and measure the maximum virtual memory usage of the process,
    printing it to stdout when finished.
    """

    # This needs to be a list in order for the callback to set the
    # variable properly with python-2's scoping rules.
    t = [None]
    def callback(proc):
        t[0] = threading.Thread(target=measure_vsize_threadfunc,
                             args=(proc, output_file))
        t[0].start()
    exitcode = expandlibs_exec.main(args, proc_callback=callback)
    # Wait for the background thread to finish.
    t[0].join()
    return exitcode
Exemple #2
0
def wrap_linker(args):
    """
    Execute |args| and pass resulting |proc| object to a second thread that
    will track the status of the started |proc|.
    """

    # This needs to be a list in order for the callback to set the
    # variable properly with python-2's scoping rules.
    t = [None]
    def callback(proc):
        t[0] = threading.Thread(target=periodically_print_status,
                             args=(proc,))
        t[0].start()
    exitcode = expandlibs_exec.main(args, proc_callback=callback)
    # Wait for the background thread to finish.
    t[0].join()
    return exitcode
Exemple #3
0
def wrap_linker(args):
    """
    Execute |args| and pass resulting |proc| object to a second thread that
    will track the status of the started |proc|.
    """

    # This needs to be a list in order for the callback to set the
    # variable properly with python-2's scoping rules.
    t = [None]

    def callback(proc):
        t[0] = threading.Thread(target=periodically_print_status,
                                args=(proc, ))
        t[0].start()

    exitcode = expandlibs_exec.main(args, proc_callback=callback)
    # Wait for the background thread to finish.
    t[0].join()
    return exitcode
Exemple #4
0
def measure_link_vsize(output_file, args):
    """
    Execute |args|, and measure the maximum virtual memory usage of the process,
    printing it to stdout when finished.
    """

    # This needs to be a list in order for the callback to set the
    # variable properly with python-2's scoping rules.
    t = [None]

    def callback(proc):
        t[0] = threading.Thread(target=measure_vsize_threadfunc,
                                args=(proc, output_file))
        t[0].start()

    exitcode = expandlibs_exec.main(args, proc_callback=callback)
    # Wait for the background thread to finish.
    t[0].join()
    return exitcode