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()
1126 struct imc_pmu_ref *ref; in thread_imc_event_add() local
1145 ref = &core_imc_refc[core_id]; in thread_imc_event_add()
1146 if (!ref) in thread_imc_event_add()
1149 spin_lock(&ref->lock); in thread_imc_event_add()
1150 if (ref->refc == 0) { in thread_imc_event_add()
1153 spin_unlock(&ref->lock); in thread_imc_event_add()
1159 ++ref->refc; in thread_imc_event_add()
1160 spin_unlock(&ref->lock); in thread_imc_event_add()
1168 struct imc_pmu_ref *ref; in thread_imc_event_del() local
1171 ref = &core_imc_refc[core_id]; in thread_imc_event_del()
1172 if (!ref) { in thread_imc_event_del()
1177 spin_lock(&ref->lock); in thread_imc_event_del()
1178 ref->refc--; in thread_imc_event_del()
1179 if (ref->refc == 0) { in thread_imc_event_del()
1182 spin_unlock(&ref->lock); in thread_imc_event_del()
1187 } else if (ref->refc < 0) { in thread_imc_event_del()
1188 ref->refc = 0; in thread_imc_event_del()
1190 spin_unlock(&ref->lock); in thread_imc_event_del()
1361 struct imc_pmu_ref *ref = NULL; in trace_imc_event_add() local
1370 ref = &trace_imc_refc[core_id]; in trace_imc_event_add()
1371 if (!ref) { in trace_imc_event_add()
1377 spin_lock(&ref->lock); in trace_imc_event_add()
1378 if (ref->refc == 0) { in trace_imc_event_add()
1381 spin_unlock(&ref->lock); in trace_imc_event_add()
1386 ++ref->refc; in trace_imc_event_add()
1387 spin_unlock(&ref->lock); in trace_imc_event_add()
1411 struct imc_pmu_ref *ref = NULL; in trace_imc_event_del() local
1414 ref = &trace_imc_refc[core_id]; in trace_imc_event_del()
1415 if (!ref) { in trace_imc_event_del()
1420 spin_lock(&ref->lock); in trace_imc_event_del()
1421 ref->refc--; in trace_imc_event_del()
1422 if (ref->refc == 0) { in trace_imc_event_del()
1425 spin_unlock(&ref->lock); in trace_imc_event_del()
1429 } else if (ref->refc < 0) { in trace_imc_event_del()
1430 ref->refc = 0; in trace_imc_event_del()
1432 spin_unlock(&ref->lock); in trace_imc_event_del()