Lines Matching refs:ref

355 	struct imc_pmu_ref *ref;  in ppc_nest_imc_cpu_offline()  local
406 ref = get_nest_pmu_ref(cpu); in ppc_nest_imc_cpu_offline()
407 if (!ref) in ppc_nest_imc_cpu_offline()
410 ref->refc = 0; in ppc_nest_imc_cpu_offline()
456 struct imc_pmu_ref *ref; in nest_imc_counters_release() local
469 ref = get_nest_pmu_ref(event->cpu); in nest_imc_counters_release()
470 if (!ref) in nest_imc_counters_release()
474 spin_lock(&ref->lock); in nest_imc_counters_release()
475 if (ref->refc == 0) { in nest_imc_counters_release()
486 spin_unlock(&ref->lock); in nest_imc_counters_release()
489 ref->refc--; in nest_imc_counters_release()
490 if (ref->refc == 0) { in nest_imc_counters_release()
494 spin_unlock(&ref->lock); in nest_imc_counters_release()
498 } else if (ref->refc < 0) { in nest_imc_counters_release()
500 ref->refc = 0; in nest_imc_counters_release()
502 spin_unlock(&ref->lock); in nest_imc_counters_release()
511 struct imc_pmu_ref *ref; in nest_imc_event_init() local
563 ref = get_nest_pmu_ref(event->cpu); in nest_imc_event_init()
564 if (!ref) in nest_imc_event_init()
567 spin_lock(&ref->lock); in nest_imc_event_init()
568 if (ref->refc == 0) { in nest_imc_event_init()
572 spin_unlock(&ref->lock); in nest_imc_event_init()
578 ++ref->refc; in nest_imc_event_init()
579 spin_unlock(&ref->lock); in nest_imc_event_init()
671 struct imc_pmu_ref *ref; in ppc_core_imc_cpu_offline() local
711 ref = &core_imc_refc[core_id]; in ppc_core_imc_cpu_offline()
712 if (!ref) in ppc_core_imc_cpu_offline()
715 ref->refc = 0; in ppc_core_imc_cpu_offline()
758 struct imc_pmu_ref *ref; in core_imc_counters_release() local
771 ref = &core_imc_refc[core_id]; in core_imc_counters_release()
772 if (!ref) in core_imc_counters_release()
775 spin_lock(&ref->lock); in core_imc_counters_release()
776 if (ref->refc == 0) { in core_imc_counters_release()
787 spin_unlock(&ref->lock); in core_imc_counters_release()
790 ref->refc--; in core_imc_counters_release()
791 if (ref->refc == 0) { in core_imc_counters_release()
795 spin_unlock(&ref->lock); in core_imc_counters_release()
799 } else if (ref->refc < 0) { in core_imc_counters_release()
801 ref->refc = 0; in core_imc_counters_release()
803 spin_unlock(&ref->lock); in core_imc_counters_release()
814 struct imc_pmu_ref *ref; in core_imc_event_init() local
841 ref = &core_imc_refc[core_id]; in core_imc_event_init()
842 if (!ref) in core_imc_event_init()
851 spin_lock(&ref->lock); in core_imc_event_init()
852 if (ref->refc == 0) { in core_imc_event_init()
856 spin_unlock(&ref->lock); in core_imc_event_init()
862 ++ref->refc; in core_imc_event_init()
863 spin_unlock(&ref->lock); in core_imc_event_init()
1119 struct imc_pmu_ref *ref; in thread_imc_event_add() local
1138 ref = &core_imc_refc[core_id]; in thread_imc_event_add()
1139 if (!ref) in thread_imc_event_add()
1142 spin_lock(&ref->lock); in thread_imc_event_add()
1143 if (ref->refc == 0) { in thread_imc_event_add()
1146 spin_unlock(&ref->lock); in thread_imc_event_add()
1152 ++ref->refc; in thread_imc_event_add()
1153 spin_unlock(&ref->lock); in thread_imc_event_add()
1161 struct imc_pmu_ref *ref; in thread_imc_event_del() local
1164 ref = &core_imc_refc[core_id]; in thread_imc_event_del()
1165 if (!ref) { in thread_imc_event_del()
1170 spin_lock(&ref->lock); in thread_imc_event_del()
1171 ref->refc--; in thread_imc_event_del()
1172 if (ref->refc == 0) { in thread_imc_event_del()
1175 spin_unlock(&ref->lock); in thread_imc_event_del()
1180 } else if (ref->refc < 0) { in thread_imc_event_del()
1181 ref->refc = 0; in thread_imc_event_del()
1183 spin_unlock(&ref->lock); in thread_imc_event_del()
1354 struct imc_pmu_ref *ref = NULL; in trace_imc_event_add() local
1363 ref = &trace_imc_refc[core_id]; in trace_imc_event_add()
1364 if (!ref) { in trace_imc_event_add()
1370 spin_lock(&ref->lock); in trace_imc_event_add()
1371 if (ref->refc == 0) { in trace_imc_event_add()
1374 spin_unlock(&ref->lock); in trace_imc_event_add()
1379 ++ref->refc; in trace_imc_event_add()
1380 spin_unlock(&ref->lock); in trace_imc_event_add()
1404 struct imc_pmu_ref *ref = NULL; in trace_imc_event_del() local
1407 ref = &trace_imc_refc[core_id]; in trace_imc_event_del()
1408 if (!ref) { in trace_imc_event_del()
1413 spin_lock(&ref->lock); in trace_imc_event_del()
1414 ref->refc--; in trace_imc_event_del()
1415 if (ref->refc == 0) { in trace_imc_event_del()
1418 spin_unlock(&ref->lock); in trace_imc_event_del()
1422 } else if (ref->refc < 0) { in trace_imc_event_del()
1423 ref->refc = 0; in trace_imc_event_del()
1425 spin_unlock(&ref->lock); in trace_imc_event_del()