Lines Matching refs:ref

337 	struct imc_pmu_ref *ref;  in ppc_nest_imc_cpu_offline()  local
388 ref = get_nest_pmu_ref(cpu); in ppc_nest_imc_cpu_offline()
389 if (!ref) in ppc_nest_imc_cpu_offline()
392 ref->refc = 0; in ppc_nest_imc_cpu_offline()
438 struct imc_pmu_ref *ref; in nest_imc_counters_release() local
451 ref = get_nest_pmu_ref(event->cpu); in nest_imc_counters_release()
452 if (!ref) in nest_imc_counters_release()
456 mutex_lock(&ref->lock); in nest_imc_counters_release()
457 if (ref->refc == 0) { in nest_imc_counters_release()
468 mutex_unlock(&ref->lock); in nest_imc_counters_release()
471 ref->refc--; in nest_imc_counters_release()
472 if (ref->refc == 0) { in nest_imc_counters_release()
476 mutex_unlock(&ref->lock); in nest_imc_counters_release()
480 } else if (ref->refc < 0) { in nest_imc_counters_release()
482 ref->refc = 0; in nest_imc_counters_release()
484 mutex_unlock(&ref->lock); in nest_imc_counters_release()
493 struct imc_pmu_ref *ref; in nest_imc_event_init() local
546 ref = get_nest_pmu_ref(event->cpu); in nest_imc_event_init()
547 if (!ref) in nest_imc_event_init()
550 mutex_lock(&ref->lock); in nest_imc_event_init()
551 if (ref->refc == 0) { in nest_imc_event_init()
555 mutex_unlock(&ref->lock); in nest_imc_event_init()
561 ++ref->refc; in nest_imc_event_init()
562 mutex_unlock(&ref->lock); in nest_imc_event_init()
655 struct imc_pmu_ref *ref; in ppc_core_imc_cpu_offline() local
696 ref = &core_imc_refc[core_id]; in ppc_core_imc_cpu_offline()
697 if (!ref) in ppc_core_imc_cpu_offline()
700 ref->refc = 0; in ppc_core_imc_cpu_offline()
716 struct imc_pmu_ref *ref; in core_imc_counters_release() local
729 ref = &core_imc_refc[core_id]; in core_imc_counters_release()
730 if (!ref) in core_imc_counters_release()
733 mutex_lock(&ref->lock); in core_imc_counters_release()
734 if (ref->refc == 0) { in core_imc_counters_release()
745 mutex_unlock(&ref->lock); in core_imc_counters_release()
748 ref->refc--; in core_imc_counters_release()
749 if (ref->refc == 0) { in core_imc_counters_release()
753 mutex_unlock(&ref->lock); in core_imc_counters_release()
757 } else if (ref->refc < 0) { in core_imc_counters_release()
759 ref->refc = 0; in core_imc_counters_release()
761 mutex_unlock(&ref->lock); in core_imc_counters_release()
770 struct imc_pmu_ref *ref; in core_imc_event_init() local
798 ref = &core_imc_refc[core_id]; in core_imc_event_init()
799 if (!ref) in core_imc_event_init()
808 mutex_lock(&ref->lock); in core_imc_event_init()
809 if (ref->refc == 0) { in core_imc_event_init()
813 mutex_unlock(&ref->lock); in core_imc_event_init()
819 ++ref->refc; in core_imc_event_init()
820 mutex_unlock(&ref->lock); in core_imc_event_init()
1022 struct imc_pmu_ref *ref; in thread_imc_event_add() local
1041 ref = &core_imc_refc[core_id]; in thread_imc_event_add()
1042 if (!ref) in thread_imc_event_add()
1045 mutex_lock(&ref->lock); in thread_imc_event_add()
1046 if (ref->refc == 0) { in thread_imc_event_add()
1049 mutex_unlock(&ref->lock); in thread_imc_event_add()
1055 ++ref->refc; in thread_imc_event_add()
1056 mutex_unlock(&ref->lock); in thread_imc_event_add()
1064 struct imc_pmu_ref *ref; in thread_imc_event_del() local
1069 ref = &core_imc_refc[core_id]; in thread_imc_event_del()
1071 mutex_lock(&ref->lock); in thread_imc_event_del()
1072 ref->refc--; in thread_imc_event_del()
1073 if (ref->refc == 0) { in thread_imc_event_del()
1076 mutex_unlock(&ref->lock); in thread_imc_event_del()
1081 } else if (ref->refc < 0) { in thread_imc_event_del()
1082 ref->refc = 0; in thread_imc_event_del()
1084 mutex_unlock(&ref->lock); in thread_imc_event_del()
1222 struct imc_pmu_ref *ref = NULL; in trace_imc_event_add() local
1230 ref = &core_imc_refc[core_id]; in trace_imc_event_add()
1231 if (!ref) { in trace_imc_event_add()
1234 ref = &trace_imc_refc[core_id]; in trace_imc_event_add()
1235 if (!ref) in trace_imc_event_add()
1239 mutex_lock(&ref->lock); in trace_imc_event_add()
1240 if (ref->refc == 0) { in trace_imc_event_add()
1243 mutex_unlock(&ref->lock); in trace_imc_event_add()
1249 ++ref->refc; in trace_imc_event_add()
1250 mutex_unlock(&ref->lock); in trace_imc_event_add()
1275 struct imc_pmu_ref *ref = NULL; in trace_imc_event_del() local
1278 ref = &core_imc_refc[core_id]; in trace_imc_event_del()
1279 if (!ref) { in trace_imc_event_del()
1282 ref = &trace_imc_refc[core_id]; in trace_imc_event_del()
1283 if (!ref) in trace_imc_event_del()
1287 mutex_lock(&ref->lock); in trace_imc_event_del()
1288 ref->refc--; in trace_imc_event_del()
1289 if (ref->refc == 0) { in trace_imc_event_del()
1292 mutex_unlock(&ref->lock); in trace_imc_event_del()
1296 } else if (ref->refc < 0) { in trace_imc_event_del()
1297 ref->refc = 0; in trace_imc_event_del()
1299 mutex_unlock(&ref->lock); in trace_imc_event_del()