Lines Matching refs:event

87 static int get_counter_set(u64 event)  in get_counter_set()  argument
91 if (event < 32) in get_counter_set()
93 else if (event < 64) in get_counter_set()
95 else if (event < 128) in get_counter_set()
97 else if (event < 256) in get_counter_set()
292 static void hw_perf_event_destroy(struct perf_event *event) in hw_perf_event_destroy() argument
323 static int __hw_perf_event_init(struct perf_event *event) in __hw_perf_event_init() argument
325 struct perf_event_attr *attr = &event->attr; in __hw_perf_event_init()
326 struct hw_perf_event *hwc = &event->hw; in __hw_perf_event_init()
396 event->destroy = hw_perf_event_destroy; in __hw_perf_event_init()
406 static int cpumf_pmu_event_init(struct perf_event *event) in cpumf_pmu_event_init() argument
410 switch (event->attr.type) { in cpumf_pmu_event_init()
414 err = __hw_perf_event_init(event); in cpumf_pmu_event_init()
420 if (unlikely(err) && event->destroy) in cpumf_pmu_event_init()
421 event->destroy(event); in cpumf_pmu_event_init()
426 static int hw_perf_event_reset(struct perf_event *event) in hw_perf_event_reset() argument
432 prev = local64_read(&event->hw.prev_count); in hw_perf_event_reset()
433 err = ecctr(event->hw.config, &new); in hw_perf_event_reset()
444 } while (local64_cmpxchg(&event->hw.prev_count, prev, new) != prev); in hw_perf_event_reset()
449 static int hw_perf_event_update(struct perf_event *event) in hw_perf_event_update() argument
455 prev = local64_read(&event->hw.prev_count); in hw_perf_event_update()
456 err = ecctr(event->hw.config, &new); in hw_perf_event_update()
459 } while (local64_cmpxchg(&event->hw.prev_count, prev, new) != prev); in hw_perf_event_update()
463 local64_add(delta, &event->count); in hw_perf_event_update()
468 static void cpumf_pmu_read(struct perf_event *event) in cpumf_pmu_read() argument
470 if (event->hw.state & PERF_HES_STOPPED) in cpumf_pmu_read()
473 hw_perf_event_update(event); in cpumf_pmu_read()
476 static void cpumf_pmu_start(struct perf_event *event, int flags) in cpumf_pmu_start() argument
479 struct hw_perf_event *hwc = &event->hw; in cpumf_pmu_start()
501 hw_perf_event_reset(event); in cpumf_pmu_start()
507 static void cpumf_pmu_stop(struct perf_event *event, int flags) in cpumf_pmu_stop() argument
510 struct hw_perf_event *hwc = &event->hw; in cpumf_pmu_stop()
519 event->hw.state |= PERF_HES_STOPPED; in cpumf_pmu_stop()
523 hw_perf_event_update(event); in cpumf_pmu_stop()
524 event->hw.state |= PERF_HES_UPTODATE; in cpumf_pmu_stop()
528 static int cpumf_pmu_add(struct perf_event *event, int flags) in cpumf_pmu_add() argument
538 if (validate_ctr_auth(&event->hw)) in cpumf_pmu_add()
541 ctr_set_enable(&cpuhw->state, event->hw.config_base); in cpumf_pmu_add()
542 event->hw.state = PERF_HES_UPTODATE | PERF_HES_STOPPED; in cpumf_pmu_add()
545 cpumf_pmu_start(event, PERF_EF_RELOAD); in cpumf_pmu_add()
547 perf_event_update_userpage(event); in cpumf_pmu_add()
552 static void cpumf_pmu_del(struct perf_event *event, int flags) in cpumf_pmu_del() argument
556 cpumf_pmu_stop(event, PERF_EF_UPDATE); in cpumf_pmu_del()
566 if (!atomic_read(&cpuhw->ctr_set[event->hw.config_base])) in cpumf_pmu_del()
567 ctr_set_disable(&cpuhw->state, event->hw.config_base); in cpumf_pmu_del()
569 perf_event_update_userpage(event); in cpumf_pmu_del()