Lines Matching defs:cci
4686 static size_t cstate_counter_info_count_perf(const struct cstate_counter_info_t *cci)
4691 if (cci->source[i] == COUNTER_SOURCE_PERF)
4811 struct cstate_counter_info_t *cci;
4823 cci = &ccstate_counter_info[cpu];
4828 const size_t num_perf_counters = cstate_counter_info_count_perf(cci);
4832 if (cci->fd_perf_core != -1) {
4836 actual_read_size_core = read(cci->fd_perf_core, &perf_data_core[0], sizeof(perf_data_core));
4842 if (cci->fd_perf_pkg != -1) {
4846 actual_read_size_pkg = read(cci->fd_perf_pkg, &perf_data_pkg[0], sizeof(perf_data_pkg));
4875 switch (cci->source[i]) {
4881 assert(cci->fd_perf_core != -1 || cci->fd_perf_pkg != -1);
4886 cci->data[i] = perf_data[pi];
4893 if (get_msr(cpu, cci->msr[i], &cci->data[i]))
4897 fprintf(stderr, "cstate via %s0x%llx %u: %llu\n", "msr", cci->msr[i], i, cci->data[i]);
4911 if (cci->source[index] != COUNTER_SOURCE_NONE) \
4912 out_counter = cci->data[index]; \
8492 int *get_cstate_perf_group_fd(struct cstate_counter_info_t *cci, const char *group_name)
8495 return &cci->fd_perf_core;
8498 return &cci->fd_perf_pkg;
8503 int add_cstate_perf_counter(int cpu, struct cstate_counter_info_t *cci, const struct cstate_counter_arch_info *cai)
8513 int *pfd_group = get_cstate_perf_group_fd(cci, cai->perf_subsys);
8537 int add_msr_perf_counter(int cpu, struct msr_counter_info_t *cci, const struct msr_counter_arch_info *cai)
8550 ret = open_perf_counter(cpu, type, config, cci->fd_perf, PERF_FORMAT_GROUP);
8556 if (cci->fd_perf == -1)
8557 cci->fd_perf = ret;
8586 struct msr_counter_info_t *const cci = &msr_counter_info[cpu];
8593 if (add_msr_perf_counter(cpu, cci, cai) != -1) {
8594 cci->source[cai->rci_index] = COUNTER_SOURCE_PERF;
8599 cci->source[cai->rci_index] = COUNTER_SOURCE_MSR;
8600 cci->msr[cai->rci_index] = cai->msr;
8601 cci->msr_mask[cai->rci_index] = cai->msr_mask;
8680 struct cstate_counter_info_t *const cci = &ccstate_counter_info[cpu];
8706 if (add_cstate_perf_counter(cpu, cci, cai) != -1) {
8708 cci->source[cai->rci_index] = COUNTER_SOURCE_PERF;
8713 cci->source[cai->rci_index] = COUNTER_SOURCE_MSR;
8714 cci->msr[cai->rci_index] = cai->msr;
8718 if (cci->source[cai->rci_index] != COUNTER_SOURCE_NONE) {