aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-profgen/llvm-profgen.cpp
diff options
context:
space:
mode:
authormingmingl <mingmingl@google.com>2025-07-10 10:46:01 -0700
committermingmingl <mingmingl@google.com>2025-07-10 10:46:01 -0700
commitd569960a63ac77a6042ea579506dc48373b7da65 (patch)
tree2f7a70c38fa8a9d32e869b221c093e7e0d542ab7 /llvm/tools/llvm-profgen/llvm-profgen.cpp
parentc92d5dad67aafded296653c2b9a369a7fe24ba13 (diff)
downloadllvm-users/mingmingl-llvm/llvm-profgen.zip
llvm-users/mingmingl-llvm/llvm-profgen.tar.gz
llvm-users/mingmingl-llvm/llvm-profgen.tar.bz2
Extend llvm-profgen to generate vtable profilesusers/mingmingl-llvm/llvm-profgen
Diffstat (limited to 'llvm/tools/llvm-profgen/llvm-profgen.cpp')
-rw-r--r--llvm/tools/llvm-profgen/llvm-profgen.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/tools/llvm-profgen/llvm-profgen.cpp b/llvm/tools/llvm-profgen/llvm-profgen.cpp
index 3b974e2..d8af0ac 100644
--- a/llvm/tools/llvm-profgen/llvm-profgen.cpp
+++ b/llvm/tools/llvm-profgen/llvm-profgen.cpp
@@ -67,6 +67,11 @@ static cl::opt<std::string> DebugBinPath(
"from it instead of the executable binary."),
cl::cat(ProfGenCategory));
+static cl::opt<std::string> DataAccessProfileFilename(
+ "data-access-profile", cl::value_desc("data-access-profile"),
+ cl::desc("Path of the data access profile to be generated."),
+ cl::cat(ProfGenCategory));
+
extern cl::opt<bool> ShowDisassemblyOnly;
extern cl::opt<bool> ShowSourceLocations;
extern cl::opt<bool> SkipSymbolization;
@@ -179,6 +184,13 @@ int main(int argc, const char *argv[]) {
// Parse perf events and samples
Reader->parsePerfTraces();
+ if (!DataAccessProfileFilename.empty()) {
+ // Parse the data access perf traces into <ip, data-addr> pairs, symbolize
+ // the data-addr to data-symbol. If the data-addr is a vtable, increment
+ // counters for the <ip, data-symbol> pair.
+ Reader->parseDataAccessPerfTraces(DataAccessProfileFilename, PIDFilter);
+ }
+
if (SkipSymbolization)
return EXIT_SUCCESS;