Lines Matching refs:ref

354 	struct imc_pmu_ref *ref;  in ppc_nest_imc_cpu_offline()  local
405 ref = get_nest_pmu_ref(cpu); in ppc_nest_imc_cpu_offline()
406 if (!ref) in ppc_nest_imc_cpu_offline()
409 ref->refc = 0; in ppc_nest_imc_cpu_offline()
455 struct imc_pmu_ref *ref; in nest_imc_counters_release() local
468 ref = get_nest_pmu_ref(event->cpu); in nest_imc_counters_release()
469 if (!ref) in nest_imc_counters_release()
473 mutex_lock(&ref->lock); in nest_imc_counters_release()
474 if (ref->refc == 0) { in nest_imc_counters_release()
485 mutex_unlock(&ref->lock); in nest_imc_counters_release()
488 ref->refc--; in nest_imc_counters_release()
489 if (ref->refc == 0) { in nest_imc_counters_release()
493 mutex_unlock(&ref->lock); in nest_imc_counters_release()
497 } else if (ref->refc < 0) { in nest_imc_counters_release()
499 ref->refc = 0; in nest_imc_counters_release()
501 mutex_unlock(&ref->lock); in nest_imc_counters_release()
510 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 mutex_lock(&ref->lock); in nest_imc_event_init()
568 if (ref->refc == 0) { in nest_imc_event_init()
572 mutex_unlock(&ref->lock); in nest_imc_event_init()
578 ++ref->refc; in nest_imc_event_init()
579 mutex_unlock(&ref->lock); in nest_imc_event_init()
672 struct imc_pmu_ref *ref; in ppc_core_imc_cpu_offline() local
713 ref = &core_imc_refc[core_id]; in ppc_core_imc_cpu_offline()
714 if (!ref) in ppc_core_imc_cpu_offline()
717 ref->refc = 0; in ppc_core_imc_cpu_offline()
760 struct imc_pmu_ref *ref; in core_imc_counters_release() local
773 ref = &core_imc_refc[core_id]; in core_imc_counters_release()
774 if (!ref) in core_imc_counters_release()
777 mutex_lock(&ref->lock); in core_imc_counters_release()
778 if (ref->refc == 0) { in core_imc_counters_release()
789 mutex_unlock(&ref->lock); in core_imc_counters_release()
792 ref->refc--; in core_imc_counters_release()
793 if (ref->refc == 0) { in core_imc_counters_release()
797 mutex_unlock(&ref->lock); in core_imc_counters_release()
801 } else if (ref->refc < 0) { in core_imc_counters_release()
803 ref->refc = 0; in core_imc_counters_release()
805 mutex_unlock(&ref->lock); in core_imc_counters_release()
816 struct imc_pmu_ref *ref; in core_imc_event_init() local
844 ref = &core_imc_refc[core_id]; in core_imc_event_init()
845 if (!ref) in core_imc_event_init()
854 mutex_lock(&ref->lock); in core_imc_event_init()
855 if (ref->refc == 0) { in core_imc_event_init()
859 mutex_unlock(&ref->lock); in core_imc_event_init()
865 ++ref->refc; in core_imc_event_init()
866 mutex_unlock(&ref->lock); in core_imc_event_init()
1122 struct imc_pmu_ref *ref; in thread_imc_event_add() local
1141 ref = &core_imc_refc[core_id]; in thread_imc_event_add()
1142 if (!ref) in thread_imc_event_add()
1145 mutex_lock(&ref->lock); in thread_imc_event_add()
1146 if (ref->refc == 0) { in thread_imc_event_add()
1149 mutex_unlock(&ref->lock); in thread_imc_event_add()
1155 ++ref->refc; in thread_imc_event_add()
1156 mutex_unlock(&ref->lock); in thread_imc_event_add()
1164 struct imc_pmu_ref *ref; in thread_imc_event_del() local
1167 ref = &core_imc_refc[core_id]; in thread_imc_event_del()
1168 if (!ref) { in thread_imc_event_del()
1173 mutex_lock(&ref->lock); in thread_imc_event_del()
1174 ref->refc--; in thread_imc_event_del()
1175 if (ref->refc == 0) { in thread_imc_event_del()
1178 mutex_unlock(&ref->lock); in thread_imc_event_del()
1183 } else if (ref->refc < 0) { in thread_imc_event_del()
1184 ref->refc = 0; in thread_imc_event_del()
1186 mutex_unlock(&ref->lock); in thread_imc_event_del()
1358 struct imc_pmu_ref *ref = NULL; in trace_imc_event_add() local
1367 ref = &trace_imc_refc[core_id]; in trace_imc_event_add()
1368 if (!ref) { in trace_imc_event_add()
1374 mutex_lock(&ref->lock); in trace_imc_event_add()
1375 if (ref->refc == 0) { in trace_imc_event_add()
1378 mutex_unlock(&ref->lock); in trace_imc_event_add()
1383 ++ref->refc; in trace_imc_event_add()
1384 mutex_unlock(&ref->lock); in trace_imc_event_add()
1408 struct imc_pmu_ref *ref = NULL; in trace_imc_event_del() local
1411 ref = &trace_imc_refc[core_id]; in trace_imc_event_del()
1412 if (!ref) { in trace_imc_event_del()
1417 mutex_lock(&ref->lock); in trace_imc_event_del()
1418 ref->refc--; in trace_imc_event_del()
1419 if (ref->refc == 0) { in trace_imc_event_del()
1422 mutex_unlock(&ref->lock); in trace_imc_event_del()
1426 } else if (ref->refc < 0) { in trace_imc_event_del()
1427 ref->refc = 0; in trace_imc_event_del()
1429 mutex_unlock(&ref->lock); in trace_imc_event_del()