H A D | perf_event_amd_ibs.c | 44 struct perf_ibs { struct 152 static struct perf_ibs perf_ibs_fetch; 153 static struct perf_ibs perf_ibs_op; 155 static struct perf_ibs *get_ibs_pmu(int type) get_ibs_pmu() 230 struct perf_ibs *perf_ibs; perf_ibs_init() local 234 perf_ibs = get_ibs_pmu(event->attr.type); perf_ibs_init() 235 if (perf_ibs) { perf_ibs_init() 238 perf_ibs = &perf_ibs_op; perf_ibs_init() 244 if (event->pmu != &perf_ibs->pmu) perf_ibs_init() 250 if (config & ~perf_ibs->config_mask) perf_ibs_init() 254 if (config & perf_ibs->cnt_mask) perf_ibs_init() 268 max_cnt = config & perf_ibs->cnt_mask; perf_ibs_init() 269 config &= ~perf_ibs->cnt_mask; perf_ibs_init() 284 hwc->config_base = perf_ibs->msr; perf_ibs_init() 290 static int perf_ibs_set_period(struct perf_ibs *perf_ibs, perf_ibs_set_period() argument 296 overflow = perf_event_set_period(hwc, 1<<4, perf_ibs->max_period, period); perf_ibs_set_period() 321 perf_ibs_event_update(struct perf_ibs *perf_ibs, struct perf_event *event, perf_ibs_event_update() argument 324 u64 count = perf_ibs->get_count(*config); perf_ibs_event_update() 333 count = perf_ibs->get_count(*config); perf_ibs_event_update() 337 static inline void perf_ibs_enable_event(struct perf_ibs *perf_ibs, perf_ibs_enable_event() argument 340 wrmsrl(hwc->config_base, hwc->config | config | perf_ibs->enable_mask); perf_ibs_enable_event() 350 static inline void perf_ibs_disable_event(struct perf_ibs *perf_ibs, perf_ibs_disable_event() argument 353 config &= ~perf_ibs->cnt_mask; perf_ibs_disable_event() 355 config &= ~perf_ibs->enable_mask; perf_ibs_disable_event() 368 struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu); perf_ibs_start() local 369 struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); perf_ibs_start() 378 perf_ibs_set_period(perf_ibs, hwc, &period); perf_ibs_start() 380 perf_ibs_enable_event(perf_ibs, hwc, period >> 4); perf_ibs_start() 388 struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu); perf_ibs_stop() local 389 struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); perf_ibs_stop() 402 perf_ibs_disable_event(perf_ibs, hwc, config); perf_ibs_stop() 414 config &= ~perf_ibs->valid_mask; perf_ibs_stop() 416 perf_ibs_event_update(perf_ibs, event, &config); perf_ibs_stop() 422 struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu); perf_ibs_add() local 423 struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); perf_ibs_add() 440 struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu); perf_ibs_del() local 441 struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); perf_ibs_del() 468 static struct perf_ibs perf_ibs_fetch = { 492 static struct perf_ibs perf_ibs_op = { 516 static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs) perf_ibs_handle_irq() argument 518 struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu); perf_ibs_handle_irq() 542 if (!(*buf++ & perf_ibs->valid_mask)) perf_ibs_handle_irq() 546 perf_ibs_event_update(perf_ibs, event, config); perf_ibs_handle_irq() 548 if (!perf_ibs_set_period(perf_ibs, hwc, &period)) perf_ibs_handle_irq() 554 check_rip = (perf_ibs == &perf_ibs_op && (ibs_caps & IBS_CAPS_RIPINVALIDCHK)); perf_ibs_handle_irq() 556 offset_max = perf_ibs->offset_max; perf_ibs_handle_irq() 564 offset = find_next_bit(perf_ibs->offset_mask, perf_ibs_handle_irq() 565 perf_ibs->offset_max, perf_ibs_handle_irq() 602 perf_ibs_disable_event(perf_ibs, hwc, *config); perf_ibs_handle_irq() 604 perf_ibs_enable_event(perf_ibs, hwc, period >> 4); perf_ibs_handle_irq() 626 static __init int perf_ibs_pmu_init(struct perf_ibs *perf_ibs, char *name) perf_ibs_pmu_init() argument 635 perf_ibs->pcpu = pcpu; perf_ibs_pmu_init() 638 if (perf_ibs->format_attrs[0]) { perf_ibs_pmu_init() 639 memset(&perf_ibs->format_group, 0, sizeof(perf_ibs->format_group)); perf_ibs_pmu_init() 640 perf_ibs->format_group.name = "format"; perf_ibs_pmu_init() 641 perf_ibs->format_group.attrs = perf_ibs->format_attrs; perf_ibs_pmu_init() 643 memset(&perf_ibs->attr_groups, 0, sizeof(perf_ibs->attr_groups)); perf_ibs_pmu_init() 644 perf_ibs->attr_groups[0] = &perf_ibs->format_group; perf_ibs_pmu_init() 645 perf_ibs->pmu.attr_groups = perf_ibs->attr_groups; perf_ibs_pmu_init() 648 ret = perf_pmu_register(&perf_ibs->pmu, name, -1); perf_ibs_pmu_init() 650 perf_ibs->pcpu = NULL; perf_ibs_pmu_init() 672 register_nmi_handler(NMI_LOCAL, perf_ibs_nmi_handler, 0, "perf_ibs"); perf_event_ibs_init()
|