From: Clement Courbet Date: Sun, 28 Oct 2018 19:09:14 +0000 (+0000) Subject: [llvm-exegesis] Fix SNB counter definition and handling. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d837fce884b55cdd2d546ed81008e6a3d2d23d0;p=platform%2Fupstream%2Fllvm.git [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 --- 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(); {