Skip to content

Commit 8f59bfa

Browse files
committed
Add cmdline option --load-function-from-symbol
1 parent 5eead6b commit 8f59bfa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

llvm/tools/llvm-profgen/ProfiledBinary.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ static cl::list<std::string> DisassembleFunctions(
6565
"names only. Only work with show-disassembly-only"),
6666
cl::cat(ProfGenCategory));
6767

68+
static cl::opt<bool>
69+
LoadFunctionFromSymbol("load-function-from-symbol",
70+
cl::desc("Gather additional binary function info "
71+
"from symbols (e.g. .symtab) in case "
72+
"dwarf info is incomplete."),
73+
cl::cat(ProfGenCategory));
74+
6875
static cl::opt<bool>
6976
KernelBinary("kernel",
7077
cl::desc("Generate the profile for Linux kernel binary."),
@@ -257,7 +264,8 @@ void ProfiledBinary::load() {
257264
if (ShowDisassemblyOnly)
258265
decodePseudoProbe(Obj);
259266

260-
populateSymbolsFromBinary(Obj);
267+
if (LoadFunctionFromSymbol || UsePseudoProbes)
268+
populateSymbolsFromBinary(Obj);
261269

262270
// Disassemble the text sections.
263271
disassemble(Obj);

0 commit comments

Comments
 (0)