[llvm-exegesis] Fix SNB counter definition and handling.
authorClement Courbet <courbet@google.com>
Sun, 28 Oct 2018 19:09:14 +0000 (19:09 +0000)
committerClement Courbet <courbet@google.com>
Sun, 28 Oct 2018 19:09:14 +0000 (19:09 +0000)
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

index 3f13c46..437503f 100644 (file)
@@ -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();
       {