#!/usr/bin/env python """ Convert logfile (from jit-log-opt and jit-backend) to json format. Usage: logparser2json.py """ from __future__ import print_function import os import sys import json from rpython.tool.jitlogparser.parser import import_log, parse_log_counts from rpython.tool.logparser import extract_category from rpython.tool.jitlogparser.storage import LoopStorage def mangle_descr(descr): if descr.startswith('TargetToken('): return descr[len('TargetToken('):-1] if descr.startswith('