[llvm] r345480 - [llvm-exegesis] Fix SNB counter definition and handling.
Clement Courbet via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 28 12:09:14 PDT 2018
Author: courbet
Date: Sun Oct 28 12:09:14 2018
New Revision: 345480
URL: http://llvm.org/viewvc/llvm-project?rev=345480&view=rev
Log:
[llvm-exegesis] Fix SNB counter definition and handling.
Summary: SNB is the only one that has P23 as a single proc res.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D53766
Modified:
llvm/trunk/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
Modified: llvm/trunk/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/BenchmarkRunner.cpp?rev=345480&r1=345479&r2=345480&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/BenchmarkRunner.cpp (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/BenchmarkRunner.cpp Sun Oct 28 12:09:14 2018
@@ -61,13 +61,14 @@ private:
// (e.g. P23 on SandyBridge).
int64_t CounterValue = 0;
llvm::SmallVector<llvm::StringRef, 2> CounterNames;
- llvm::StringRef(Counters).split(CounterNames, ',');
+ llvm::StringRef(Counters).split(CounterNames, '+');
char *const ScratchPtr = Scratch->ptr();
- for (const auto &CounterName : CounterNames) {
+ for (auto &CounterName : CounterNames) {
+ CounterName = CounterName.trim();
pfm::PerfEvent PerfEvent(CounterName);
if (!PerfEvent.valid())
llvm::report_fatal_error(
- llvm::Twine("invalid perf event ").concat(Counters));
+ llvm::Twine("invalid perf event '").concat(CounterName).concat("'"));
pfm::Counter Counter(PerfEvent);
Scratch->clear();
{
More information about the llvm-commits
mailing list