Lines Matching refs:hwc

253 				struct hw_perf_event *hwc, int idx)  in alpha_perf_event_set_period()  argument
255 long left = local64_read(&hwc->period_left); in alpha_perf_event_set_period()
256 long period = hwc->sample_period; in alpha_perf_event_set_period()
261 local64_set(&hwc->period_left, left); in alpha_perf_event_set_period()
262 hwc->last_period = period; in alpha_perf_event_set_period()
268 local64_set(&hwc->period_left, left); in alpha_perf_event_set_period()
269 hwc->last_period = period; in alpha_perf_event_set_period()
283 local64_set(&hwc->prev_count, (unsigned long)(-left)); in alpha_perf_event_set_period()
308 struct hw_perf_event *hwc, int idx, long ovf) in alpha_perf_event_update() argument
314 prev_raw_count = local64_read(&hwc->prev_count); in alpha_perf_event_update()
317 if (local64_cmpxchg(&hwc->prev_count, prev_raw_count, in alpha_perf_event_update()
331 local64_sub(delta, &hwc->period_left); in alpha_perf_event_update()
413 struct hw_perf_event *hwc = &pe->hw; in maybe_change_configuration() local
414 int idx = hwc->idx; in maybe_change_configuration()
417 alpha_perf_event_set_period(pe, hwc, idx); in maybe_change_configuration()
421 if (!(hwc->state & PERF_HES_STOPPED)) in maybe_change_configuration()
436 struct hw_perf_event *hwc = &event->hw; in alpha_pmu_add() local
469 hwc->state = PERF_HES_UPTODATE; in alpha_pmu_add()
471 hwc->state |= PERF_HES_STOPPED; in alpha_pmu_add()
488 struct hw_perf_event *hwc = &event->hw; in alpha_pmu_del() local
510 alpha_perf_event_update(event, hwc, idx, 0); in alpha_pmu_del()
526 struct hw_perf_event *hwc = &event->hw; in alpha_pmu_read() local
528 alpha_perf_event_update(event, hwc, hwc->idx, 0); in alpha_pmu_read()
534 struct hw_perf_event *hwc = &event->hw; in alpha_pmu_stop() local
537 if (!(hwc->state & PERF_HES_STOPPED)) { in alpha_pmu_stop()
538 cpuc->idx_mask &= ~(1UL<<hwc->idx); in alpha_pmu_stop()
539 hwc->state |= PERF_HES_STOPPED; in alpha_pmu_stop()
542 if ((flags & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE)) { in alpha_pmu_stop()
543 alpha_perf_event_update(event, hwc, hwc->idx, 0); in alpha_pmu_stop()
544 hwc->state |= PERF_HES_UPTODATE; in alpha_pmu_stop()
548 wrperfmon(PERFMON_CMD_DISABLE, (1UL<<hwc->idx)); in alpha_pmu_stop()
554 struct hw_perf_event *hwc = &event->hw; in alpha_pmu_start() local
557 if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED))) in alpha_pmu_start()
561 WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE)); in alpha_pmu_start()
562 alpha_perf_event_set_period(event, hwc, hwc->idx); in alpha_pmu_start()
565 hwc->state = 0; in alpha_pmu_start()
567 cpuc->idx_mask |= 1UL<<hwc->idx; in alpha_pmu_start()
569 wrperfmon(PERFMON_CMD_ENABLE, (1UL<<hwc->idx)); in alpha_pmu_start()
605 struct hw_perf_event *hwc = &event->hw; in __hw_perf_event_init() local
642 hwc->event_base = ev; in __hw_perf_event_init()
656 evtypes[n] = hwc->event_base; in __hw_perf_event_init()
663 hwc->config_base = 0; in __hw_perf_event_init()
664 hwc->idx = PMC_NO_INDEX; in __hw_perf_event_init()
678 if (!hwc->sample_period) { in __hw_perf_event_init()
679 hwc->sample_period = alpha_pmu->pmc_max_period[0]; in __hw_perf_event_init()
680 hwc->last_period = hwc->sample_period; in __hw_perf_event_init()
681 local64_set(&hwc->period_left, hwc->sample_period); in __hw_perf_event_init()
806 struct hw_perf_event *hwc; in alpha_perf_event_irq_handler() local
851 hwc = &event->hw; in alpha_perf_event_irq_handler()
852 alpha_perf_event_update(event, hwc, idx, alpha_pmu->pmc_max_period[idx]+1); in alpha_perf_event_irq_handler()
853 perf_sample_data_init(&data, 0, hwc->last_period); in alpha_perf_event_irq_handler()
855 if (alpha_perf_event_set_period(event, hwc, idx)) { in alpha_perf_event_irq_handler()