• Home
  • Raw
  • Download

Lines Matching refs:perf_ibs

83 struct perf_ibs {  struct
184 static struct perf_ibs perf_ibs_fetch;
185 static struct perf_ibs perf_ibs_op;
187 static struct perf_ibs *get_ibs_pmu(int type) in get_ibs_pmu()
257 struct perf_ibs *perf_ibs; in perf_ibs_init() local
260 perf_ibs = get_ibs_pmu(event->attr.type); in perf_ibs_init()
261 if (!perf_ibs) in perf_ibs_init()
266 if (event->pmu != &perf_ibs->pmu) in perf_ibs_init()
269 if (config & ~perf_ibs->config_mask) in perf_ibs_init()
273 if (config & perf_ibs->cnt_mask) in perf_ibs_init()
287 max_cnt = config & perf_ibs->cnt_mask; in perf_ibs_init()
288 config &= ~perf_ibs->cnt_mask; in perf_ibs_init()
303 hwc->config_base = perf_ibs->msr; in perf_ibs_init()
319 static int perf_ibs_set_period(struct perf_ibs *perf_ibs, in perf_ibs_set_period() argument
325 overflow = perf_event_set_period(hwc, 1<<4, perf_ibs->max_period, period); in perf_ibs_set_period()
360 perf_ibs_event_update(struct perf_ibs *perf_ibs, struct perf_event *event, in perf_ibs_event_update() argument
363 u64 count = perf_ibs->get_count(*config); in perf_ibs_event_update()
372 count = perf_ibs->get_count(*config); in perf_ibs_event_update()
376 static inline void perf_ibs_enable_event(struct perf_ibs *perf_ibs, in perf_ibs_enable_event() argument
381 if (perf_ibs->fetch_count_reset_broken) in perf_ibs_enable_event()
382 wrmsrl(hwc->config_base, tmp & ~perf_ibs->enable_mask); in perf_ibs_enable_event()
384 wrmsrl(hwc->config_base, tmp | perf_ibs->enable_mask); in perf_ibs_enable_event()
394 static inline void perf_ibs_disable_event(struct perf_ibs *perf_ibs, in perf_ibs_disable_event() argument
397 config &= ~perf_ibs->cnt_mask; in perf_ibs_disable_event()
400 config &= ~perf_ibs->enable_mask; in perf_ibs_disable_event()
413 struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu); in perf_ibs_start() local
414 struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); in perf_ibs_start()
423 perf_ibs_set_period(perf_ibs, hwc, &period); in perf_ibs_start()
424 if (perf_ibs == &perf_ibs_op && (ibs_caps & IBS_CAPS_OPCNTEXT)) { in perf_ibs_start()
436 perf_ibs_enable_event(perf_ibs, hwc, config); in perf_ibs_start()
444 struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu); in perf_ibs_stop() local
445 struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); in perf_ibs_stop()
467 perf_ibs_disable_event(perf_ibs, hwc, config); in perf_ibs_stop()
489 config &= ~perf_ibs->valid_mask; in perf_ibs_stop()
491 perf_ibs_event_update(perf_ibs, event, &config); in perf_ibs_stop()
497 struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu); in perf_ibs_add() local
498 struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); in perf_ibs_add()
515 struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu); in perf_ibs_del() local
516 struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); in perf_ibs_del()
543 static struct perf_ibs perf_ibs_fetch = {
568 static struct perf_ibs perf_ibs_op = {
594 static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs) in perf_ibs_handle_irq() argument
596 struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); in perf_ibs_handle_irq()
628 if (!(*buf++ & perf_ibs->valid_mask)) in perf_ibs_handle_irq()
632 perf_ibs_event_update(perf_ibs, event, config); in perf_ibs_handle_irq()
634 if (!perf_ibs_set_period(perf_ibs, hwc, &period)) in perf_ibs_handle_irq()
640 check_rip = (perf_ibs == &perf_ibs_op && (ibs_caps & IBS_CAPS_RIPINVALIDCHK)); in perf_ibs_handle_irq()
642 offset_max = perf_ibs->offset_max; in perf_ibs_handle_irq()
650 offset = find_next_bit(perf_ibs->offset_mask, in perf_ibs_handle_irq()
651 perf_ibs->offset_max, in perf_ibs_handle_irq()
660 if (perf_ibs == &perf_ibs_op) { in perf_ibs_handle_irq()
670 if (perf_ibs == &perf_ibs_fetch && (ibs_caps & IBS_CAPS_FETCHCTLEXTD)) { in perf_ibs_handle_irq()
682 if (perf_ibs->fetch_ignore_if_zero_rip && !(ibs_data.regs[1])) in perf_ibs_handle_irq()
712 if (perf_ibs == &perf_ibs_op) { in perf_ibs_handle_irq()
722 perf_ibs_enable_event(perf_ibs, hwc, new_config); in perf_ibs_handle_irq()
748 static __init int perf_ibs_pmu_init(struct perf_ibs *perf_ibs, char *name) in perf_ibs_pmu_init() argument
757 perf_ibs->pcpu = pcpu; in perf_ibs_pmu_init()
760 if (perf_ibs->format_attrs[0]) { in perf_ibs_pmu_init()
761 memset(&perf_ibs->format_group, 0, sizeof(perf_ibs->format_group)); in perf_ibs_pmu_init()
762 perf_ibs->format_group.name = "format"; in perf_ibs_pmu_init()
763 perf_ibs->format_group.attrs = perf_ibs->format_attrs; in perf_ibs_pmu_init()
765 memset(&perf_ibs->attr_groups, 0, sizeof(perf_ibs->attr_groups)); in perf_ibs_pmu_init()
766 perf_ibs->attr_groups[0] = &perf_ibs->format_group; in perf_ibs_pmu_init()
767 perf_ibs->pmu.attr_groups = perf_ibs->attr_groups; in perf_ibs_pmu_init()
770 ret = perf_pmu_register(&perf_ibs->pmu, name, -1); in perf_ibs_pmu_init()
772 perf_ibs->pcpu = NULL; in perf_ibs_pmu_init()