summaryrefslogtreecommitdiff
path: root/tools/perf/util/cputopo.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/cputopo.c')
-rw-r--r--tools/perf/util/cputopo.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/tools/perf/util/cputopo.c b/tools/perf/util/cputopo.c
index 729142ec9a9a..81cfc85f4668 100644
--- a/tools/perf/util/cputopo.c
+++ b/tools/perf/util/cputopo.c
@@ -472,15 +472,9 @@ struct hybrid_topology *hybrid_topology__new(void)
{
struct perf_pmu *pmu = NULL;
struct hybrid_topology *tp = NULL;
- u32 nr = 0, i = 0;
+ int nr = perf_pmus__num_core_pmus(), i = 0;
- if (!perf_pmus__has_hybrid())
- return NULL;
-
- while ((pmu = perf_pmus__scan_core(pmu)) != NULL)
- nr++;
-
- if (nr == 0)
+ if (nr <= 1)
return NULL;
tp = zalloc(sizeof(*tp) + sizeof(tp->nodes[0]) * nr);