XRay Trace of Clang, Loadable through Chrome Trace Viewer

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

XRay Trace of Clang, Loadable through Chrome Trace Viewer

Robinson, Paul via cfe-dev
Hi cfe-dev@ and llvm-dev@,

I've attached a Chrome trace-viewer readable trace of a clang built with XRay instrumentation (additional build/link flags="-fxray-instrument -fxray-instruction-threshold=75") with the latest "top-of-trunk" version of clang with the recent updates to the XRay runtime supporting record filtering.

To load the attached file, go to 'chrome://tracing' in your Chrome/Chromium browser and load the .gz file directly. Pressing '?' should give a help dialog.

As a snapshot of what it looks like for reference:




This is an invocation of clang compiling some random C++ file in the clang distribution.

If there's interest, I'd be happy to draft a more in-depth walk-through of how to generate this, maybe in some more share-friendly medium. Perhaps something for the LLVM blog?

For the impatient, you can generate a similar visualisation of your XRay traces with the latest `llvm-xray` tool that comes with the LLVM sources. To generate the above, all I had to do was the following:

$LLVM_BUILD_DIR/bin/llvm-xray convert -symbolize -instr_map=./bin/clang -output-format=trace_event xray-log.clang-6.0.XXXXXX | gzip > clang-6.0-default-real.txt.gz

Instructions at http://llvm.org/docs/XRayExample.html also apply to llc.

I hope this kind of instrumentation would be helpful in further improving Clang and the LLVM toolchain to see where latency in the execution of these tools are coming from.

Thanks for reading, and I hope this helps!

-- Dean

PS. Thanks go to Keith Wyss who implemented the conversion tool that generates the chrome trace viewer readable output!


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

Screen Shot 2017-12-06 at 02.38.30.png (885K) Download Attachment
clang-6.0-default-real.txt.gz (859K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: XRay Trace of Clang, Loadable through Chrome Trace Viewer

Robinson, Paul via cfe-dev


On Tue, Dec 5, 2017 at 9:49 AM, Dean Michael Berris via cfe-dev <[hidden email]> wrote:
Hi cfe-dev@ and llvm-dev@,

I've attached a Chrome trace-viewer readable trace of a clang built with XRay instrumentation (additional build/link flags="-fxray-instrument -fxray-instruction-threshold=75") with the latest "top-of-trunk" version of clang with the recent updates to the XRay runtime supporting record filtering.

To load the attached file, go to 'chrome://tracing' in your Chrome/Chromium browser and load the .gz file directly. Pressing '?' should give a help dialog.



This is an interesting feature.  Is it designed to accept arbitrary xray trace logs or only ones for/from Chrome/ium?

-Brian

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: XRay Trace of Clang, Loadable through Chrome Trace Viewer

Robinson, Paul via cfe-dev


Sent from my iPhone

On 6 Dec 2017, at 4:17 am, Brian Cain <[hidden email]> wrote:



On Tue, Dec 5, 2017 at 9:49 AM, Dean Michael Berris via cfe-dev <[hidden email]> wrote:
Hi cfe-dev@ and llvm-dev@,

I've attached a Chrome trace-viewer readable trace of a clang built with XRay instrumentation (additional build/link flags="-fxray-instrument -fxray-instruction-threshold=75") with the latest "top-of-trunk" version of clang with the recent updates to the XRay runtime supporting record filtering.

To load the attached file, go to 'chrome://tracing' in your Chrome/Chromium browser and load the .gz file directly. Pressing '?' should give a help dialog.



This is an interesting feature.  Is it designed to accept arbitrary xray trace logs or only ones for/from Chrome/ium?


Yes, it works on any XRay trace generated with the logging implementations that come with XRay in compiler-rt.

The example attached was of an instrumented Clang binary compiling C++ code. 😁

The caveat is, while the tool (llvm-xray convert) can generate arbitrarily large Chrome-loadable traces, the Chrome trace viewer can only handle so much data.

Cheers

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: XRay Trace of Clang, Loadable through Chrome Trace Viewer

Robinson, Paul via cfe-dev

I believe Trace Compass can read the "Trace event format" natively, but I'll let me colleague comment on this (I forgot to CC the cfe-dev so he could not reply).


Marc-André


From: Dean Michael Berris <[hidden email]>
Sent: Thursday, December 7, 2017 6:09:09 AM
To: Marc-André Laperle
Cc: Brian Cain; LLVM Developers; Keith Wyss
Subject: Re: [cfe-dev] XRay Trace of Clang, Loadable through Chrome Trace Viewer
 
Sweet stuff! Thanks for sharing this, Marc-André!

It seems like Trace Compass can already handle CTF. I suspect if we implemented a converter to CTF, that we can turn XRay traces into something that can be visualised with this. That, or have Trace Compass load XRay traces natively.

Cheers

On 7 Dec 2017, at 03:47, Marc-André Laperle <[hidden email]> wrote:

"The caveat is, while the tool (llvm-xray convert) can generate arbitrarily large Chrome-loadable traces, the Chrome trace viewer can only handle so much data."

A tool like Trace Compass could help here, it does scale pretty well. (see tracecompass.org)
I'm replying here so a colleague who just suscribed to the mailing list can reply here.

Marc-André



From: cfe-dev <[hidden email]> on behalf of Dean Michael Berris via cfe-dev <[hidden email]>
Sent: Tuesday, December 5, 2017 3:52 PM
To: Brian Cain
Cc: LLVM Developers; Keith Wyss; Clang Dev
Subject: Re: [cfe-dev] XRay Trace of Clang, Loadable through Chrome Trace Viewer
 


Sent from my iPhone

On 6 Dec 2017, at 4:17 am, Brian Cain <[hidden email]> wrote:



On Tue, Dec 5, 2017 at 9:49 AM, Dean Michael Berris via cfe-dev <[hidden email]> wrote:
Hi cfe-dev@ and llvm-dev@,

I've attached a Chrome trace-viewer readable trace of a clang built with XRay instrumentation (additional build/link flags="-fxray-instrument -fxray-instruction-threshold=75") with the latest "top-of-trunk" version of clang with the recent updates to the XRay runtime supporting record filtering.

To load the attached file, go to 'chrome://tracing' in your Chrome/Chromium browser and load the .gz file directly. Pressing '?' should give a help dialog.



This is an interesting feature.  Is it designed to accept arbitrary xray trace logs or only ones for/from Chrome/ium?


Yes, it works on any XRay trace generated with the logging implementations that come with XRay in compiler-rt.

The example attached was of an instrumented Clang binary compiling C++ code. 😁

The caveat is, while the tool (llvm-xray convert) can generate arbitrarily large Chrome-loadable traces, the Chrome trace viewer can only handle so much data.

Cheers

-- Dean


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev