[lld][ELF] Add additional time trace categories

I noticed when running a large link with the --time-trace option that
there were several areas which were missing any specific time trace
categories (aside from the generic link/ExecuteLinker categories). This
patch adds new categories to fill most of the "gaps", or to provide more
detail than was previously provided.

Reviewed by: MaskRay, grimar, russell.gallop

Differential Revision: https://reviews.llvm.org/D90686
This commit is contained in:
James Henderson
2020-11-03 14:41:09 +00:00
parent fd407e1f1e
commit 439341b9bf
8 changed files with 210 additions and 137 deletions

View File

@@ -32,6 +32,7 @@
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/TimeProfiler.h"
#include <cassert>
#include <limits>
#include <vector>
@@ -1620,17 +1621,23 @@ std::pair<uint32_t, uint32_t> ScriptParser::readMemoryAttributes() {
}
void elf::readLinkerScript(MemoryBufferRef mb) {
llvm::TimeTraceScope timeScope("Read linker script",
mb.getBufferIdentifier());
ScriptParser(mb).readLinkerScript();
}
void elf::readVersionScript(MemoryBufferRef mb) {
llvm::TimeTraceScope timeScope("Read version script",
mb.getBufferIdentifier());
ScriptParser(mb).readVersionScript();
}
void elf::readDynamicList(MemoryBufferRef mb) {
llvm::TimeTraceScope timeScope("Read dynamic list", mb.getBufferIdentifier());
ScriptParser(mb).readDynamicList();
}
void elf::readDefsym(StringRef name, MemoryBufferRef mb) {
llvm::TimeTraceScope timeScope("Read defsym input", name);
ScriptParser(mb).readDefsym(name);
}