Ejemplo n.º 1
0
 def __init__(self, rawtraces):
     storage = LoopStorage()
     traces = [
         SimpleParser.parse_from_input(rawtrace) for rawtrace in rawtraces
     ]
     traces = storage.reconnect_loops(traces)
     self.loops = [
         TraceWithIds.from_trace(trace, storage) for trace in traces
     ]
Ejemplo n.º 2
0
    def run(self, topaz, tmpdir, code):
        tmpdir.join("t.rb").write(code)
        proc = subprocess.Popen(
            [str(topaz), str(tmpdir.join("t.rb"))],
            cwd=str(tmpdir),
            env={"PYPYLOG": "jit-log-opt:%s" % tmpdir.join("x.pypylog")}
        )
        proc.wait()
        data = logparser.parse_log_file(str(tmpdir.join("x.pypylog")), verbose=False)
        data = logparser.extract_category(data, "jit-log-opt-")

        storage = LoopStorage()
        traces = [SimpleParser.parse_from_input(t) for t in data]
        traces = storage.reconnect_loops(traces)
        return [Trace(t) for t in traces]
Ejemplo n.º 3
0
    def run(self, topaz, tmpdir, code):
        tmpdir.join("t.rb").write(code)
        proc = subprocess.Popen(
            [str(topaz), str(tmpdir.join("t.rb"))],
            cwd=str(tmpdir),
            env={"PYPYLOG": "jit-log-opt:%s" % tmpdir.join("x.pypylog")})
        proc.wait()
        data = logparser.parse_log_file(str(tmpdir.join("x.pypylog")),
                                        verbose=False)
        data = logparser.extract_category(data, "jit-log-opt-")

        storage = LoopStorage()
        traces = [SimpleParser.parse_from_input(t) for t in data]
        traces = storage.reconnect_loops(traces)
        return [Trace(t) for t in traces]
Ejemplo n.º 4
0
def extract_traces(file, remove_debug=True, remove_main_labels=True, remove_all_labels=False):
    data = logparser.parse_log_file(file, verbose=False)
    data = logparser.extract_category(data, "jit-log-opt-")
    
    storage = LoopStorage()
    traces = [SimpleParser.parse_from_input(t) for t in data]
    main_loops = storage.reconnect_loops(traces)
    traces_w = []
    for trace in traces:
        if trace in main_loops:
            traces_w.append(Trace(trace))
        else:
            traces_w[len(traces_w) - 1].addbridge(trace)
    for trace in traces_w:
        trace.parse(remove_debug, remove_main_labels, remove_all_labels)
    return traces_w
Ejemplo n.º 5
0
def extract_traces(file, remove_debug=True, remove_main_labels=True,
                   remove_all_labels=False):
    data = logparser.parse_log_file(file, verbose=False)
    data = logparser.extract_category(data, "jit-log-opt-")

    storage = LoopStorage()
    traces = [SimpleParser.parse_from_input(t) for t in data]
    main_loops = storage.reconnect_loops(traces)
    traces_w = []
    for trace in traces:
        if trace in main_loops:
            traces_w.append(Trace(trace))
        else:
            traces_w[len(traces_w) - 1].addbridge(trace)
    for trace in traces_w:
        trace.parse(remove_debug, remove_main_labels, remove_all_labels)
    return traces_w
Ejemplo n.º 6
0
 def __init__(self, rawtraces):
     storage = LoopStorage()
     traces = [SimpleParser.parse_from_input(rawtrace) for rawtrace in rawtraces]
     traces = storage.reconnect_loops(traces)
     self.loops = [TraceWithIds.from_trace(trace, storage) for trace in traces]