Lines Matching full:pmu

4 #include "pmu.h"
12 #include "../pmu-events/pmu-events.h"
22 /* used for matching against events from generated pmu-events.c */
36 /* PMU which we should match against */
41 struct perf_pmu pmu; member
47 .pmu = "default_core",
59 .pmu = "default_core",
71 .pmu = "default_core",
83 .pmu = "default_core",
95 .pmu = "default_core",
107 .pmu = "default_core",
135 .pmu = "hisi_sccl,ddrc",
149 .pmu = "uncore_cbox",
163 .pmu = "uncore_cbox",
177 .pmu = "uncore_cbox",
191 .pmu = "hisi_sccl,l3c",
205 .pmu = "uncore_imc_free_running",
219 .pmu = "uncore_imc",
243 .pmu = "uncore_sys_ddr_pmu",
257 .pmu = "uncore_sys_ccn_pmu",
323 if (!is_same(e1->pmu, e2->pmu)) { in compare_pmu_events()
324 pr_debug2("testing event e1 %s: mismatched pmu string, %s vs %s\n", in compare_pmu_events()
325 e1->name, e1->pmu, e2->pmu); in compare_pmu_events()
358 pr_debug("testing aliases PMU %s: mismatched name, %s vs %s\n", in compare_alias_to_test_event()
364 pr_debug("testing aliases PMU %s: mismatched desc, %s vs %s\n", in compare_alias_to_test_event()
370 pr_debug("testing aliases PMU %s: mismatched long_desc, %s vs %s\n", in compare_alias_to_test_event()
377 pr_debug("testing aliases PMU %s: mismatched topic, %s vs %s\n", in compare_alias_to_test_event()
383 pr_debug("testing aliases PMU %s: mismatched str, %s vs %s\n", in compare_alias_to_test_event()
389 pr_debug("testing aliases PMU %s: mismatched long desc, %s vs %s\n", in compare_alias_to_test_event()
394 if (!is_same(alias->pmu_name, test_event->event.pmu) && in compare_alias_to_test_event()
396 pr_debug("testing aliases PMU %s: mismatched pmu_name, %s vs %s\n", in compare_alias_to_test_event()
397 pmu_name, alias->pmu_name, test_event->event.pmu); in compare_alias_to_test_event()
412 if (strcmp(pe->pmu, "default_core")) in test__pmu_event_table_core_callback()
469 /* Verify generated events from pmu-events.c are as expected */
486 err = pmu_events_table__for_each_event(table, /*pmu=*/ NULL, in test__pmu_event_table()
492 err = pmu_events_table__for_each_event(sys_event_table, /*pmu=*/ NULL, in test__pmu_event_table()
516 if (compare_alias_to_test_event(alias, args->test_event, alias->pmu->name)) in test_core_pmu_event_aliases_cb()
519 pr_debug2("testing aliases core PMU %s: matched event %s\n", in test_core_pmu_event_aliases_cb()
528 struct perf_pmu *pmu; in __test_core_pmu_event_aliases() local
537 pmu = zalloc(sizeof(*pmu)); in __test_core_pmu_event_aliases()
538 if (!pmu) in __test_core_pmu_event_aliases()
541 INIT_LIST_HEAD(&pmu->format); in __test_core_pmu_event_aliases()
542 INIT_LIST_HEAD(&pmu->aliases); in __test_core_pmu_event_aliases()
543 INIT_LIST_HEAD(&pmu->caps); in __test_core_pmu_event_aliases()
544 INIT_LIST_HEAD(&pmu->list); in __test_core_pmu_event_aliases()
545 pmu->name = strdup(pmu_name); in __test_core_pmu_event_aliases()
546 pmu->is_core = true; in __test_core_pmu_event_aliases()
548 pmu->events_table = table; in __test_core_pmu_event_aliases()
549 pmu_add_cpu_aliases_table(pmu, table); in __test_core_pmu_event_aliases()
550 pmu->cpu_aliases_added = true; in __test_core_pmu_event_aliases()
551 pmu->sysfs_aliases_loaded = true; in __test_core_pmu_event_aliases()
553 res = pmu_events_table__find_event(table, pmu, "bp_l1_btb_correct", NULL, NULL); in __test_core_pmu_event_aliases()
567 test_event.event.pmu = pmu_name; in __test_core_pmu_event_aliases()
568 err = perf_pmu__find_event(pmu, event->name, &args, in __test_core_pmu_event_aliases()
573 perf_pmu__delete(pmu); in __test_core_pmu_event_aliases()
582 struct perf_pmu *pmu = &test_pmu->pmu; in __test_uncore_pmu_event_aliases() local
583 const char *pmu_name = pmu->name; in __test_uncore_pmu_event_aliases()
590 pmu->events_table = events_table; in __test_uncore_pmu_event_aliases()
591 pmu_add_cpu_aliases_table(pmu, events_table); in __test_uncore_pmu_event_aliases()
592 pmu->cpu_aliases_added = true; in __test_uncore_pmu_event_aliases()
593 pmu->sysfs_aliases_loaded = true; in __test_uncore_pmu_event_aliases()
594 pmu_add_sys_aliases(pmu); in __test_uncore_pmu_event_aliases()
597 alias_count = perf_pmu__num_events(pmu); in __test_uncore_pmu_event_aliases()
604 pr_debug("testing aliases uncore PMU %s: mismatch expected aliases (%d) vs found (%d)\n", in __test_uncore_pmu_event_aliases()
618 err = perf_pmu__find_event(pmu, event->name, &args, in __test_uncore_pmu_event_aliases()
622 pr_debug("testing aliases uncore PMU %s: could not match alias %s\n", in __test_uncore_pmu_event_aliases()
629 pr_debug("testing aliases uncore PMU %s: mismatch found aliases (%d) vs matched (%d)\n", in __test_uncore_pmu_event_aliases()
638 .pmu = {
647 .pmu = {
658 .pmu = {
667 .pmu = {
676 .pmu = {
685 .pmu = {
695 .pmu = {
710 struct perf_pmu *pmu = NULL; in test__aliases() local
713 while ((pmu = perf_pmus__scan_core(pmu)) != NULL) { in test__aliases()
716 if (list_empty(&pmu->format)) { in test__aliases()
717 pr_debug2("skipping testing core PMU %s\n", pmu->name); in test__aliases()
721 if (__test_core_pmu_event_aliases(pmu->name, &count)) { in test__aliases()
722 pr_debug("testing core PMU %s aliases: failed\n", pmu->name); in test__aliases()
727 pr_debug("testing core PMU %s aliases: no events to match\n", in test__aliases()
728 pmu->name); in test__aliases()
732 pr_debug("testing core PMU %s aliases: pass\n", pmu->name); in test__aliases()
738 INIT_LIST_HEAD(&test_pmus[i].pmu.format); in test__aliases()
739 INIT_LIST_HEAD(&test_pmus[i].pmu.aliases); in test__aliases()
740 INIT_LIST_HEAD(&test_pmus[i].pmu.caps); in test__aliases()
1037 TEST_CASE("PMU event table sanity", pmu_event_table),
1038 TEST_CASE("PMU event map aliases", aliases),
1039 TEST_CASE_REASON("Parsing of PMU event table metrics", parsing,
1041 TEST_CASE("Parsing of PMU event table metrics with fake PMUs", parsing_fake),
1047 .desc = "PMU events",