• Home
  • Raw
  • Download

Lines Matching refs:cpuc

566 	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);  in intel_pmu_disable_bts()  local
569 if (!cpuc->ds) in intel_pmu_disable_bts()
583 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_drain_bts_buffer() local
584 struct debug_store *ds = cpuc->ds; in intel_pmu_drain_bts_buffer()
590 struct perf_event *event = cpuc->events[INTEL_PMC_IDX_FIXED_BTS]; in intel_pmu_drain_bts_buffer()
909 static inline bool pebs_needs_sched_cb(struct cpu_hw_events *cpuc) in pebs_needs_sched_cb() argument
911 if (cpuc->n_pebs == cpuc->n_pebs_via_pt) in pebs_needs_sched_cb()
914 return cpuc->n_pebs && (cpuc->n_pebs == cpuc->n_large_pebs); in pebs_needs_sched_cb()
919 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_pebs_sched_task() local
921 if (!sched_in && pebs_needs_sched_cb(cpuc)) in intel_pmu_pebs_sched_task()
925 static inline void pebs_update_threshold(struct cpu_hw_events *cpuc) in pebs_update_threshold() argument
927 struct debug_store *ds = cpuc->ds; in pebs_update_threshold()
931 if (cpuc->n_pebs_via_pt) in pebs_update_threshold()
939 if (cpuc->n_pebs == cpuc->n_large_pebs) { in pebs_update_threshold()
941 reserved * cpuc->pebs_record_size; in pebs_update_threshold()
943 threshold = ds->pebs_buffer_base + cpuc->pebs_record_size; in pebs_update_threshold()
951 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in adaptive_pebs_record_size_update() local
952 u64 pebs_data_cfg = cpuc->pebs_data_cfg; in adaptive_pebs_record_size_update()
964 cpuc->pebs_record_size = sz; in adaptive_pebs_record_size_update()
1018 pebs_update_state(bool needed_cb, struct cpu_hw_events *cpuc, in pebs_update_state() argument
1027 bool update = cpuc->n_pebs == 1; in pebs_update_state()
1029 if (needed_cb != pebs_needs_sched_cb(cpuc)) { in pebs_update_state()
1046 if (cpuc->n_pebs == 1) { in pebs_update_state()
1047 cpuc->pebs_data_cfg = 0; in pebs_update_state()
1048 cpuc->pebs_record_size = sizeof(struct pebs_basic); in pebs_update_state()
1054 if (pebs_data_cfg & ~cpuc->pebs_data_cfg) { in pebs_update_state()
1055 cpuc->pebs_data_cfg |= pebs_data_cfg; in pebs_update_state()
1062 pebs_update_threshold(cpuc); in pebs_update_state()
1067 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_pebs_add() local
1069 bool needed_cb = pebs_needs_sched_cb(cpuc); in intel_pmu_pebs_add()
1071 cpuc->n_pebs++; in intel_pmu_pebs_add()
1073 cpuc->n_large_pebs++; in intel_pmu_pebs_add()
1075 cpuc->n_pebs_via_pt++; in intel_pmu_pebs_add()
1077 pebs_update_state(needed_cb, cpuc, event, true); in intel_pmu_pebs_add()
1082 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_pebs_via_pt_disable() local
1087 if (!(cpuc->pebs_enabled & ~PEBS_VIA_PT_MASK)) in intel_pmu_pebs_via_pt_disable()
1088 cpuc->pebs_enabled &= ~PEBS_VIA_PT_MASK; in intel_pmu_pebs_via_pt_disable()
1093 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_pebs_via_pt_enable() local
1095 struct debug_store *ds = cpuc->ds; in intel_pmu_pebs_via_pt_enable()
1101 cpuc->pebs_enabled |= PEBS_PMI_AFTER_EACH_RECORD; in intel_pmu_pebs_via_pt_enable()
1103 cpuc->pebs_enabled |= PEBS_OUTPUT_PT; in intel_pmu_pebs_via_pt_enable()
1110 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_pebs_enable() local
1112 struct debug_store *ds = cpuc->ds; in intel_pmu_pebs_enable()
1116 cpuc->pebs_enabled |= 1ULL << hwc->idx; in intel_pmu_pebs_enable()
1119 cpuc->pebs_enabled |= 1ULL << (hwc->idx + 32); in intel_pmu_pebs_enable()
1121 cpuc->pebs_enabled |= 1ULL << 63; in intel_pmu_pebs_enable()
1125 if (cpuc->pebs_data_cfg != cpuc->active_pebs_data_cfg) { in intel_pmu_pebs_enable()
1126 wrmsrl(MSR_PEBS_DATA_CFG, cpuc->pebs_data_cfg); in intel_pmu_pebs_enable()
1127 cpuc->active_pebs_data_cfg = cpuc->pebs_data_cfg; in intel_pmu_pebs_enable()
1151 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_pebs_del() local
1153 bool needed_cb = pebs_needs_sched_cb(cpuc); in intel_pmu_pebs_del()
1155 cpuc->n_pebs--; in intel_pmu_pebs_del()
1157 cpuc->n_large_pebs--; in intel_pmu_pebs_del()
1159 cpuc->n_pebs_via_pt--; in intel_pmu_pebs_del()
1161 pebs_update_state(needed_cb, cpuc, event, false); in intel_pmu_pebs_del()
1166 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_pebs_disable() local
1169 if (cpuc->n_pebs == cpuc->n_large_pebs && in intel_pmu_pebs_disable()
1170 cpuc->n_pebs != cpuc->n_pebs_via_pt) in intel_pmu_pebs_disable()
1173 cpuc->pebs_enabled &= ~(1ULL << hwc->idx); in intel_pmu_pebs_disable()
1177 cpuc->pebs_enabled &= ~(1ULL << (hwc->idx + 32)); in intel_pmu_pebs_disable()
1179 cpuc->pebs_enabled &= ~(1ULL << 63); in intel_pmu_pebs_disable()
1183 if (cpuc->enabled) in intel_pmu_pebs_disable()
1184 wrmsrl(MSR_IA32_PEBS_ENABLE, cpuc->pebs_enabled); in intel_pmu_pebs_disable()
1191 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_pebs_enable_all() local
1193 if (cpuc->pebs_enabled) in intel_pmu_pebs_enable_all()
1194 wrmsrl(MSR_IA32_PEBS_ENABLE, cpuc->pebs_enabled); in intel_pmu_pebs_enable_all()
1199 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_pebs_disable_all() local
1201 if (cpuc->pebs_enabled) in intel_pmu_pebs_disable_all()
1207 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_pebs_fixup_ip() local
1208 unsigned long from = cpuc->lbr_entries[0].from; in intel_pmu_pebs_fixup_ip()
1209 unsigned long old_to, to = cpuc->lbr_entries[0].to; in intel_pmu_pebs_fixup_ip()
1224 if (!cpuc->lbr_stack.nr || !from || !to) in intel_pmu_pebs_fixup_ip()
1354 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in setup_pebs_fixed_sample_data() local
1484 data->br_stack = &cpuc->lbr_stack; in setup_pebs_fixed_sample_data()
1519 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in setup_pebs_adaptive_sample_data() local
1610 data->br_stack = &cpuc->lbr_stack; in setup_pebs_adaptive_sample_data()
1624 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in get_next_pebs_record_by_bit() local
1638 for (at = base; at < top; at += cpuc->pebs_record_size) { in get_next_pebs_record_by_bit()
1650 pebs_status = status & cpuc->pebs_enabled; in get_next_pebs_record_by_bit()
1741 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in __intel_pmu_pebs_event() local
1765 at += cpuc->pebs_record_size; in __intel_pmu_pebs_event()
1791 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_drain_pebs_core() local
1792 struct debug_store *ds = cpuc->ds; in intel_pmu_drain_pebs_core()
1793 struct perf_event *event = cpuc->events[0]; /* PMC0 only */ in intel_pmu_drain_pebs_core()
1808 if (!test_bit(0, cpuc->active_mask)) in intel_pmu_drain_pebs_core()
1827 static void intel_pmu_pebs_event_update_no_drain(struct cpu_hw_events *cpuc, int size) in intel_pmu_pebs_event_update_no_drain() argument
1839 for_each_set_bit(bit, (unsigned long *)&cpuc->pebs_enabled, size) { in intel_pmu_pebs_event_update_no_drain()
1840 event = cpuc->events[bit]; in intel_pmu_pebs_event_update_no_drain()
1848 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_drain_pebs_nhm() local
1849 struct debug_store *ds = cpuc->ds; in intel_pmu_drain_pebs_nhm()
1873 intel_pmu_pebs_event_update_no_drain(cpuc, size); in intel_pmu_drain_pebs_nhm()
1881 pebs_status = p->status & cpuc->pebs_enabled; in intel_pmu_drain_pebs_nhm()
1900 if (!pebs_status && cpuc->pebs_enabled && in intel_pmu_drain_pebs_nhm()
1901 !(cpuc->pebs_enabled & (cpuc->pebs_enabled-1))) in intel_pmu_drain_pebs_nhm()
1902 pebs_status = p->status = cpuc->pebs_enabled; in intel_pmu_drain_pebs_nhm()
1937 event = cpuc->events[bit]; in intel_pmu_drain_pebs_nhm()
1963 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in intel_pmu_drain_pebs_icl() local
1964 struct debug_store *ds = cpuc->ds; in intel_pmu_drain_pebs_icl()
1983 intel_pmu_pebs_event_update_no_drain(cpuc, size); in intel_pmu_drain_pebs_icl()
1987 for (at = base; at < top; at += cpuc->pebs_record_size) { in intel_pmu_drain_pebs_icl()
1990 pebs_status = get_pebs_status(at) & cpuc->pebs_enabled; in intel_pmu_drain_pebs_icl()
2001 event = cpuc->events[bit]; in intel_pmu_drain_pebs_icl()