Lines Matching refs:pmu
659 static char *perf_pmu__getcpuid(struct perf_pmu *pmu) in perf_pmu__getcpuid() argument
668 cpuid = get_cpuid_str(pmu); in perf_pmu__getcpuid()
679 struct pmu_events_map *perf_pmu__find_map(struct perf_pmu *pmu) in perf_pmu__find_map() argument
682 char *cpuid = perf_pmu__getcpuid(pmu); in perf_pmu__find_map()
751 static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu) in pmu_add_cpu_aliases() argument
755 const char *name = pmu->name; in pmu_add_cpu_aliases()
757 map = perf_pmu__find_map(pmu); in pmu_add_cpu_aliases()
768 const char *pname = pe->pmu ? pe->pmu : cpu_name; in pmu_add_cpu_aliases()
795 perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused) in perf_pmu__get_default_config()
815 struct perf_pmu *pmu; in pmu_lookup() local
837 pmu = zalloc(sizeof(*pmu)); in pmu_lookup()
838 if (!pmu) in pmu_lookup()
841 pmu->cpus = pmu_cpumask(name); in pmu_lookup()
842 pmu->name = strdup(name); in pmu_lookup()
843 pmu->type = type; in pmu_lookup()
844 pmu->is_uncore = pmu_is_uncore(name); in pmu_lookup()
845 pmu->max_precise = pmu_max_precise(name); in pmu_lookup()
846 pmu_add_cpu_aliases(&aliases, pmu); in pmu_lookup()
848 INIT_LIST_HEAD(&pmu->format); in pmu_lookup()
849 INIT_LIST_HEAD(&pmu->aliases); in pmu_lookup()
850 list_splice(&format, &pmu->format); in pmu_lookup()
851 list_splice(&aliases, &pmu->aliases); in pmu_lookup()
852 list_add_tail(&pmu->list, &pmus); in pmu_lookup()
854 pmu->default_config = perf_pmu__get_default_config(pmu); in pmu_lookup()
856 return pmu; in pmu_lookup()
861 struct perf_pmu *pmu; in pmu_find() local
863 list_for_each_entry(pmu, &pmus, list) in pmu_find()
864 if (!strcmp(pmu->name, name)) in pmu_find()
865 return pmu; in pmu_find()
870 struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu) in perf_pmu__scan() argument
876 if (!pmu) { in perf_pmu__scan()
878 pmu = list_prepare_entry(pmu, &pmus, list); in perf_pmu__scan()
880 list_for_each_entry_continue(pmu, &pmus, list) in perf_pmu__scan()
881 return pmu; in perf_pmu__scan()
887 struct perf_pmu *pmu; in perf_pmu__find() local
894 pmu = pmu_find(name); in perf_pmu__find()
895 if (pmu) in perf_pmu__find()
896 return pmu; in perf_pmu__find()
1143 int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr, in perf_pmu__config() argument
1147 bool zero = !!pmu->default_config; in perf_pmu__config()
1149 attr->type = pmu->type; in perf_pmu__config()
1150 return perf_pmu__config_terms(&pmu->format, attr, head_terms, in perf_pmu__config()
1154 static struct perf_pmu_alias *pmu_find_alias(struct perf_pmu *pmu, in pmu_find_alias() argument
1166 if (pmu_find_format(&pmu->format, term->config)) in pmu_find_alias()
1177 list_for_each_entry(alias, &pmu->aliases, list) { in pmu_find_alias()
1214 int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms, in perf_pmu__check_alias() argument
1234 alias = pmu_find_alias(pmu, term); in perf_pmu__check_alias()
1315 static char *format_alias(char *buf, int len, struct perf_pmu *pmu, in format_alias() argument
1319 int used = snprintf(buf, len, "%s/%s", pmu->name, alias->name); in format_alias()
1341 static char *format_alias_or(char *buf, int len, struct perf_pmu *pmu, in format_alias_or() argument
1344 snprintf(buf, len, "%s OR %s/%s/", alias->name, pmu->name, alias->name); in format_alias_or()
1353 char *pmu; member
1399 struct perf_pmu *pmu; in print_pmu_events() local
1409 pmu = NULL; in print_pmu_events()
1411 while ((pmu = perf_pmu__scan(pmu)) != NULL) { in print_pmu_events()
1412 list_for_each_entry(alias, &pmu->aliases, list) in print_pmu_events()
1414 if (pmu->selectable) in print_pmu_events()
1420 pmu = NULL; in print_pmu_events()
1422 while ((pmu = perf_pmu__scan(pmu)) != NULL) { in print_pmu_events()
1423 list_for_each_entry(alias, &pmu->aliases, list) { in print_pmu_events()
1425 format_alias(buf, sizeof(buf), pmu, alias); in print_pmu_events()
1426 bool is_cpu = !strcmp(pmu->name, "cpu"); in print_pmu_events()
1437 name = format_alias_or(buf, sizeof(buf), pmu, alias); in print_pmu_events()
1443 pmu, alias); in print_pmu_events()
1452 aliases[j].pmu = pmu->name; in print_pmu_events()
1457 if (pmu->selectable && in print_pmu_events()
1458 (event_glob == NULL || strglobmatch(pmu->name, event_glob))) { in print_pmu_events()
1460 if (asprintf(&s, "%s//", pmu->name) < 0) in print_pmu_events()
1490 printf("%*s%s/%s/ ", 8, "", aliases[j].pmu, aliases[j].str); in print_pmu_events()
1517 struct perf_pmu *pmu; in pmu_have_event() local
1520 pmu = NULL; in pmu_have_event()
1521 while ((pmu = perf_pmu__scan(pmu)) != NULL) { in pmu_have_event()
1522 if (strcmp(pname, pmu->name)) in pmu_have_event()
1524 list_for_each_entry(alias, &pmu->aliases, list) in pmu_have_event()
1531 static FILE *perf_pmu__open_file(struct perf_pmu *pmu, const char *name) in perf_pmu__open_file() argument
1542 "%s" EVENT_SOURCE_DEVICE_PATH "%s/%s", sysfs, pmu->name, name); in perf_pmu__open_file()
1550 int perf_pmu__scan_file(struct perf_pmu *pmu, const char *name, const char *fmt, in perf_pmu__scan_file() argument
1558 file = perf_pmu__open_file(pmu, name); in perf_pmu__scan_file()