Lines Matching refs:arc_pmu

192 struct arc_pmu {  struct
258 static struct arc_pmu *arc_pmu; variable
335 hwc->sample_period = arc_pmu->max_period; in arc_pmu_event_init()
356 if (arc_pmu->ev_hw_idx[event->attr.config] < 0) in arc_pmu_event_init()
358 hwc->config |= arc_pmu->ev_hw_idx[event->attr.config]; in arc_pmu_event_init()
368 hwc->config |= arc_pmu->ev_hw_idx[ret]; in arc_pmu_event_init()
374 if (event->attr.config >= arc_pmu->n_events) in arc_pmu_event_init()
380 arc_pmu->raw_entry[event->attr.config].name); in arc_pmu_event_init()
428 if (left > arc_pmu->max_period) in arc_pmu_event_set_period()
429 left = arc_pmu->max_period; in arc_pmu_event_set_period()
431 value = arc_pmu->max_period - left; in arc_pmu_event_set_period()
529 if (idx == arc_pmu->n_counters) in arc_pmu_add()
542 lower_32_bits(arc_pmu->max_period)); in arc_pmu_add()
544 upper_32_bits(arc_pmu->max_period)); in arc_pmu_add()
570 arc_pmu_disable(&arc_pmu->pmu); in arc_pmu_intr()
611 arc_pmu_enable(&arc_pmu->pmu); in arc_pmu_intr()
667 memmove(arc_pmu->raw_entry[j].name, str, ARCPMU_EVENT_NAME_LEN - 1); in arc_pmu_add_raw_event_attr()
668 arc_pmu->attr[j].attr.attr.name = arc_pmu->raw_entry[j].name; in arc_pmu_add_raw_event_attr()
669 arc_pmu->attr[j].attr.attr.mode = VERIFY_OCTAL_PERMISSIONS(0444); in arc_pmu_add_raw_event_attr()
670 arc_pmu->attr[j].attr.show = arc_pmu_events_sysfs_show; in arc_pmu_add_raw_event_attr()
671 arc_pmu->attr[j].id = j; in arc_pmu_add_raw_event_attr()
672 arc_pmu->attrs[j] = &(arc_pmu->attr[j].attr.attr); in arc_pmu_add_raw_event_attr()
677 arc_pmu->attr = devm_kmalloc_array(dev, arc_pmu->n_events + 1, in arc_pmu_raw_alloc()
678 sizeof(*arc_pmu->attr), GFP_KERNEL | __GFP_ZERO); in arc_pmu_raw_alloc()
679 if (!arc_pmu->attr) in arc_pmu_raw_alloc()
682 arc_pmu->attrs = devm_kmalloc_array(dev, arc_pmu->n_events + 1, in arc_pmu_raw_alloc()
683 sizeof(*arc_pmu->attrs), GFP_KERNEL | __GFP_ZERO); in arc_pmu_raw_alloc()
684 if (!arc_pmu->attrs) in arc_pmu_raw_alloc()
687 arc_pmu->raw_entry = devm_kmalloc_array(dev, arc_pmu->n_events, in arc_pmu_raw_alloc()
688 sizeof(*arc_pmu->raw_entry), GFP_KERNEL | __GFP_ZERO); in arc_pmu_raw_alloc()
689 if (!arc_pmu->raw_entry) in arc_pmu_raw_alloc()
718 arc_pmu->ev_hw_idx[i] = j; in arc_pmu_map_hw_event()
752 arc_pmu = devm_kzalloc(&pdev->dev, sizeof(struct arc_pmu), GFP_KERNEL); in arc_pmu_device_probe()
753 if (!arc_pmu) in arc_pmu_device_probe()
756 arc_pmu->n_events = cc_bcr.c; in arc_pmu_device_probe()
763 arc_pmu->n_counters = pct_bcr.c; in arc_pmu_device_probe()
766 arc_pmu->max_period = (1ULL << counter_size) / 2 - 1ULL; in arc_pmu_device_probe()
769 arc_pmu->n_counters, counter_size, cc_bcr.c, in arc_pmu_device_probe()
774 arc_pmu->ev_hw_idx[i] = -1; in arc_pmu_device_probe()
786 arc_pmu_events_attr_gr.attrs = arc_pmu->attrs; in arc_pmu_device_probe()
787 arc_pmu->attr_groups[ARCPMU_ATTR_GR_EVENTS] = &arc_pmu_events_attr_gr; in arc_pmu_device_probe()
788 arc_pmu->attr_groups[ARCPMU_ATTR_GR_FORMATS] = &arc_pmu_format_attr_gr; in arc_pmu_device_probe()
790 arc_pmu->pmu = (struct pmu) { in arc_pmu_device_probe()
799 .attr_groups = arc_pmu->attr_groups, in arc_pmu_device_probe()
807 arc_pmu->irq = irq; in arc_pmu_device_probe()
822 arc_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT; in arc_pmu_device_probe()
828 return perf_pmu_register(&arc_pmu->pmu, "arc_pct", PERF_TYPE_RAW); in arc_pmu_device_probe()