Beispiel #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
     ]
Beispiel #2
0
 def match(self, src1, src2, **kwds):
     from rpython.tool.jitlogparser.parser import SimpleParser
     loop = SimpleParser.parse_from_input(src1)
     matcher = OpMatcher(loop.operations)
     try:
         res = matcher.match(src2, **kwds)
         assert res is True
         return True
     except InvalidMatch:
         return False
Beispiel #3
0
 def match(self, src1, src2, **kwds):
     from rpython.tool.jitlogparser.parser import SimpleParser
     loop = SimpleParser.parse_from_input(src1)
     matcher = OpMatcher(loop.operations)
     try:
         res = matcher.match(src2, **kwds)
         assert res is True
         return True
     except InvalidMatch:
         return False
Beispiel #4
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]
Beispiel #5
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]
Beispiel #6
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
Beispiel #7
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
Beispiel #8
0
def parse(input, **kwds):
    return SimpleParser.parse_from_input(input, **kwds)
Beispiel #9
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]
Beispiel #10
0
def parse(input, **kwds):
    return SimpleParser.parse_from_input(input, **kwds)
Beispiel #11
0
 def match(self, src1, src2, **kwds):
     from rpython.tool.jitlogparser.parser import SimpleParser
     loop = SimpleParser.parse_from_input(src1)
     matcher = OpMatcher(loop.operations, src=src1)
     return matcher.match(src2, **kwds)
Beispiel #12
0
 def match(self, src1, src2, **kwds):
     from rpython.tool.jitlogparser.parser import SimpleParser
     loop = SimpleParser.parse_from_input(src1)
     matcher = OpMatcher(loop.operations, src=src1)
     return matcher.match(src2, **kwds)