コード例 #1
0
ファイル: dump_analysis.py プロジェクト: shermike/scripts
def analyze_big_blocks():
    bl_cnt_total = 0
    bbl_cnt_total = 0
    bigs = []
    for f in cdump.xsim_nightly_code_warmups(gear='O1', arch='aarch64'):
        print f
        blocks = cdump.load_blocks(f, cdump.Block.TYPE_O1)
#        gva = [b.gva for b in blocks if b.type == cdump.Block.TYPE_O1]
#        blocks = [b for b in blocks if b.gva in gva]
        bl_cnt = 0
        bbl_cnt = 0
        for b in blocks:
            if b.size() < 32:
                if b.size() > 1:
                    bl_cnt += 1
                continue
            bbs = []
            cnt = 0
            for oper in b:
                if not oper.inst.attr('A_BRANCH'):
                    cnt += 1
                    continue 
                bbs.append(cnt)
                cnt = 0
                
            if any(b > 32 for b in bbs):
                print b, ' BB sizes:', ', '.join([str(b) for b in bbs])
                bbl_cnt += 1
                bigs.extend([b for b in bbs if b > 32])
            bl_cnt += 1
        print "Big/Total: %d/%d(%05.2f%%)"%(bbl_cnt, bl_cnt, 100 * float(bbl_cnt)/float(bl_cnt))
        bl_cnt_total += bl_cnt
        bbl_cnt_total += bbl_cnt
        #break
    print '\n', "BIG/TOTAL: %d/%d(%05.2f%%)"%(bbl_cnt_total, bl_cnt_total, 100 * float(bbl_cnt_total)/float(bl_cnt_total))
    print 'Mean big size value: %.2f'%(float(sum(bigs))/float(len(bigs)))
コード例 #2
0
ファイル: dump_analysis.py プロジェクト: shermike/scripts
def analyze_pkt(pjit_path=None):
    tests = []
    for f in cdump.xsim_nightly_code_warmups(rev=70138, gear='O2', arch='aarch64'):
        if pjit_path:
            pf = re.sub('.*(/xsim_.*code_warmup.S)', "%s\g<1>"%pjit_path, f)
            pf = re.sub('_O2_', '_PJIT_', pf)
        else:
            pf = re.sub('_O2_', '_PJIT_', f)
        if os.path.isfile(pf):
            tests.append(Comparator(f, pf))
    
    for i, test in enumerate(tests):
        out_path = '/local_disk/msherstennikov/pkt_anls2/'
        out_code_path = out_path + test.name
        try: os.makedirs(out_code_path)
        except: pass
        shutil.copyfile(test.dump1_fname, out_code_path + '/code_warmup_o2.S')
        shutil.copyfile(test.dump2_fname, out_code_path + '/code_warmup_o1.S')
        print '{i}/{len} {test}'.format(i=i, len=len(tests), test=test.name)
        try:
            test.run(lambda oper: oper.is_packet() and 'dssi' not in oper.opc, 
                     out_file = out_path + re.search('(xsim_.*)\/', test.dump1_fname).group(1) + '.log')
        except Exception as e:
            print "EXCEPTION: ", e