def warmup_lines_to_chop(benchmark, warmup):
    """Returns the number of lines to be excluded from final measurements.

    """
    # The main benchmark emits its own line.
    lines_to_chop = warmup
    # Each of the child benchmarks emit their own line.
    lines_to_chop += warmup * len(benchmark.children)
    # hhvm_wrapper emits an extra line to let us know its compiling bytecode.
    lines_to_chop += 1
    # Tail 1-indexes line numbers and starts emitting from the nth line.
    lines_to_chop += 1
    return lines_to_chop