Lines Matching refs:cai
7462 …l_perf_counter_(int cpu, struct rapl_counter_info_t *rci, const struct rapl_counter_arch_info *cai, in add_rapl_perf_counter_() argument
7468 const double scale = read_perf_scale(cai->perf_subsys, cai->perf_name); in add_rapl_perf_counter_()
7473 const enum rapl_unit unit = read_perf_rapl_unit(cai->perf_subsys, cai->perf_name); in add_rapl_perf_counter_()
7478 const unsigned int rapl_type = read_perf_type(cai->perf_subsys); in add_rapl_perf_counter_()
7479 const unsigned int rapl_energy_pkg_config = read_perf_config(cai->perf_subsys, cai->perf_name); in add_rapl_perf_counter_()
7495 …pl_perf_counter(int cpu, struct rapl_counter_info_t *rci, const struct rapl_counter_arch_info *cai, in add_rapl_perf_counter() argument
7498 int ret = add_rapl_perf_counter_(cpu, rci, cai, scale, unit); in add_rapl_perf_counter()
7551 const struct rapl_counter_arch_info *const cai = &rapl_counter_arch_infos[i]; in rapl_perf_init() local
7578 if (BIC_IS_ENABLED(cai->bic) && (platform->rapl_msrs & cai->feature_mask)) { in rapl_perf_init()
7581 if (!no_perf && cai->perf_name in rapl_perf_init()
7582 && add_rapl_perf_counter(cpu, rci, cai, &scale, &unit) != -1) { in rapl_perf_init()
7583 rci->source[cai->rci_index] = COUNTER_SOURCE_PERF; in rapl_perf_init()
7584 rci->scale[cai->rci_index] = scale * cai->compat_scale; in rapl_perf_init()
7585 rci->unit[cai->rci_index] = unit; in rapl_perf_init()
7586 rci->flags[cai->rci_index] = cai->flags; in rapl_perf_init()
7589 } else if (!no_msr && cai->msr && probe_msr(cpu, cai->msr) == 0) { in rapl_perf_init()
7590 rci->source[cai->rci_index] = COUNTER_SOURCE_MSR; in rapl_perf_init()
7591 rci->msr[cai->rci_index] = cai->msr; in rapl_perf_init()
7592 rci->msr_mask[cai->rci_index] = cai->msr_mask; in rapl_perf_init()
7593 rci->msr_shift[cai->rci_index] = cai->msr_shift; in rapl_perf_init()
7594 rci->unit[cai->rci_index] = RAPL_UNIT_JOULES; in rapl_perf_init()
7595 rci->scale[cai->rci_index] = *cai->platform_rapl_msr_scale * cai->compat_scale; in rapl_perf_init()
7596 rci->flags[cai->rci_index] = cai->flags; in rapl_perf_init()
7600 if (rci->source[cai->rci_index] != COUNTER_SOURCE_NONE) in rapl_perf_init()
7606 BIC_PRESENT(cai->bic); in rapl_perf_init()
7630 …rf_counter_(int cpu, struct cstate_counter_info_t *cci, const struct cstate_counter_arch_info *cai) in add_cstate_perf_counter_() argument
7635 int *pfd_group = get_cstate_perf_group_fd(cci, cai->perf_subsys); in add_cstate_perf_counter_()
7640 const unsigned int type = read_perf_type(cai->perf_subsys); in add_cstate_perf_counter_()
7641 const unsigned int config = read_perf_config(cai->perf_subsys, cai->perf_name); in add_cstate_perf_counter_()
7655 …erf_counter(int cpu, struct cstate_counter_info_t *cci, const struct cstate_counter_arch_info *cai) in add_cstate_perf_counter() argument
7657 int ret = add_cstate_perf_counter_(cpu, cci, cai); in add_cstate_perf_counter()
7665 …msr_perf_counter_(int cpu, struct msr_counter_info_t *cci, const struct msr_counter_arch_info *cai) in add_msr_perf_counter_() argument
7670 const unsigned int type = read_perf_type(cai->perf_subsys); in add_msr_perf_counter_()
7671 const unsigned int config = read_perf_config(cai->perf_subsys, cai->perf_name); in add_msr_perf_counter_()
7685 …_msr_perf_counter(int cpu, struct msr_counter_info_t *cci, const struct msr_counter_arch_info *cai) in add_msr_perf_counter() argument
7687 int ret = add_msr_perf_counter_(cpu, cci, cai); in add_msr_perf_counter()
7690 …fprintf(stderr, "%s: %s/%s: %d (cpu: %d)\n", __func__, cai->perf_subsys, cai->perf_name, ret, cpu); in add_msr_perf_counter()
7709 struct msr_counter_arch_info *cai = &msr_counter_arch_infos[cidx]; in msr_perf_init_() local
7711 cai->present = false; in msr_perf_init_()
7720 if (cai->needed) { in msr_perf_init_()
7722 if (!no_perf && cai->perf_name && add_msr_perf_counter(cpu, cci, cai) != -1) { in msr_perf_init_()
7723 cci->source[cai->rci_index] = COUNTER_SOURCE_PERF; in msr_perf_init_()
7724 cai->present = true; in msr_perf_init_()
7727 } else if (!no_msr && cai->msr && probe_msr(cpu, cai->msr) == 0) { in msr_perf_init_()
7728 cci->source[cai->rci_index] = COUNTER_SOURCE_MSR; in msr_perf_init_()
7729 cci->msr[cai->rci_index] = cai->msr; in msr_perf_init_()
7730 cci->msr_mask[cai->rci_index] = cai->msr_mask; in msr_perf_init_()
7731 cai->present = true; in msr_perf_init_()
7805 const struct cstate_counter_arch_info *cai = &ccstate_counter_arch_infos[cidx]; in cstate_perf_init_() local
7820 const bool per_thread = cai->flags & CSTATE_COUNTER_FLAG_COLLECT_PER_THREAD; in cstate_perf_init_()
7821 const bool per_core = cai->flags & CSTATE_COUNTER_FLAG_COLLECT_PER_CORE; in cstate_perf_init_()
7829 const bool counter_needed = BIC_IS_ENABLED(cai->bic) || in cstate_perf_init_()
7830 (soft_c1 && (cai->flags & CSTATE_COUNTER_FLAG_SOFT_C1_DEPENDENCY)); in cstate_perf_init_()
7831 const bool counter_supported = (platform->supported_cstates & cai->feature_mask); in cstate_perf_init_()
7835 if (!no_perf && cai->perf_name && add_cstate_perf_counter(cpu, cci, cai) != -1) { in cstate_perf_init_()
7837 cci->source[cai->rci_index] = COUNTER_SOURCE_PERF; in cstate_perf_init_()
7840 } else if (!no_msr && cai->msr && pkg_cstate_limit >= cai->pkg_cstate_limit in cstate_perf_init_()
7841 && probe_msr(cpu, cai->msr) == 0) { in cstate_perf_init_()
7842 cci->source[cai->rci_index] = COUNTER_SOURCE_MSR; in cstate_perf_init_()
7843 cci->msr[cai->rci_index] = cai->msr; in cstate_perf_init_()
7847 if (cci->source[cai->rci_index] != COUNTER_SOURCE_NONE) { in cstate_perf_init_()
7856 BIC_PRESENT(cai->bic); in cstate_perf_init_()
8135 struct cstate_counter_arch_info *const cai = &ccstate_counter_arch_infos[i]; in counter_info_init() local
8137 if (platform->has_msr_knl_core_c6_residency && cai->msr == MSR_CORE_C6_RESIDENCY) in counter_info_init()
8138 cai->msr = MSR_KNL_CORE_C6_RESIDENCY; in counter_info_init()
8140 if (!platform->has_msr_core_c1_res && cai->msr == MSR_CORE_C1_RES) in counter_info_init()
8141 cai->msr = 0; in counter_info_init()
8143 if (platform->has_msr_atom_pkg_c6_residency && cai->msr == MSR_PKG_C6_RESIDENCY) in counter_info_init()
8144 cai->msr = MSR_ATOM_PKG_C6_RESIDENCY; in counter_info_init()