Lines Matching refs:event

89 static int get_counter_set(u64 event)  in get_counter_set()  argument
93 if (event < 32) in get_counter_set()
95 else if (event < 64) in get_counter_set()
97 else if (event < 128) in get_counter_set()
99 else if (event < 256) in get_counter_set()
298 static void hw_perf_event_destroy(struct perf_event *event) in hw_perf_event_destroy() argument
329 static int __hw_perf_event_init(struct perf_event *event) in __hw_perf_event_init() argument
331 struct perf_event_attr *attr = &event->attr; in __hw_perf_event_init()
332 struct hw_perf_event *hwc = &event->hw; in __hw_perf_event_init()
402 event->destroy = hw_perf_event_destroy; in __hw_perf_event_init()
412 static int cpumf_pmu_event_init(struct perf_event *event) in cpumf_pmu_event_init() argument
416 switch (event->attr.type) { in cpumf_pmu_event_init()
420 err = __hw_perf_event_init(event); in cpumf_pmu_event_init()
426 if (unlikely(err) && event->destroy) in cpumf_pmu_event_init()
427 event->destroy(event); in cpumf_pmu_event_init()
432 static int hw_perf_event_reset(struct perf_event *event) in hw_perf_event_reset() argument
438 prev = local64_read(&event->hw.prev_count); in hw_perf_event_reset()
439 err = ecctr(event->hw.config, &new); in hw_perf_event_reset()
450 } while (local64_cmpxchg(&event->hw.prev_count, prev, new) != prev); in hw_perf_event_reset()
455 static int hw_perf_event_update(struct perf_event *event) in hw_perf_event_update() argument
461 prev = local64_read(&event->hw.prev_count); in hw_perf_event_update()
462 err = ecctr(event->hw.config, &new); in hw_perf_event_update()
465 } while (local64_cmpxchg(&event->hw.prev_count, prev, new) != prev); in hw_perf_event_update()
469 local64_add(delta, &event->count); in hw_perf_event_update()
474 static void cpumf_pmu_read(struct perf_event *event) in cpumf_pmu_read() argument
476 if (event->hw.state & PERF_HES_STOPPED) in cpumf_pmu_read()
479 hw_perf_event_update(event); in cpumf_pmu_read()
482 static void cpumf_pmu_start(struct perf_event *event, int flags) in cpumf_pmu_start() argument
485 struct hw_perf_event *hwc = &event->hw; in cpumf_pmu_start()
507 hw_perf_event_reset(event); in cpumf_pmu_start()
513 static void cpumf_pmu_stop(struct perf_event *event, int flags) in cpumf_pmu_stop() argument
516 struct hw_perf_event *hwc = &event->hw; in cpumf_pmu_stop()
525 event->hw.state |= PERF_HES_STOPPED; in cpumf_pmu_stop()
529 hw_perf_event_update(event); in cpumf_pmu_stop()
530 event->hw.state |= PERF_HES_UPTODATE; in cpumf_pmu_stop()
534 static int cpumf_pmu_add(struct perf_event *event, int flags) in cpumf_pmu_add() argument
544 if (validate_ctr_auth(&event->hw)) in cpumf_pmu_add()
547 ctr_set_enable(&cpuhw->state, event->hw.config_base); in cpumf_pmu_add()
548 event->hw.state = PERF_HES_UPTODATE | PERF_HES_STOPPED; in cpumf_pmu_add()
551 cpumf_pmu_start(event, PERF_EF_RELOAD); in cpumf_pmu_add()
553 perf_event_update_userpage(event); in cpumf_pmu_add()
558 static void cpumf_pmu_del(struct perf_event *event, int flags) in cpumf_pmu_del() argument
562 cpumf_pmu_stop(event, PERF_EF_UPDATE); in cpumf_pmu_del()
572 if (!atomic_read(&cpuhw->ctr_set[event->hw.config_base])) in cpumf_pmu_del()
573 ctr_set_disable(&cpuhw->state, event->hw.config_base); in cpumf_pmu_del()
575 perf_event_update_userpage(event); in cpumf_pmu_del()