aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-profgen/llvm-profgen.cpp
diff options
context:
space:
mode:
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;