Lines Matching refs:ref

361 	struct imc_pmu_ref *ref;  in ppc_nest_imc_cpu_offline()  local
412 ref = get_nest_pmu_ref(cpu); in ppc_nest_imc_cpu_offline()
413 if (!ref) in ppc_nest_imc_cpu_offline()
416 ref->refc = 0; in ppc_nest_imc_cpu_offline()
462 struct imc_pmu_ref *ref; in nest_imc_counters_release() local
475 ref = get_nest_pmu_ref(event->cpu); in nest_imc_counters_release()
476 if (!ref) in nest_imc_counters_release()
480 spin_lock(&ref->lock); in nest_imc_counters_release()
481 if (ref->refc == 0) { in nest_imc_counters_release()
492 spin_unlock(&ref->lock); in nest_imc_counters_release()
495 ref->refc--; in nest_imc_counters_release()
496 if (ref->refc == 0) { in nest_imc_counters_release()
500 spin_unlock(&ref->lock); in nest_imc_counters_release()
504 } else if (ref->refc < 0) { in nest_imc_counters_release()
506 ref->refc = 0; in nest_imc_counters_release()
508 spin_unlock(&ref->lock); in nest_imc_counters_release()
517 struct imc_pmu_ref *ref; in nest_imc_event_init() local
569 ref = get_nest_pmu_ref(event->cpu); in nest_imc_event_init()
570 if (!ref) in nest_imc_event_init()
573 spin_lock(&ref->lock); in nest_imc_event_init()
574 if (ref->refc == 0) { in nest_imc_event_init()
578 spin_unlock(&ref->lock); in nest_imc_event_init()
584 ++ref->refc; in nest_imc_event_init()
585 spin_unlock(&ref->lock); in nest_imc_event_init()
677 struct imc_pmu_ref *ref; in ppc_core_imc_cpu_offline() local
717 ref = &core_imc_refc[core_id]; in ppc_core_imc_cpu_offline()
718 if (!ref) in ppc_core_imc_cpu_offline()
721 ref->refc = 0; in ppc_core_imc_cpu_offline()
764 struct imc_pmu_ref *ref; in core_imc_counters_release() local
777 ref = &core_imc_refc[core_id]; in core_imc_counters_release()
778 if (!ref) in core_imc_counters_release()
781 spin_lock(&ref->lock); in core_imc_counters_release()
782 if (ref->refc == 0) { in core_imc_counters_release()
793 spin_unlock(&ref->lock); in core_imc_counters_release()
796 ref->refc--; in core_imc_counters_release()
797 if (ref->refc == 0) { in core_imc_counters_release()
801 spin_unlock(&ref->lock); in core_imc_counters_release()
805 } else if (ref->refc < 0) { in core_imc_counters_release()
807 ref->refc = 0; in core_imc_counters_release()
809 spin_unlock(&ref->lock); in core_imc_counters_release()
820 struct imc_pmu_ref *ref; in core_imc_event_init() local
847 ref = &core_imc_refc[core_id]; in core_imc_event_init()
848 if (!ref) in core_imc_event_init()
857 spin_lock(&ref->lock); in core_imc_event_init()
858 if (ref->refc == 0) { in core_imc_event_init()
862 spin_unlock(&ref->lock); in core_imc_event_init()
868 ++ref->refc; in core_imc_event_init()
869 spin_unlock(&ref->lock); in core_imc_event_init()
1125 struct imc_pmu_ref *ref; in thread_imc_event_add() local
1144 ref = &core_imc_refc[core_id]; in thread_imc_event_add()
1145 if (!ref) in thread_imc_event_add()
1148 spin_lock(&ref->lock); in thread_imc_event_add()
1149 if (ref->refc == 0) { in thread_imc_event_add()
1152 spin_unlock(&ref->lock); in thread_imc_event_add()
1158 ++ref->refc; in thread_imc_event_add()
1159 spin_unlock(&ref->lock); in thread_imc_event_add()
1167 struct imc_pmu_ref *ref; in thread_imc_event_del() local
1170 ref = &core_imc_refc[core_id]; in thread_imc_event_del()
1171 if (!ref) { in thread_imc_event_del()
1176 spin_lock(&ref->lock); in thread_imc_event_del()
1177 ref->refc--; in thread_imc_event_del()
1178 if (ref->refc == 0) { in thread_imc_event_del()
1181 spin_unlock(&ref->lock); in thread_imc_event_del()
1186 } else if (ref->refc < 0) { in thread_imc_event_del()
1187 ref->refc = 0; in thread_imc_event_del()
1189 spin_unlock(&ref->lock); in thread_imc_event_del()
1360 struct imc_pmu_ref *ref = NULL; in trace_imc_event_add() local
1369 ref = &trace_imc_refc[core_id]; in trace_imc_event_add()
1370 if (!ref) { in trace_imc_event_add()
1376 spin_lock(&ref->lock); in trace_imc_event_add()
1377 if (ref->refc == 0) { in trace_imc_event_add()
1380 spin_unlock(&ref->lock); in trace_imc_event_add()
1385 ++ref->refc; in trace_imc_event_add()
1386 spin_unlock(&ref->lock); in trace_imc_event_add()
1410 struct imc_pmu_ref *ref = NULL; in trace_imc_event_del() local
1413 ref = &trace_imc_refc[core_id]; in trace_imc_event_del()
1414 if (!ref) { in trace_imc_event_del()
1419 spin_lock(&ref->lock); in trace_imc_event_del()
1420 ref->refc--; in trace_imc_event_del()
1421 if (ref->refc == 0) { in trace_imc_event_del()
1424 spin_unlock(&ref->lock); in trace_imc_event_del()
1428 } else if (ref->refc < 0) { in trace_imc_event_del()
1429 ref->refc = 0; in trace_imc_event_del()
1431 spin_unlock(&ref->lock); in trace_imc_event_del()