Lines Matching refs:pmu
67 struct perf_pmu *pmu, *tmp; in perf_pmus__destroy() local
69 list_for_each_entry_safe(pmu, tmp, &core_pmus, list) { in perf_pmus__destroy()
70 list_del(&pmu->list); in perf_pmus__destroy()
72 perf_pmu__delete(pmu); in perf_pmus__destroy()
74 list_for_each_entry_safe(pmu, tmp, &other_pmus, list) { in perf_pmus__destroy()
75 list_del(&pmu->list); in perf_pmus__destroy()
77 perf_pmu__delete(pmu); in perf_pmus__destroy()
85 struct perf_pmu *pmu; in pmu_find() local
87 list_for_each_entry(pmu, &core_pmus, list) { in pmu_find()
88 if (!strcmp(pmu->name, name) || in pmu_find()
89 (pmu->alias_name && !strcmp(pmu->alias_name, name))) in pmu_find()
90 return pmu; in pmu_find()
92 list_for_each_entry(pmu, &other_pmus, list) { in pmu_find()
93 if (!strcmp(pmu->name, name) || in pmu_find()
94 (pmu->alias_name && !strcmp(pmu->alias_name, name))) in pmu_find()
95 return pmu; in pmu_find()
103 struct perf_pmu *pmu; in perf_pmus__find() local
112 pmu = pmu_find(name); in perf_pmus__find()
113 if (pmu) in perf_pmus__find()
114 return pmu; in perf_pmus__find()
124 pmu = perf_pmu__lookup(core_pmu ? &core_pmus : &other_pmus, dirfd, name); in perf_pmus__find()
127 return pmu; in perf_pmus__find()
132 struct perf_pmu *pmu; in perf_pmu__find2() local
140 pmu = pmu_find(name); in perf_pmu__find2()
141 if (pmu) in perf_pmu__find2()
142 return pmu; in perf_pmu__find2()
218 struct perf_pmu *pmu; in __perf_pmus__find_by_type() local
220 list_for_each_entry(pmu, &core_pmus, list) { in __perf_pmus__find_by_type()
221 if (pmu->type == type) in __perf_pmus__find_by_type()
222 return pmu; in __perf_pmus__find_by_type()
225 list_for_each_entry(pmu, &other_pmus, list) { in __perf_pmus__find_by_type()
226 if (pmu->type == type) in __perf_pmus__find_by_type()
227 return pmu; in __perf_pmus__find_by_type()
234 struct perf_pmu *pmu = __perf_pmus__find_by_type(type); in perf_pmus__find_by_type() local
236 if (pmu || read_sysfs_all_pmus) in perf_pmus__find_by_type()
237 return pmu; in perf_pmus__find_by_type()
240 pmu = __perf_pmus__find_by_type(type); in perf_pmus__find_by_type()
241 return pmu; in perf_pmus__find_by_type()
248 struct perf_pmu *perf_pmus__scan(struct perf_pmu *pmu) in perf_pmus__scan() argument
250 bool use_core_pmus = !pmu || pmu->is_core; in perf_pmus__scan()
252 if (!pmu) { in perf_pmus__scan()
254 pmu = list_prepare_entry(pmu, &core_pmus, list); in perf_pmus__scan()
257 list_for_each_entry_continue(pmu, &core_pmus, list) in perf_pmus__scan()
258 return pmu; in perf_pmus__scan()
260 pmu = NULL; in perf_pmus__scan()
261 pmu = list_prepare_entry(pmu, &other_pmus, list); in perf_pmus__scan()
263 list_for_each_entry_continue(pmu, &other_pmus, list) in perf_pmus__scan()
264 return pmu; in perf_pmus__scan()
268 struct perf_pmu *perf_pmus__scan_core(struct perf_pmu *pmu) in perf_pmus__scan_core() argument
270 if (!pmu) { in perf_pmus__scan_core()
272 return list_first_entry_or_null(&core_pmus, typeof(*pmu), list); in perf_pmus__scan_core()
274 list_for_each_entry_continue(pmu, &core_pmus, list) in perf_pmus__scan_core()
275 return pmu; in perf_pmus__scan_core()
280 static struct perf_pmu *perf_pmus__scan_skip_duplicates(struct perf_pmu *pmu) in perf_pmus__scan_skip_duplicates() argument
282 bool use_core_pmus = !pmu || pmu->is_core; in perf_pmus__scan_skip_duplicates()
284 const char *last_pmu_name = (pmu && pmu->name) ? pmu->name : ""; in perf_pmus__scan_skip_duplicates()
286 if (!pmu) { in perf_pmus__scan_skip_duplicates()
288 pmu = list_prepare_entry(pmu, &core_pmus, list); in perf_pmus__scan_skip_duplicates()
290 last_pmu_name_len = pmu_name_len_no_suffix(pmu->name ?: "", NULL); in perf_pmus__scan_skip_duplicates()
293 list_for_each_entry_continue(pmu, &core_pmus, list) { in perf_pmus__scan_skip_duplicates()
294 int pmu_name_len = pmu_name_len_no_suffix(pmu->name ?: "", /*num=*/NULL); in perf_pmus__scan_skip_duplicates()
297 !strncmp(last_pmu_name, pmu->name ?: "", pmu_name_len)) in perf_pmus__scan_skip_duplicates()
300 return pmu; in perf_pmus__scan_skip_duplicates()
302 pmu = NULL; in perf_pmus__scan_skip_duplicates()
303 pmu = list_prepare_entry(pmu, &other_pmus, list); in perf_pmus__scan_skip_duplicates()
305 list_for_each_entry_continue(pmu, &other_pmus, list) { in perf_pmus__scan_skip_duplicates()
306 int pmu_name_len = pmu_name_len_no_suffix(pmu->name ?: "", /*num=*/NULL); in perf_pmus__scan_skip_duplicates()
309 !strncmp(last_pmu_name, pmu->name ?: "", pmu_name_len)) in perf_pmus__scan_skip_duplicates()
312 return pmu; in perf_pmus__scan_skip_duplicates()
319 struct perf_pmu *pmu = NULL; in perf_pmus__pmu_for_pmu_filter() local
321 while ((pmu = perf_pmus__scan(pmu)) != NULL) { in perf_pmus__pmu_for_pmu_filter()
322 if (!strcmp(pmu->name, str)) in perf_pmus__pmu_for_pmu_filter()
323 return pmu; in perf_pmus__pmu_for_pmu_filter()
325 if (!strncmp(pmu->name, "uncore_", 7)) { in perf_pmus__pmu_for_pmu_filter()
326 if (!strcmp(pmu->name + 7, str)) in perf_pmus__pmu_for_pmu_filter()
327 return pmu; in perf_pmus__pmu_for_pmu_filter()
330 if (!strncmp(pmu->name, "cpu_", 4)) { in perf_pmus__pmu_for_pmu_filter()
331 if (!strcmp(pmu->name + 4, str)) in perf_pmus__pmu_for_pmu_filter()
332 return pmu; in perf_pmus__pmu_for_pmu_filter()
347 const struct perf_pmu *pmu; member
376 a_iscpu = as->pmu ? as->pmu->is_core : true; in cmp_sevent()
377 b_iscpu = bs->pmu ? bs->pmu->is_core : true; in cmp_sevent()
382 if (as->pmu != bs->pmu) { in cmp_sevent()
415 pr_err("Unexpected event %s/%s/\n", info->pmu->name, info->name); in perf_pmus__print_pmu_events__callback()
419 s->pmu = info->pmu; in perf_pmus__print_pmu_events__callback()
437 struct perf_pmu *pmu; in perf_pmus__print_pmu_events() local
450 pmu = NULL; in perf_pmus__print_pmu_events()
452 while ((pmu = scan_fn(pmu)) != NULL) in perf_pmus__print_pmu_events()
453 len += perf_pmu__num_events(pmu); in perf_pmus__print_pmu_events()
460 pmu = NULL; in perf_pmus__print_pmu_events()
466 while ((pmu = scan_fn(pmu)) != NULL) { in perf_pmus__print_pmu_events()
467 perf_pmu__for_each_event(pmu, skip_duplicate_pmus, &state, in perf_pmus__print_pmu_events()
505 struct perf_pmu *pmu = perf_pmus__find(pname); in perf_pmus__have_event() local
507 return pmu && perf_pmu__have_event(pmu, name); in perf_pmus__have_event()
515 struct perf_pmu *pmu = NULL; in perf_pmus__num_core_pmus() local
517 while ((pmu = perf_pmus__scan_core(pmu)) != NULL) in perf_pmus__num_core_pmus()
525 struct perf_pmu *pmu = NULL; in __perf_pmus__supports_extended_type() local
530 while ((pmu = perf_pmus__scan_core(pmu)) != NULL) { in __perf_pmus__supports_extended_type()
531 …if (!is_event_supported(PERF_TYPE_HARDWARE, PERF_COUNT_HW_CPU_CYCLES | ((__u64)pmu->type << PERF_P… in __perf_pmus__supports_extended_type()
589 struct perf_pmu *pmu = evsel->pmu; in evsel__find_pmu() local
591 if (!pmu) { in evsel__find_pmu()
592 pmu = perf_pmus__find_by_type(evsel->core.attr.type); in evsel__find_pmu()
593 ((struct evsel *)evsel)->pmu = pmu; in evsel__find_pmu()
595 return pmu; in evsel__find_pmu()
600 struct perf_pmu *pmu = NULL; in perf_pmus__find_core_pmu() local
602 while ((pmu = perf_pmus__scan_core(pmu))) { in perf_pmus__find_core_pmu()
607 if (RC_CHK_ACCESS(pmu->cpus)->nr != cpu__max_cpu().cpu) in perf_pmus__find_core_pmu()
610 return pmu; in perf_pmus__find_core_pmu()