[02/20] perf tools: Use pmu info in evsel__is_hybrid()

Message ID 20221018020227.85905-3-namhyung@kernel.org
State New
Headers
Series perf stat: Cleanup counter aggregation (v3) |

Commit Message

Namhyung Kim Oct. 18, 2022, 2:02 a.m. UTC
  If evsel has pmu, it can use pmu->is_hybrid directly.

Acked-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/evsel.c | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index b7140beca970..c9fef26d0702 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -3131,6 +3131,9 @@  void evsel__zero_per_pkg(struct evsel *evsel)
 
 bool evsel__is_hybrid(struct evsel *evsel)
 {
+	if (evsel->pmu)
+		return evsel->pmu->is_hybrid;
+
 	return evsel->pmu_name && perf_pmu__is_hybrid(evsel->pmu_name);
 }