Lines Matching refs:pmu
59 return container_of(event->pmu, struct imc_pmu, pmu); in imc_event_to_pmu()
103 struct pmu *pmu = dev_get_drvdata(dev); in imc_pmu_cpumask_get_attr() local
104 struct imc_pmu *imc_pmu = container_of(pmu, struct imc_pmu, pmu); in imc_pmu_cpumask_get_attr()
219 static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu) in update_events_in_group() argument
256 pmu->events = kcalloc(ct, sizeof(struct imc_events), GFP_KERNEL); in update_events_in_group()
257 if (!pmu->events) in update_events_in_group()
263 ret = imc_parse_event(np, g_scale, g_unit, prefix, base_reg, &pmu->events[ct]); in update_events_in_group()
271 imc_free_events(pmu->events, ct); in update_events_in_group()
286 imc_free_events(pmu->events, ct); in update_events_in_group()
293 ev_val_str = kasprintf(GFP_KERNEL, "event=0x%x", pmu->events[i].value); in update_events_in_group()
294 dev_str = device_str_attr_create(pmu->events[i].name, ev_val_str); in update_events_in_group()
299 if (pmu->events[i].scale) { in update_events_in_group()
300 ev_scale_str = kasprintf(GFP_KERNEL, "%s.scale", pmu->events[i].name); in update_events_in_group()
301 dev_str = device_str_attr_create(ev_scale_str, pmu->events[i].scale); in update_events_in_group()
308 if (pmu->events[i].unit) { in update_events_in_group()
309 ev_unit_str = kasprintf(GFP_KERNEL, "%s.unit", pmu->events[i].name); in update_events_in_group()
310 dev_str = device_str_attr_create(ev_unit_str, pmu->events[i].unit); in update_events_in_group()
319 pmu->attr_groups[IMC_EVENT_ATTR] = attr_group; in update_events_in_group()
338 perf_pmu_migrate_context(&(*pn)->pmu, old_cpu, new_cpu); in nest_change_cpu_context()
502 struct imc_pmu *pmu; in nest_imc_event_init() local
506 if (event->attr.type != event->pmu->type) in nest_imc_event_init()
516 pmu = imc_event_to_pmu(event); in nest_imc_event_init()
519 if ((config & IMC_EVENT_OFFSET_MASK) > pmu->counter_mem_size) in nest_imc_event_init()
532 pcni = pmu->mem_info; in nest_imc_event_init()
685 if (!core_imc_pmu->pmu.event_init) in ppc_core_imc_cpu_offline()
696 perf_pmu_migrate_context(&core_imc_pmu->pmu, cpu, ncpu); in ppc_core_imc_cpu_offline()
808 struct imc_pmu *pmu; in core_imc_event_init() local
811 if (event->attr.type != event->pmu->type) in core_imc_event_init()
822 pmu = imc_event_to_pmu(event); in core_imc_event_init()
825 if (((config & IMC_EVENT_OFFSET_MASK) > pmu->counter_mem_size)) in core_imc_event_init()
974 struct imc_pmu *pmu; in thread_imc_event_init() local
976 if (event->attr.type != event->pmu->type) in thread_imc_event_init()
987 pmu = imc_event_to_pmu(event); in thread_imc_event_init()
990 if (((config & IMC_EVENT_OFFSET_MASK) > pmu->counter_mem_size)) in thread_imc_event_init()
1011 event->pmu->task_ctx_nr = perf_sw_context; in thread_imc_event_init()
1018 if (!strncmp(event->pmu->name, "thread_imc", strlen("thread_imc"))) in is_thread_imc_pmu()
1036 static void thread_imc_pmu_start_txn(struct pmu *pmu, in thread_imc_pmu_start_txn() argument
1041 perf_pmu_disable(pmu); in thread_imc_pmu_start_txn()
1044 static void thread_imc_pmu_cancel_txn(struct pmu *pmu) in thread_imc_pmu_cancel_txn() argument
1046 perf_pmu_enable(pmu); in thread_imc_pmu_cancel_txn()
1049 static int thread_imc_pmu_commit_txn(struct pmu *pmu) in thread_imc_pmu_commit_txn() argument
1051 perf_pmu_enable(pmu); in thread_imc_pmu_commit_txn()
1429 if (event->attr.type != event->pmu->type) in trace_imc_event_init()
1460 event->pmu->task_ctx_nr = perf_hw_context; in trace_imc_event_init()
1466 static int update_pmu_ops(struct imc_pmu *pmu) in update_pmu_ops() argument
1468 pmu->pmu.task_ctx_nr = perf_invalid_context; in update_pmu_ops()
1469 pmu->pmu.add = imc_event_add; in update_pmu_ops()
1470 pmu->pmu.del = imc_event_stop; in update_pmu_ops()
1471 pmu->pmu.start = imc_event_start; in update_pmu_ops()
1472 pmu->pmu.stop = imc_event_stop; in update_pmu_ops()
1473 pmu->pmu.read = imc_event_update; in update_pmu_ops()
1474 pmu->pmu.attr_groups = pmu->attr_groups; in update_pmu_ops()
1475 pmu->pmu.capabilities = PERF_PMU_CAP_NO_EXCLUDE; in update_pmu_ops()
1476 pmu->attr_groups[IMC_FORMAT_ATTR] = &imc_format_group; in update_pmu_ops()
1478 switch (pmu->domain) { in update_pmu_ops()
1480 pmu->pmu.event_init = nest_imc_event_init; in update_pmu_ops()
1481 pmu->attr_groups[IMC_CPUMASK_ATTR] = &imc_pmu_cpumask_attr_group; in update_pmu_ops()
1484 pmu->pmu.event_init = core_imc_event_init; in update_pmu_ops()
1485 pmu->attr_groups[IMC_CPUMASK_ATTR] = &imc_pmu_cpumask_attr_group; in update_pmu_ops()
1488 pmu->pmu.event_init = thread_imc_event_init; in update_pmu_ops()
1489 pmu->pmu.add = thread_imc_event_add; in update_pmu_ops()
1490 pmu->pmu.del = thread_imc_event_del; in update_pmu_ops()
1491 pmu->pmu.start_txn = thread_imc_pmu_start_txn; in update_pmu_ops()
1492 pmu->pmu.cancel_txn = thread_imc_pmu_cancel_txn; in update_pmu_ops()
1493 pmu->pmu.commit_txn = thread_imc_pmu_commit_txn; in update_pmu_ops()
1496 pmu->pmu.event_init = trace_imc_event_init; in update_pmu_ops()
1497 pmu->pmu.add = trace_imc_event_add; in update_pmu_ops()
1498 pmu->pmu.del = trace_imc_event_del; in update_pmu_ops()
1499 pmu->pmu.start = trace_imc_event_start; in update_pmu_ops()
1500 pmu->pmu.stop = trace_imc_event_stop; in update_pmu_ops()
1501 pmu->pmu.read = trace_imc_event_read; in update_pmu_ops()
1502 pmu->attr_groups[IMC_FORMAT_ATTR] = &trace_imc_format_group; in update_pmu_ops()
1663 perf_pmu_unregister(&thread_imc_pmu->pmu); in unregister_thread_imc()
1681 pmu_ptr->pmu.name = kasprintf(GFP_KERNEL, "%s%s_imc", "nest_", s); in imc_mem_init()
1682 if (!pmu_ptr->pmu.name) in imc_mem_init()
1697 pmu_ptr->pmu.name = kasprintf(GFP_KERNEL, "%s%s", s, "_imc"); in imc_mem_init()
1698 if (!pmu_ptr->pmu.name) in imc_mem_init()
1720 pmu_ptr->pmu.name = kasprintf(GFP_KERNEL, "%s%s", s, "_imc"); in imc_mem_init()
1721 if (!pmu_ptr->pmu.name) in imc_mem_init()
1737 pmu_ptr->pmu.name = kasprintf(GFP_KERNEL, "%s%s", s, "_imc"); in imc_mem_init()
1738 if (!pmu_ptr->pmu.name) in imc_mem_init()
1849 ret = perf_pmu_register(&pmu_ptr->pmu, pmu_ptr->pmu.name, -1); in init_imc_pmu()
1854 pmu_ptr->pmu.name); in init_imc_pmu()