Lines Matching refs:event
40 struct perf_event *event[MAX_HWEVENTS]; member
151 static int ev67_check_constraints(struct perf_event **event, in ev67_check_constraints() argument
198 event[0]->hw.idx = idx0; in ev67_check_constraints()
199 event[0]->hw.config_base = config; in ev67_check_constraints()
201 event[1]->hw.idx = idx0 ^ 1; in ev67_check_constraints()
202 event[1]->hw.config_base = config; in ev67_check_constraints()
251 static int alpha_perf_event_set_period(struct perf_event *event, in alpha_perf_event_set_period() argument
286 perf_event_update_userpage(event); in alpha_perf_event_set_period()
306 static unsigned long alpha_perf_event_update(struct perf_event *event, in alpha_perf_event_update() argument
329 local64_add(delta, &event->count); in alpha_perf_event_update()
340 struct perf_event *event[], unsigned long *evtype, in collect_events() argument
349 event[n] = group; in collect_events()
357 event[n] = pe; in collect_events()
399 struct perf_event *pe = cpuc->event[j]; in maybe_change_configuration()
411 struct perf_event *pe = cpuc->event[j]; in maybe_change_configuration()
423 cpuc->config = cpuc->event[0]->hw.config_base; in maybe_change_configuration()
432 static int alpha_pmu_add(struct perf_event *event, int flags) in alpha_pmu_add() argument
435 struct hw_perf_event *hwc = &event->hw; in alpha_pmu_add()
448 perf_pmu_disable(event->pmu); in alpha_pmu_add()
457 cpuc->event[n0] = event; in alpha_pmu_add()
458 cpuc->evtype[n0] = event->hw.event_base; in alpha_pmu_add()
461 if (!alpha_check_constraints(cpuc->event, cpuc->evtype, n0+1)) { in alpha_pmu_add()
473 perf_pmu_enable(event->pmu); in alpha_pmu_add()
484 static void alpha_pmu_del(struct perf_event *event, int flags) in alpha_pmu_del() argument
487 struct hw_perf_event *hwc = &event->hw; in alpha_pmu_del()
491 perf_pmu_disable(event->pmu); in alpha_pmu_del()
495 if (event == cpuc->event[j]) { in alpha_pmu_del()
502 cpuc->event[j - 1] = cpuc->event[j]; in alpha_pmu_del()
509 alpha_perf_event_update(event, hwc, idx, 0); in alpha_pmu_del()
510 perf_event_update_userpage(event); in alpha_pmu_del()
519 perf_pmu_enable(event->pmu); in alpha_pmu_del()
523 static void alpha_pmu_read(struct perf_event *event) in alpha_pmu_read() argument
525 struct hw_perf_event *hwc = &event->hw; in alpha_pmu_read()
527 alpha_perf_event_update(event, hwc, hwc->idx, 0); in alpha_pmu_read()
531 static void alpha_pmu_stop(struct perf_event *event, int flags) in alpha_pmu_stop() argument
533 struct hw_perf_event *hwc = &event->hw; in alpha_pmu_stop()
542 alpha_perf_event_update(event, hwc, hwc->idx, 0); in alpha_pmu_stop()
551 static void alpha_pmu_start(struct perf_event *event, int flags) in alpha_pmu_start() argument
553 struct hw_perf_event *hwc = &event->hw; in alpha_pmu_start()
561 alpha_perf_event_set_period(event, hwc, hwc->idx); in alpha_pmu_start()
593 static void hw_perf_event_destroy(struct perf_event *event) in hw_perf_event_destroy() argument
601 static int __hw_perf_event_init(struct perf_event *event) in __hw_perf_event_init() argument
603 struct perf_event_attr *attr = &event->attr; in __hw_perf_event_init()
604 struct hw_perf_event *hwc = &event->hw; in __hw_perf_event_init()
654 if (event->group_leader != event) { in __hw_perf_event_init()
655 n = collect_events(event->group_leader, in __hw_perf_event_init()
662 evts[n] = event; in __hw_perf_event_init()
671 event->destroy = hw_perf_event_destroy; in __hw_perf_event_init()
695 static int alpha_pmu_event_init(struct perf_event *event) in alpha_pmu_event_init() argument
700 if (has_branch_stack(event)) in alpha_pmu_event_init()
703 switch (event->attr.type) { in alpha_pmu_event_init()
717 err = __hw_perf_event_init(event); in alpha_pmu_event_init()
813 struct perf_event *event; in alpha_perf_event_irq_handler() local
849 event = cpuc->event[j]; in alpha_perf_event_irq_handler()
851 if (unlikely(!event)) { in alpha_perf_event_irq_handler()
859 hwc = &event->hw; in alpha_perf_event_irq_handler()
860 alpha_perf_event_update(event, hwc, idx, alpha_pmu->pmc_max_period[idx]+1); in alpha_perf_event_irq_handler()
863 if (alpha_perf_event_set_period(event, hwc, idx)) { in alpha_perf_event_irq_handler()
864 if (perf_event_overflow(event, &data, regs)) { in alpha_perf_event_irq_handler()
868 alpha_pmu_stop(event, 0); in alpha_perf_event_irq_handler()