<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 15, 2018 at 5:12 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am, of course, a huge fan of this effort. :)<br><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><span><blockquote type="cite"><div dir="ltr"><span id="m_1503495483911602379m_-559163095080132102m_-7778141929440463774gmail-m_-3389961447841594895m_-971815685618268078inbox-inbox-docs-internal-guid-1c394e3d-2a21-e904-346a-6decad13442d" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><ul style="margin-top:0pt;margin-bottom:0pt"><br>
<li dir="ltr" style="margin-left:15px;list-style-type:disc;font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">[??] Make the tool work for other CPUs. This mainly depends on the presence of performance counters.</span></p></li>
</ul>
<h1 dir="ltr" style="line-height:1.38;margin-top:20pt;margin-bottom:6pt"><span style="font-size:20pt;font-family:Arial;background-color:transparent;font-weight:400;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"></span></h1></span></div></blockquote></span></div></blockquote></div></div></div></blockquote></div></blockquote></span><div>Having these requirements documented will be great. In particular, it's important to document what kind of functionality we need out of the PMU rather than any particular cpu specific counter. Also performance requirements of the counters.</div></div></div></blockquote><div><br></div><div>I'll create a bug to track that as soon as the RFC has been accepted. In a nutshell we were thinking of adding a field to `<span id="gmail-m_c1_11" class="gmail-chl" style="background:rgb(136,255,184);font-weight:bold;line-height:1em;color:rgb(0,0,0);font-family:monospace;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">ProcRes</span><span style="color:rgb(0,0,0);font-family:monospace;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">ource` in `TargetSchedule.td`</span><span style="color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="arial, helvetica, sans-serif" style=""> that maps the resource to a (list of) pfm/perf event, and let libpfm abstract the hardware for us. </font></span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span class=""><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><span><blockquote type="cite"><div dir="ltr"><span id="m_1503495483911602379m_-559163095080132102m_-7778141929440463774gmail-m_-3389961447841594895m_-971815685618268078inbox-inbox-docs-internal-guid-1c394e3d-2a21-e904-346a-6decad13442d" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><h1 dir="ltr" style="line-height:1.38;margin-top:20pt;margin-bottom:6pt"><span style="font-size:20pt;font-family:Arial;background-color:transparent;font-weight:400;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Open Questions</span></h1>
<span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">We depend on </span><a href="http://perfmon2.sourceforge.net/docs_v4.html" style="color:rgb(17,85,204);text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;color:rgb(17,85,204);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">libpfm</span></a><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">. How do we handle the dependency ?</span></span><br class="m_1503495483911602379m_-559163095080132102m_-7778141929440463774gmail-m_-3389961447841594895m_-971815685618268078inbox-inbox-Apple-interchange-newline" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">
</div>
</blockquote>
<br>
</span> Are there options that you have in mind? It's an
external MIT-licensed dependency. Wouldn't CMake just
detect it when it's available?<br>
</div>
</blockquote>
<div><br>
</div>
<div>That's what we've done for now (see <a href="https://reviews.llvm.org/differential/changeset/?ref=1002469&whitespace=ignore-most" target="_blank">code here</a>). We're not sure
what the policy is wrt external deps. Right now if the
tool is enabled and libpfm is not on the system, we die
with an error message. The other options would be to
disable the tool in that case (I'm not sure how to do
that). Opinions ?</div>
</div>
</div>
</div>
</blockquote>
<br></div><div text="#000000" bgcolor="#FFFFFF">
Sounds good (we can discuss this further, if necessary, in the code
review).</div></blockquote><div><br></div></span><div>Agreed. :)</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-eric </div></font></span></div></div>
</blockquote></div><br></div></div>