Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 
0003 #include "../../../util/cpumap.h"
0004 #include "../../../util/pmu.h"
0005 
0006 const struct pmu_events_table *pmu_events_table__find(void)
0007 {
0008     struct perf_pmu *pmu = NULL;
0009 
0010     while ((pmu = perf_pmu__scan(pmu))) {
0011         if (!is_pmu_core(pmu->name))
0012             continue;
0013 
0014         /*
0015          * The cpumap should cover all CPUs. Otherwise, some CPUs may
0016          * not support some events or have different event IDs.
0017          */
0018         if (pmu->cpus->nr != cpu__max_cpu().cpu)
0019             return NULL;
0020 
0021         return perf_pmu__find_table(pmu);
0022     }
0023 
0024     return NULL;
0025 }