Dean Michael Berris via llvm-dev
2017-Dec-05 15:49 UTC
[llvm-dev] XRay Trace of Clang, Loadable through Chrome Trace Viewer
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: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2017-12-06 at 02.38.30.png Type: image/png Size: 662861 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171206/69e9da9d/attachment-0001.png> -------------- next part -------------- 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! -------------- next part -------------- A non-text attachment was scrubbed... Name: clang-6.0-default-real.txt.gz Type: application/x-gzip Size: 643448 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171206/69e9da9d/attachment-0001.bin>
Brian Cain via llvm-dev
2017-Dec-05 17:17 UTC
[llvm-dev] [cfe-dev] XRay Trace of Clang, Loadable through Chrome Trace Viewer
On Tue, Dec 5, 2017 at 9:49 AM, Dean Michael Berris via cfe-dev < cfe-dev at lists.llvm.org> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171205/3045cd94/attachment.html>
Dean Michael Berris via llvm-dev
2017-Dec-05 20:52 UTC
[llvm-dev] [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 <brian.cain at gmail.com> wrote: > > > >> On Tue, Dec 5, 2017 at 9:49 AM, Dean Michael Berris via cfe-dev <cfe-dev at lists.llvm.org> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171206/42ffb362/attachment.html>
Maybe Matching Threads
- [cfe-dev] XRay Trace of Clang, Loadable through Chrome Trace Viewer
- Using Xray compilation with C programs
- [XRay] Build instrumented Clang, some analysis results
- [X-ray] How to check successful instrumentation and generate call trace?
- [llvm-xray] llvm-xray cannot log every functions