1 / 16

Dynamic Instrumentation of Loops in Paradyn & Dyninst

Dynamic Instrumentation of Loops in Paradyn & Dyninst. Eli Collins eli@cs.wisc.edu Computer Sciences Department University of Wisconsin-Madison Madison, WI 53706 USA. Motivation. Function-level analysis common, insufficient Where in func is the bottleneck?. Motivation (cont.).

johnna
Download Presentation

Dynamic Instrumentation of Loops in Paradyn & Dyninst

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. Motivation • Function-level analysis common, insufficient • Where in func is the bottleneck?

  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. How We Do It 110110 101011 101101 for (… int i; binary source code CFG • Compiling vs. Program Instrumentation CFG (instrumented)

  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. Analysis • CFG creation (Laune Harris) • Detect loops in CFG (Mustafa Tikir) • Identify & instrument CFG points that map to loop execution semantics

  7. Instrumenting Control Flow 1 entry exit start end 1 2 2 3 3 for (i = 0; i < N; i++) c[i] = a[i] + b[i]; 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 control flow graph

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

  9. Loops in Paradyn “Where” axis displays program resources

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

  11. Loops in Paradyn • CPU time metric with loop foci • Which part of the function is CPU intensive?

  12. Loops in Paradyn • PC “walks” CG • Function-loop nesting

  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-aware Visualization 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]; } } func loop 1 time loop 1.1

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

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

More Related