[llvm-dev] RFC: XRay in the LLVM Library
Dean Michael Berris via llvm-dev
llvm-dev at lists.llvm.org
Wed Nov 30 16:32:47 PST 2016
On 1 Dec. 2016, at 00:26, Kristof Beyls <Kristof.Beyls at arm.com> wrote:
> Hi Dean,
> I haven't looked very closely at XRay so far, but I'm wondering if making CTF (common trace format, e.g. see http://diamon.org/ctf/) the default format for XRay traces would be useful?
Nice! Thanks for mentioning this, I've not had a look at this before.
There's a couple issues I can think of, off the top of my head as to why using that as the default format for XRay may be slightly problematic. More on this below.
> It seems it'd be nice to be able to reuse some of the tools that already exist for CTF, such as a graphical viewer (http://tracecompass.org/) or a converter library (http://man7.org/linux/man-pages/man1/babeltrace.1.html).
> LTTng already uses this format and linux perf can create traces in CTF format too. Probably it would be useful for at least some to be able to combine traces from XRay with traces from LTTng or linux perf?
This sounds like a great idea!
I'm working on a conversion tool that aims to target multiple output formats. It's being developed at https://reviews.llvm.org/D24376 where the intent is to start with something simple, but then grow support for multiple other formats. CTF sounds like a perfectly reasonable target format.
Writing CTF though might be slightly problematic for XRay only for the potential complexity that will bring into the runtime library. While conceptually the formats are very similar (XRay uses binary logging, and efficient in-memory structures to save on both space and time required to write them down) we'd like the XRay library to make some more optimisations and evolve into a certain direction without being tied down to one particular format.
I'll need to think about this a little more, but I definitely think converting from whatever XRay format we come up with to CTF sounds like a great feature to the conversion tool.
> Maybe the current version of CTF may not have all the features that you need, but the next version of CTF (CTF 2) seems to be at least addressing some of the concerns you touch on below: http://diamon.org/ctf/files/CTF2-PROP-1.0.html#design-goals.
> Any thoughts on whether CTF could be a good choice as the format to store XRay logs in?
I may need to think about it more, but I don't see a bad reason for being able to convert XRay traces to CTF. :)
More information about the llvm-dev