diff options
author | Adam Nemet <anemet@apple.com> | 2017-11-14 16:59:18 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2017-11-14 16:59:18 +0000 |
commit | d90634bed100c30d2e13bf8e8c4d5eb5735ba05d (patch) | |
tree | 0c30a5f1f6569b9a86fd5e374b6614a8969a4c56 | |
parent | fc109b02f43ed4fb0db0fefd272f31984c809983 (diff) |
[llvm-profdata] Report if profile data file is IR- or FE-level
Differential Revision: https://reviews.llvm.org/D39997
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318159 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/tools/llvm-profdata/show-instr-level.test | 7 | ||||
-rw-r--r-- | tools/llvm-profdata/llvm-profdata.cpp | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/test/tools/llvm-profdata/show-instr-level.test b/test/tools/llvm-profdata/show-instr-level.test new file mode 100644 index 00000000000..ed003265e38 --- /dev/null +++ b/test/tools/llvm-profdata/show-instr-level.test @@ -0,0 +1,7 @@ +RUN: llvm-profdata merge -o %t_clang.profdata %p/Inputs/clang_profile.proftext +RUN: llvm-profdata show %t_clang.profdata | FileCheck %s -check-prefix=FE +FE: Instrumentation level: Front-end + +RUN: llvm-profdata merge -o %t_ir.profdata %p/Inputs/IR_profile.proftext +RUN: llvm-profdata show %t_ir.profdata | FileCheck %s -check-prefix=IR +IR: Instrumentation level: IR diff --git a/tools/llvm-profdata/llvm-profdata.cpp b/tools/llvm-profdata/llvm-profdata.cpp index 8e21a7a9b4f..000bca2bd07 100644 --- a/tools/llvm-profdata/llvm-profdata.cpp +++ b/tools/llvm-profdata/llvm-profdata.cpp @@ -625,6 +625,8 @@ static int showInstrProfile(const std::string &Filename, bool ShowCounts, if (ShowCounts && TextFormat) return 0; std::unique_ptr<ProfileSummary> PS(Builder.getSummary()); + OS << "Instrumentation level: " + << (Reader->isIRLevelProfile() ? "IR" : "Front-end") << "\n"; if (ShowAllFunctions || !ShowFunction.empty()) OS << "Functions shown: " << ShownFunctions << "\n"; OS << "Total functions: " << PS->getNumFunctions() << "\n"; |