Lines Matching refs:ref

347 	struct imc_pmu_ref *ref;  in ppc_nest_imc_cpu_offline()  local
398 ref = get_nest_pmu_ref(cpu); in ppc_nest_imc_cpu_offline()
399 if (!ref) in ppc_nest_imc_cpu_offline()
402 ref->refc = 0; in ppc_nest_imc_cpu_offline()
448 struct imc_pmu_ref *ref; in nest_imc_counters_release() local
461 ref = get_nest_pmu_ref(event->cpu); in nest_imc_counters_release()
462 if (!ref) in nest_imc_counters_release()
466 mutex_lock(&ref->lock); in nest_imc_counters_release()
467 if (ref->refc == 0) { in nest_imc_counters_release()
478 mutex_unlock(&ref->lock); in nest_imc_counters_release()
481 ref->refc--; in nest_imc_counters_release()
482 if (ref->refc == 0) { in nest_imc_counters_release()
486 mutex_unlock(&ref->lock); in nest_imc_counters_release()
490 } else if (ref->refc < 0) { in nest_imc_counters_release()
492 ref->refc = 0; in nest_imc_counters_release()
494 mutex_unlock(&ref->lock); in nest_imc_counters_release()
503 struct imc_pmu_ref *ref; in nest_imc_event_init() local
556 ref = get_nest_pmu_ref(event->cpu); in nest_imc_event_init()
557 if (!ref) in nest_imc_event_init()
560 mutex_lock(&ref->lock); in nest_imc_event_init()
561 if (ref->refc == 0) { in nest_imc_event_init()
565 mutex_unlock(&ref->lock); in nest_imc_event_init()
571 ++ref->refc; in nest_imc_event_init()
572 mutex_unlock(&ref->lock); in nest_imc_event_init()
665 struct imc_pmu_ref *ref; in ppc_core_imc_cpu_offline() local
706 ref = &core_imc_refc[core_id]; in ppc_core_imc_cpu_offline()
707 if (!ref) in ppc_core_imc_cpu_offline()
710 ref->refc = 0; in ppc_core_imc_cpu_offline()
753 struct imc_pmu_ref *ref; in core_imc_counters_release() local
766 ref = &core_imc_refc[core_id]; in core_imc_counters_release()
767 if (!ref) in core_imc_counters_release()
770 mutex_lock(&ref->lock); in core_imc_counters_release()
771 if (ref->refc == 0) { in core_imc_counters_release()
782 mutex_unlock(&ref->lock); in core_imc_counters_release()
785 ref->refc--; in core_imc_counters_release()
786 if (ref->refc == 0) { in core_imc_counters_release()
790 mutex_unlock(&ref->lock); in core_imc_counters_release()
794 } else if (ref->refc < 0) { in core_imc_counters_release()
796 ref->refc = 0; in core_imc_counters_release()
798 mutex_unlock(&ref->lock); in core_imc_counters_release()
809 struct imc_pmu_ref *ref; in core_imc_event_init() local
837 ref = &core_imc_refc[core_id]; in core_imc_event_init()
838 if (!ref) in core_imc_event_init()
847 mutex_lock(&ref->lock); in core_imc_event_init()
848 if (ref->refc == 0) { in core_imc_event_init()
852 mutex_unlock(&ref->lock); in core_imc_event_init()
858 ++ref->refc; in core_imc_event_init()
859 mutex_unlock(&ref->lock); in core_imc_event_init()
1115 struct imc_pmu_ref *ref; in thread_imc_event_add() local
1134 ref = &core_imc_refc[core_id]; in thread_imc_event_add()
1135 if (!ref) in thread_imc_event_add()
1138 mutex_lock(&ref->lock); in thread_imc_event_add()
1139 if (ref->refc == 0) { in thread_imc_event_add()
1142 mutex_unlock(&ref->lock); in thread_imc_event_add()
1148 ++ref->refc; in thread_imc_event_add()
1149 mutex_unlock(&ref->lock); in thread_imc_event_add()
1157 struct imc_pmu_ref *ref; in thread_imc_event_del() local
1160 ref = &core_imc_refc[core_id]; in thread_imc_event_del()
1161 if (!ref) { in thread_imc_event_del()
1166 mutex_lock(&ref->lock); in thread_imc_event_del()
1167 ref->refc--; in thread_imc_event_del()
1168 if (ref->refc == 0) { in thread_imc_event_del()
1171 mutex_unlock(&ref->lock); in thread_imc_event_del()
1176 } else if (ref->refc < 0) { in thread_imc_event_del()
1177 ref->refc = 0; in thread_imc_event_del()
1179 mutex_unlock(&ref->lock); in thread_imc_event_del()
1351 struct imc_pmu_ref *ref = NULL; in trace_imc_event_add() local
1360 ref = &trace_imc_refc[core_id]; in trace_imc_event_add()
1361 if (!ref) { in trace_imc_event_add()
1367 mutex_lock(&ref->lock); in trace_imc_event_add()
1368 if (ref->refc == 0) { in trace_imc_event_add()
1371 mutex_unlock(&ref->lock); in trace_imc_event_add()
1376 ++ref->refc; in trace_imc_event_add()
1377 mutex_unlock(&ref->lock); in trace_imc_event_add()
1401 struct imc_pmu_ref *ref = NULL; in trace_imc_event_del() local
1404 ref = &trace_imc_refc[core_id]; in trace_imc_event_del()
1405 if (!ref) { in trace_imc_event_del()
1410 mutex_lock(&ref->lock); in trace_imc_event_del()
1411 ref->refc--; in trace_imc_event_del()
1412 if (ref->refc == 0) { in trace_imc_event_del()
1415 mutex_unlock(&ref->lock); in trace_imc_event_del()
1419 } else if (ref->refc < 0) { in trace_imc_event_del()
1420 ref->refc = 0; in trace_imc_event_del()
1422 mutex_unlock(&ref->lock); in trace_imc_event_del()