<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 28, 2016 at 12:31 AM, Dean Michael Berris via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>- What is the preferred way of controlling the behaviour of the runtime library for something like XRay? Do the sanitizers check/use environment variables or commandline-flags to control behaviour at runtime/init?</div></div></blockquote><div><br></div><div>The sanitizers each use a different, single environment variable:</div><div><a href="https://github.com/google/sanitizers/wiki/SanitizerCommonFlags">https://github.com/google/sanitizers/wiki/SanitizerCommonFlags</a></div><div>IMO this works pretty well, and it supports multiple flags.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>- We would like to be able to trigger the patching/unpatching routines at runtime in a portable manner. In Linux and other UNIX-like environments signals (SIGUSR1 and SIGUSR2) might be good candidates for signalling the tracing infrastructure to start/stop at user-controlled times (useful for long-running servers). Is there a preference for this, or are there alternatives in this space that might make better sense?</div></div></blockquote><div><br></div><div>No idea, maybe others have a better idea.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>- Currently we are using 'printf' for the logging, but could use a simple thread-local in-memory log that flushes to disk when full. Any other preferred ways of doing this?</div></div></blockquote><div><br></div><div>Should XRay use libc? Are there re-entrancy issues that we should be worried about? Most sanitizer code avoids calling libc directly, and most functionality (printf) is implemented internally. Maybe you should link sanitizer_common and use that.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>- Documentation for how to use/run XRay may need to live in a central location, but since the changes to the LLVM pieces are currently in three different places, are there suggestions for where the docs should live?</div></div></blockquote><div><br></div><div>The sanitizer docs are kind of spread out, unfortunately. There's some in clang, some on the github wiki, and probably some in LLVM. Personally I think the documentation should be in clang in rst.</div></div></div></div>