an annotation framework for dynamic binary manipulation on multi-cores speaker: wen-ren chen date:...

14
An Annotation Framework for Dynamic Binary Manipulation on Multi-cores peaker: Wen-Ren Chen ate: 2010/11/12 Fri nstitute of Information Science

Upload: shannon-mcdowell

Post on 14-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

An Annotation Framework for Dynamic Binary Manipulation on Multi-cores

Speaker: Wen-Ren ChenDate: 2010/11/12 FriInstitute of Information Science

Outline

• Goal• ELF Format• Current Approach• Progress• Discussion

Goal

TranslatorOriginal ELF

content

Mem

Optimizer Annotation Annotated

ELF

ELF

Annotation can make translator and optimizer more efficient

ELF Format

Current Approach

• Add annotation into ELF can be done offline– objcopy --add-section sectionname=filename

perlbench_base.i386-m32-gcc44

• Retrieve annotation from ELF must be done at runtime– GNU libelf

String Table is also a section

Progress

• Constructing Control Flow Graph beyond sampling’s reach– Basic Block sampling ONLY on x86-64– Difficult to deduce edge probability

• Use profiling data as an initial guess to edge probability– Insert profiling data into ELF, i.e., an annotated

ELF

Discussion

• We have two annotation approached proposed in 11/05 meeting1. Use the first k bits of an instruction for

annotation2. Use XML to do the annotations

• We only have to convert string (hex) into integer (dec)

• Not particular parsing procedure needed at this time

src_head src_tail dst_head dst_tail edge_count0x40098b3b 0x40098b3f 0x4008204e 0x40082088 1 RET0x4008204e 0x40082088 0x40082088 0x40082090 1 COND_DIRECT_JMP0x40082088 0x40082090 0x400820a0 0x400820a5 1 UNCOND_DIRECT_JMP0x400820a0 0x400820a5 0x40082090 0x400820a0 14 COND_DIRECT_JMP0x400820a0 0x400820a5 0x400820a5 0x400820b5 6 COND_DIRECT_JMP

Original CFG profiling data

• The size of annotation might be a problemBenchmark ELF Annotated ELF Ratio

400.perlbench 1021K 1.2M 17.5%

401.bzip2 66K 94K 42.4%

429.mcf 17K 40K 135.3%

445.gobmk 3.6M 3.8M 5.6%

456.hmmer 275K 314K 14.2%

462.libquantum 44K 65K 47.7%

464.h264ref 556K 637K 14.6%

471.omnetpp 755K 841K 11.4%

473.astar 49K 80K 63.3%

ELF increased 39.1% averagely

• The time of retrieving compressed annotation from ELF

Benchmark Time

400.perlbench 0.067s

401.bzip2 0.023s

429.mcf 0.021s

445.gobmk 0.075s

456.hmmer 0.028s

462.libquantum 0.021s

464.h264ref 0.036s

471.omnetpp 0.033s

473.astar 0.018s

Take 0.038s to retrieve compressed annotation from ELF averagely