21.01.2013 Views

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Complement<strong>in</strong>g Miss<strong>in</strong>g and Inaccurate Profil<strong>in</strong>g 299<br />

Let us exam<strong>in</strong>e the terms <strong>in</strong> cp (o)<br />

:<br />

+ −<br />

• The confidence constants o o k k / , represent the confidence we have <strong>in</strong> the<br />

+ −<br />

measurement of a vertex or edge. k o / k o effect the cost of <strong>in</strong>creas<strong>in</strong>g/decreas<strong>in</strong>g<br />

the flow on o ∈ V ∪ E (thus sett<strong>in</strong>g positive/negative values to Δ (o)<br />

). Note<br />

that the higher the confidence we have <strong>in</strong> the measurement the higher the cost to<br />

change its measured value will be.<br />

• w(o) represents an <strong>in</strong>itial flow estimation on o ∈ V ∪ E , this is expla<strong>in</strong>ed<br />

thoroughly <strong>in</strong> section 5, but for now it is sufficient to th<strong>in</strong>k of it as the <strong>in</strong>accurate<br />

flow as measured on o ∈ V ∪ E .<br />

• The ln function is used to normalize the weight of the edge/vertex which is <strong>in</strong> the<br />

denom<strong>in</strong>ator of the cost function, thus creat<strong>in</strong>g a denser distribution of costs.<br />

For any application of the technique for fill<strong>in</strong>g <strong>in</strong> the miss<strong>in</strong>g/<strong>in</strong>accurate gathered<br />

profile <strong>in</strong>formation we limit ourselves to fill<strong>in</strong>g <strong>in</strong> <strong>in</strong>tra-procedural (local) miss<strong>in</strong>g<br />

frequencies.<br />

The algorithm for apply<strong>in</strong>g the <strong>in</strong>tra-procedural fixes is as follows:<br />

1. foreach f <strong>in</strong> the list of functions do<br />

a. build control flow graph g for f<br />

b. foreach o ∈ V ∪ E <strong>in</strong> G assign values to the confidence constants<br />

k (o)<br />

±<br />

and the weight function w (o)<br />

(see Sett<strong>in</strong>g the constants ahead)<br />

c. Build a fixup graph G’ (see section 4)<br />

d. apply the m<strong>in</strong>imum cost circulation algorithm to G’ to f<strong>in</strong>d the m<strong>in</strong>imum<br />

flow function f<br />

e. Retrieve the fixup vector Δ from f as expla<strong>in</strong>ed <strong>in</strong> section 4.<br />

Sett<strong>in</strong>g the constants: k ( o),<br />

w(<br />

o)<br />

±<br />

Sett<strong>in</strong>g w (o)<br />

: Youfeng Wu and James R. Larus suggest techniques to estimate edge<br />

probabilities [4]. We determ<strong>in</strong>e the probability for each edge ( u v )<br />

p , by us<strong>in</strong>g static<br />

profile techniques as suggested <strong>in</strong> their paper. The weight for each edge is then set as<br />

follows: w ( v,<br />

u ) = w()<br />

v ⋅ p(<br />

v,<br />

u )<br />

Sett<strong>in</strong>g k (o)<br />

±<br />

: we set the value for the confidence constants as follows:<br />

ko ±<br />

= a ⋅b<br />

±<br />

+ −<br />

; a = 1, a = 50,<br />

b = avg _ vertex_<br />

weight(<br />

cfg)<br />

Note that the b parameter is just for normalization so it's not very important. Sett<strong>in</strong>g<br />

+ −<br />

a and a as shown above, worked well because it made the cost of decreas<strong>in</strong>g<br />

flow on a vertex/edge significantly larger than that of <strong>in</strong>creas<strong>in</strong>g the flow on it. If we<br />

+ −<br />

would have given a and a similar values we would end up with a fixup vector that<br />

cancels most of the measured flow, as the trivial solution that cancels all the flow on<br />

(6)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!