Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dynamic Instrumentation of Loops in Paradyn & Dyninst Eli Collins Computer Sciences Department University of Wisconsin-Madison Madison,

Similar presentations


Presentation on theme: "Dynamic Instrumentation of Loops in Paradyn & Dyninst Eli Collins Computer Sciences Department University of Wisconsin-Madison Madison,"— Presentation transcript:

1 Dynamic Instrumentation of Loops in Paradyn & Dyninst Eli Collins eli@cs.wisc.edu Computer Sciences Department University of Wisconsin-Madison Madison, WI 53706 USA

2 Loop Instrumentation -2- Motivation Function-level analysis common, insufficient Where in func is the bottleneck?

3 Loop Instrumentation -3- Motivation (cont.) Loops fundamental to program semantics –Sources of parallelism (OpenMP, unrolling) –Collect/associate perf. data at loop granularity Loop bodies often dominate prog. runtime –Especially true for scientific apps Exploit runtime knowledge of loops

4 Loop Instrumentation -4- How We Do It Compiling vs. Program Instrumentation for (… int i; source code CFG 110110 101011 101101 binary CFG (instrumented)

5 Loop Instrumentation -5- Starting w/ the Binary Compilers transform (optimize) loops Some loops disappear –Short loops unrolled –Similar loops fused together We analyze & operate on the binary –Binary determines program behavior: performance

6 Loop Instrumentation -6- Analysis CFG creation (Laune Harris) Detect loops in CFG (Mustafa Tikir) Identify & instrument CFG points that map to loop execution semantics

7 Loop Instrumentation -7- Instrumenting Control Flow for (i = 0; i < N; i++) c[i] = a[i] + b[i]; xor %ebx,%ebx lea 0x0(%esi),%esi lea 0x0(%edi),%edi L1 flds 0x98(%ebp,%ebx,4) fadds 0xc8(%ebp,%ebx,4) fstps 0x68(%ebp,%ebx,4) inc %ebx cmp $0x9,%ebx jle L1 xor %ebx,%ebx for (i = 0; i < N; i++) c[i] = a[i] + b[i]; control flow graph 3 2 1 1 2 3 entry exit start end

8 Loop Instrumentation -8- Abstractions New instrumentation points (DyninstAPI) BPatch_point *pt; pt = func-> findPoint ( BPatch_loopEntry, iloops[0] ); thread->insertSnippet(snip, pt); Vector oloops, iloops; func->getOuterLoops(oloops); loops[0]->getOuterLoops(iloops);

9 Loop Instrumentation -9- Loops in Paradyn “Where” axis displays program resources

10 Loop Instrumentation -10- Loops in Paradyn Focus on resource, select program metric for visualization Loop-granularity for metrics

11 Loop Instrumentation -11- Loops in Paradyn CPU time metric with loop foci Which part of the function is CPU intensive?

12 Loop Instrumentation -12- Loops in Paradyn PC “walks” CGFunction-loop nesting

13 Loop Instrumentation -13- In Progress Loop-aware Performance Consultant –What is an effective search policy? –How can we take advantage of control flow structure? Loops in the Metric Description Language Visualizations –Incorporate program structure –Correlate performance data with original program source

14 Loop Instrumentation -14- Loop-aware Visualization func loop 1 time void func() { int i, j; for (i=0; i < N; i++) { calc(i,j); for(j=0; j < M; j++) A[i] = B[i]*C[j]; } loop 1.1

15 Loop Instrumentation -15- Summary Function-level granularity insufficient Identify & instrument loop points DyninstAPI: abstractions for tool builders Paradyn –Fine-grain metrics, bottleneck location –Visualization

16 Loop Instrumentation -16- Dynamic Instrumentation of Loops in Paradyn & Dyninst eli@cs.wisc.edu http://www.paradyn.org http://www.dyninst.org


Download ppt "Dynamic Instrumentation of Loops in Paradyn & Dyninst Eli Collins Computer Sciences Department University of Wisconsin-Madison Madison,"

Similar presentations


Ads by Google