<div dir="ltr">Hi TB,<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 23, 2016 at 7:31 PM TB Schardl <<a href="mailto:neboat@mit.edu">neboat@mit.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hey Dean and Matthias,</div><div><br></div><div>Thanks for pointing out XRay to us.</div><div><br></div><div>Implementing XRay on top of CSI is an interesting question.  Like XRay, CSI can insert instrumentation at function entry and exit points (as well as at many other points in the IR).  CSI and XRay effectively instrument programs in different ways, however.  Using CSI, the IR of a CSI tool is integrated with the IR of the program-under-test such that the code of the tool is always executed when the instrumented program is run.  (The tool-writer might implement their tool to execute instrumentation code conditionally based on a flag that is toggled during program execution, but implementing such functionality is up to the tool-writer.)  XRay sleds, however, are regions of assembly added to the program-under-test that can be overwritten at runtime into calls to an XRay tool.  It would be interesting to explore down the road what the tradeoffs are of these different approaches, as well as how these strategies might be unified into the same framework.</div></div></blockquote><div><br></div><div>We have published a white-paper (<a href="http://research.google.com/pubs/pub45287.html">http://research.google.com/pubs/pub45287.html</a>) which details more about what XRay does and how it does it, in case you wanted more details. :)</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><br></div><div>Regarding runtime components in CSI-tools: I don't think there should be any issue with a CSI tool using a runtime component.   In fact, if you have an example XRay tool available, we'd be interested in trying to port it to CSI.  I think the CSI port should be able to replicate the functionality of the tool, though I don't know how its performance will compare to the XRay approach.  Is there some place where we can grab an XRay tool to try out?</div><div><br></div></div></blockquote><div><br></div><div>I've just recently (in the past couple of days) published the third piece of the patches that will allow you to try out a very prototype, still work in progress, XRay implementation in LLVM. These are:</div><div><br></div><div><a href="http://reviews.llvm.org/D19904">http://reviews.llvm.org/D19904</a> -- patch to the LLVM core<br></div><div><a href="http://reviews.llvm.org/D21612">http://reviews.llvm.org/D21612</a> -- patch to the compiler-rt project<br></div><div><a href="http://reviews.llvm.org/D20352">http://reviews.llvm.org/D20352</a> -- patch to Clang to support flags and attributes<br></div><div><br></div><div>If the patches apply cleanly (I haven't synced for a few days now) to the tip of all three projects, you can then build a single-object-file-binary (I'm still working on getting multiple object-file support to work) that will have XRay's demo runtime in clang with the -fxray-instrument and -fxray-instruction-threshold=1 flags added to your clang invocation.</div><div><br></div><div>This is clearly still work in progress, but it should give you an idea of how it will probably end up working in some form.</div><div><br></div><div>Cheears</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></div><div>Cheers,</div><div>TB</div></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 17, 2016 at 1:36 AM, Dean Michael Berris via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><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 dir="ltr"><div class="gmail_quote"><span><div dir="ltr">On Fri, Jun 17, 2016 at 5:42 AM Matthias Braun via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Some of this overlaps with the features in XRay (<a href="http://lists.llvm.org/pipermail/llvm-dev/2016-April/098901.html" target="_blank">http://lists.llvm.org/pipermail/llvm-dev/2016-April/098901.html</a>).</div></div><div style="word-wrap:break-word"><div><br></div></div></blockquote><div><br></div></span><div>Matthias beat me to it!</div><div><br></div><div>From reading the RFC, it seems that some of what XRay is doing on the instrumentation side is very similar to what CSI enables. The current implementation I'm working with (in <a href="http://reviews.llvm.org/D19904" target="_blank">http://reviews.llvm.org/D19904</a>) requires some very deep integration with the LLVM compiler infrastructure (essentially a machine function pass, and instruction lowering on a per-platform basis).</div><div><br></div><div>The development of XRay has a few trade-offs for code-size effect and runtime overhead, which I suspect are unique to XRay's target use-case which is for efficient function call accounting/tracing.</div><div><br></div><div>So I have two high-level questions:</div><div><br></div><div>- Will something like XRay be implementable on-top of CSI?</div><div>- How will the runtime components cooperate or be handled by tools built on top of CSI?</div><div><br></div><div>Cheers</div></div></div>
<br></blockquote></div></div><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">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div></div></blockquote></div></div>