This is an archive of the discontinued LLVM Phabricator instance.

[lld, ELF and mac] Add --time-trace=<file>, remove --time-trace-file=<file>
ClosedPublic

Authored by thakis on Jun 23 2022, 9:18 AM.

Details

Summary

--time-trace=foo has the same behavior as --time-trace --time-trace-file=<file>
had previously.

Also, for mac, make --time-trace-granularity *not* imply --time-trace, to match
behavior of the ELF port.


My goal here is to have a short, single flag I can use to get LLD to write a trace, and to make ELF and MachO (and, in time, COFF – this requires teaching TimeProfiler to write a short summary to stdout and to switch lld/COFF to TimeTraceScope) behave the same way.

Diff Detail

Event Timeline

thakis created this revision.Jun 23 2022, 9:18 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 23 2022, 9:18 AM
thakis requested review of this revision.Jun 23 2022, 9:18 AM

To have a single option, I suggest --time-trace=file beside the existing --time-trace.
You may even remove --time-trace-file=file. The options are for debugging and analysis, and do not need strong compatibility.

thakis updated this revision to Diff 439494.Jun 23 2022, 12:17 PM
thakis retitled this revision from [lld ELF and mac] Add --trace-to=<file> as short for --time-trace --time-trace-file=<file> to [lld, ELF and mac] Add --time-trace=<file>, remove --time-trace-file=<file>.
thakis edited the summary of this revision. (Show Details)

Good suggestion, thanks. Done.

thakis updated this revision to Diff 439497.Jun 23 2022, 12:22 PM

simpler (?) impl by making --time-trace an alias for --time-trace= (without an arg)

Add an item to lld/docs/ReleaseNotes.rst "Breaking changes"

lld/ELF/Options.td
411–414

Use def time_trace

413

An alias does not need a name.

thakis updated this revision to Diff 439499.Jun 23 2022, 12:30 PM
thakis marked an inline comment as done.

address most comments

lld/ELF/Options.td
411–414

why? it's an _eq option, no?

MaskRay accepted this revision.Jun 23 2022, 12:33 PM
MaskRay added inline comments.
lld/ELF/Options.td
411–414

Using _eq looks good.

lld/docs/ReleaseNotes.rst
44
``--time-trace-file=<file>`` has been removed. Use ``--time-trace=<file>`` instead.
(`D128451 <https://reviews.llvm.org/D128451>`_)
This revision is now accepted and ready to land.Jun 23 2022, 12:33 PM
thakis marked an inline comment as done.Jun 23 2022, 12:46 PM

Thanks!

Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2022, 12:48 PM