From 4d837fce884b55cdd2d546ed81008e6a3d2d23d0 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Sun, 28 Oct 2018 19:09:14 +0000 Subject: [PATCH] [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 llvm-svn: 345480 --- llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp index 3f13c46..437503f 100644 --- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp @@ -61,13 +61,14 @@ private: // (e.g. P23 on SandyBridge). int64_t CounterValue = 0; llvm::SmallVector 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(); { -- 2.7.4