[llvm] [gold] Enable time trace profiler in LLVMgold (PR #94293)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 4 08:42:35 PDT 2024
================
@@ -1113,6 +1131,19 @@ static ld_plugin_status allSymbolsReadHook() {
if (unsigned NumOpts = options::extra.size())
cl::ParseCommandLineOptions(NumOpts, &options::extra[0]);
+ // Initialize time trace profiler
+ if (!options::time_trace_file.empty())
+ llvm::timeTraceProfilerInitialize(options::time_trace_granularity,
+ options::extra.size() ? options::extra[0]
+ : "LLVMgold");
----------------
teresajohnson wrote:
At https://github.com/llvm/llvm-project/blob/6cd86d0fae8cbb752a713860f131b9b759b2cbb8/llvm/tools/gold/gold-plugin.cpp#L316 we set extra[0] to "LLVMgold" if extra is empty, so this shouldn't be needed (extra should never be empty and extra[0] can always be used).
https://github.com/llvm/llvm-project/pull/94293
More information about the llvm-commits
mailing list