[PATCH] D69043: [RFC] Adding time-trace to LLD?

Russell Gallop via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 16 08:18:19 PDT 2019


russell.gallop created this revision.
russell.gallop added reviewers: ruiu, pcc, anton-afanasyev.
Herald added subscribers: cfe-commits, dexonsmith, MaskRay, hiraditya, arichardson, mehdi_amini, emaste.
Herald added a reviewer: espindola.
Herald added projects: clang, LLVM.

The clang -ftime-trace feature is useful for analysing build time in compiles. I've been experimenting with adding time-trace support to LLD for analysing link times.

Adding the option -time-trace produces a .json file alongside the output ELF file (just ELF so far). This works for LTO and ThinLTO, picking up the relevant markers from LLVM. Example ThinLTO build:
F10284608: ThinLTOTimeTrace.PNG <https://reviews.llvm.org/F10284608>

This is still work in progress so shouldn't be submitted in its present state. There are a few things that still need doing:

- Improve how events are collected. (The current method combines multiple threads (ThinLTO) in one stack with a mutex which won't scale well. Making this thread local would probably be better.)
- Adding test(s)
- Re-enable the assertion for monotonically increasing times which I don't have working yet.

Do people think that this will be useful/worth pursuing?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69043

Files:
  clang/tools/driver/cc1_main.cpp
  lld/ELF/Driver.cpp
  lld/ELF/ICF.cpp
  lld/ELF/MarkLive.cpp
  lld/ELF/Options.td
  lld/ELF/Writer.cpp
  llvm/include/llvm/Support/TimeProfiler.h
  llvm/lib/Support/TimeProfiler.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69043.225224.patch
Type: text/x-patch
Size: 13637 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191016/afade746/attachment.bin>


More information about the cfe-commits mailing list