efficient path profiling thomas ball james r larus n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Efficient Path Profiling Thomas Ball James R. Larus PowerPoint Presentation
Download Presentation
Efficient Path Profiling Thomas Ball James R. Larus

Loading in 2 Seconds...

play fullscreen
1 / 21

Efficient Path Profiling Thomas Ball James R. Larus - PowerPoint PPT Presentation


  • 175 Views
  • Uploaded on

Efficient Path Profiling Thomas Ball James R. Larus. 2005. Dec. 6 Chihun Kim. Contents. Introduction Limitation of edge profiling Algorithm of efficient path profiling Basic idea Compactly representing paths with unique integer Finding instrumentation point Placing instrumentations

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Efficient Path Profiling Thomas Ball James R. Larus' - abena


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
contents
Contents
  • Introduction
  • Limitation of edge profiling
  • Algorithm of efficient path profiling
    • Basic idea
    • Compactly representing paths with unique integer
    • Finding instrumentation point
    • Placing instrumentations
    • Regenerating path from the profile result
    • Transforming general CFG to acyclic DAG
  • Experiment
introduction
Introduction
  • This paper describes a new path profiling algorithm
    • Simple
    • Fast
    • Minimized run-time overhead
      • Efficient edge profiling : average overhead 16%
      • Efficient path profiling : average overhead 31%
limitation of edge profiling
Limitation of edge profiling
  • Problems
    • Edge profiling does not identify the most frequently executed paths
    • Example : 2 possible results from 1 edge profiling
  • We need a Path Profiling
basic idea
Basic idea
  • Paths are identified by unique integer (path identifier)
    • Transitions in control flow graph changes the path identifier
      • Control flow graph acts as State Machine
      • In the final state, instrumentation code update the number of a path execution
    • This integer is used to index an array of counter
      • We need to represent these integers very compactly, because sparse set of identifiers wastes of memory storage
basic idea1
Basic idea
  • Places instrumentation so that
    • Transitions of path identifier need not occur at every branches
  • Basic algorithm assumes that control flow graph is DAG (Directly Acyclic Graph)
    • We need to transform general CFG to DAG
compactly representing paths with sum
Compactly representing paths with sum
  • The first step is to assign a constant value to each edge
  • Path identifier is a sum of edge values through the path
    • All path have a unique identifier
    • Example : edge (ABCDEF) = (2+0+0+1+0) = (3)
compactly representing paths with sum1
Compactly representing paths with sum
  • What is a edge value?

All path strings prefixed with KB are numbered with (0 ~ X-1)

K

All path strings prefixed with KA are numbered with (X ~ X+Y-1)

0

Number of path from K to exit is (X+Y)

X

A

B

Y

X = Number of path from B to exit

exit

compactly representing paths with sum2

A 0

A

A 2

A 2

A

A 0

A 0

A 0

A 0

A 0

A 1

A 1

B 1

C 1

ACD : 0

1

1

1

0

0

0

0

0

0

0

B

C

ABD : 1

B 1

B 0

B 1

B 0

B 0

B

B 1

B 1

B 0

B 1

C 1

C 1

C 0

C 1

C 1

C 1

C 0

C 1

C

C 1

A

B

C

D

D 1

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

D

D 1

D 1

D 1

D 1

D 1

D 1

D 1

D 1

D 1

D 1

Compactly representing paths with sum
  • Algorithm
finding instrumentation point
Finding instrumentation point
  • Uses the techniques in the paper
    • Thomas Ball. Efficiently counting program events with support for on-line queries, ACM Transactions on Programming Languages and Systems, Sep 1994
  • Path identifier is preserved, but
    • Transition events in the paths are reduced
    • Example:
      • transition number changes from 3 to 2 in the path (ABDEF)
inserting instrumentation

r = 0

r += 2

r += 4

r += 1

table[ r ] ++

Inserting Instrumentation
  • Initialize a register for path identifier r in entry node
  • Update register r in the edge by the edge values
  • Increment a table in the exit node
    • The value in register r is used to index the result table
inserting instrumentation1

r = 0

r += 2

r += 4

r += 1

table[ r ] ++

Inserting Instrumentation
  • There are some optimization in updating path register r
    • You can combine initialization of r and the first update of r
    • You can combine table update and the final update of r
regenerating path from the profile result
Regenerating path from the profile result
  • Given information
    • R = path identifier
    • v = current block (initialized to entry block)
    • e = outgoing edge from the vertex v to w
    • Val(e) = edge value of the edge e
  • At each block, find e (v→w) , which is outgoing edge of v with the largest Val(e) ≤ R.
regenerating path from the profile result1

R=4

A

2

B

C

2

D

1

E

F

Regenerating path from the profile result
  • Example: path register is 4
    • Current node is A
    • You choose edge (A→B)
      • Because (A→B) has the largest edge value which is smaller than the current path register value 4.
regenerating path from the profile result2

A

2

R=2

B

C

2

D

1

E

F

Regenerating path from the profile result
  • Example: path register is 4
    • Current node is B
    • Path register is decreased by 2
      • Because you choose the edge (A→B)
    • The second edge is (B→D)
regenerating path from the profile result3

A

2

B

C

2

D

R=0

1

E

F

Regenerating path from the profile result
  • Example: path register is 4
    • Current node is D
    • You cannot select a edge (D→E)
      • Because a current path register is only 0
    • The final edge is (D→F)
      • Edge (D→F) has value 0
regenerating path from the profile result4

A

2

B

C

2

D

R=0

1

E

F

Regenerating path from the profile result
  • Example: path register is 4
    • Regenerated path is ABDF
transforming general cfg to acyclic dag
Transforming general CFG to acyclic DAG
  • If there is a backedge (E → B)
    • Insert dummy edge (entry → B)
    • Insert dummy edge (E →exit)
    • Remove the backedge (E→B)
experiment result
Experiment result
  • PP : path profiling
  • QPT : edge profiling
  • PP’s overhead averaged 2.8 times QPT overhead
experiment result1
Experiment result
  • Correct : the fraction of paths predicted entirely correctly by edge profiling
conclusion introduction
Conclusion = Introduction
  • New path profiling algorithm
    • Simple
    • Fast
    • Minimized run-time overhead
      • Efficient edge profiling : average overhead 16%
      • Efficient path profiling : average overhead 31%