Lines Matching refs:cpuc
109 static void intel_pmu_lbr_filter(struct cpu_hw_events *cpuc);
119 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in __intel_pmu_lbr_enable() local
121 if (cpuc->lbr_sel) in __intel_pmu_lbr_enable()
122 wrmsrl(MSR_LBR_SELECT, cpuc->lbr_sel->config); in __intel_pmu_lbr_enable()
169 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in intel_pmu_lbr_enable() local
178 if (event->ctx->task && cpuc->lbr_context != event->ctx) { in intel_pmu_lbr_enable()
180 cpuc->lbr_context = event->ctx; in intel_pmu_lbr_enable()
182 cpuc->br_sel = event->hw.branch_reg.reg; in intel_pmu_lbr_enable()
184 cpuc->lbr_users++; in intel_pmu_lbr_enable()
189 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in intel_pmu_lbr_disable() local
194 cpuc->lbr_users--; in intel_pmu_lbr_disable()
195 WARN_ON_ONCE(cpuc->lbr_users < 0); in intel_pmu_lbr_disable()
197 if (cpuc->enabled && !cpuc->lbr_users) { in intel_pmu_lbr_disable()
200 cpuc->lbr_context = NULL; in intel_pmu_lbr_disable()
206 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in intel_pmu_lbr_enable_all() local
208 if (cpuc->lbr_users) in intel_pmu_lbr_enable_all()
214 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in intel_pmu_lbr_disable_all() local
216 if (cpuc->lbr_users) in intel_pmu_lbr_disable_all()
232 static void intel_pmu_lbr_read_32(struct cpu_hw_events *cpuc) in intel_pmu_lbr_read_32() argument
250 cpuc->lbr_entries[i].from = msr_lastbranch.from; in intel_pmu_lbr_read_32()
251 cpuc->lbr_entries[i].to = msr_lastbranch.to; in intel_pmu_lbr_read_32()
252 cpuc->lbr_entries[i].mispred = 0; in intel_pmu_lbr_read_32()
253 cpuc->lbr_entries[i].predicted = 0; in intel_pmu_lbr_read_32()
254 cpuc->lbr_entries[i].reserved = 0; in intel_pmu_lbr_read_32()
256 cpuc->lbr_stack.nr = i; in intel_pmu_lbr_read_32()
264 static void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc) in intel_pmu_lbr_read_64() argument
284 cpuc->lbr_entries[i].from = from; in intel_pmu_lbr_read_64()
285 cpuc->lbr_entries[i].to = to; in intel_pmu_lbr_read_64()
286 cpuc->lbr_entries[i].mispred = mis; in intel_pmu_lbr_read_64()
287 cpuc->lbr_entries[i].predicted = pred; in intel_pmu_lbr_read_64()
288 cpuc->lbr_entries[i].reserved = 0; in intel_pmu_lbr_read_64()
290 cpuc->lbr_stack.nr = i; in intel_pmu_lbr_read_64()
295 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in intel_pmu_lbr_read() local
297 if (!cpuc->lbr_users) in intel_pmu_lbr_read()
301 intel_pmu_lbr_read_32(cpuc); in intel_pmu_lbr_read()
303 intel_pmu_lbr_read_64(cpuc); in intel_pmu_lbr_read()
305 intel_pmu_lbr_filter(cpuc); in intel_pmu_lbr_read()
568 intel_pmu_lbr_filter(struct cpu_hw_events *cpuc) in intel_pmu_lbr_filter() argument
571 int br_sel = cpuc->br_sel; in intel_pmu_lbr_filter()
579 for (i = 0; i < cpuc->lbr_stack.nr; i++) { in intel_pmu_lbr_filter()
581 from = cpuc->lbr_entries[i].from; in intel_pmu_lbr_filter()
582 to = cpuc->lbr_entries[i].to; in intel_pmu_lbr_filter()
588 cpuc->lbr_entries[i].from = 0; in intel_pmu_lbr_filter()
597 for (i = 0; i < cpuc->lbr_stack.nr; ) { in intel_pmu_lbr_filter()
598 if (!cpuc->lbr_entries[i].from) { in intel_pmu_lbr_filter()
600 while (++j < cpuc->lbr_stack.nr) in intel_pmu_lbr_filter()
601 cpuc->lbr_entries[j-1] = cpuc->lbr_entries[j]; in intel_pmu_lbr_filter()
602 cpuc->lbr_stack.nr--; in intel_pmu_lbr_filter()
603 if (!cpuc->lbr_entries[i].from) in intel_pmu_lbr_filter()