smp_id = lprocfs_stats_lock(stats, LPROCFS_GET_SMP_ID);
percpu_cntr = &(stats->ls_percpu[smp_id]->lp_cntr[idx]);
- cfs_atomic_inc(&percpu_cntr->lc_cntl.la_entry);
+ if (!(stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU))
+ cfs_atomic_inc(&percpu_cntr->lc_cntl.la_entry);
percpu_cntr->lc_count++;
if (percpu_cntr->lc_config & LPROCFS_CNTR_AVGMINMAX) {
if (amount > percpu_cntr->lc_max)
percpu_cntr->lc_max = amount;
}
- cfs_atomic_inc(&percpu_cntr->lc_cntl.la_exit);
- lprocfs_stats_unlock(stats);
+ if (!(stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU))
+ cfs_atomic_inc(&percpu_cntr->lc_cntl.la_exit);
+ lprocfs_stats_unlock(stats, LPROCFS_GET_SMP_ID);
}
EXPORT_SYMBOL(lprocfs_counter_add);
smp_id = lprocfs_stats_lock(stats, LPROCFS_GET_SMP_ID);
percpu_cntr = &(stats->ls_percpu[smp_id]->lp_cntr[idx]);
- cfs_atomic_inc(&percpu_cntr->lc_cntl.la_entry);
+ if (!(stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU))
+ cfs_atomic_inc(&percpu_cntr->lc_cntl.la_entry);
if (percpu_cntr->lc_config & LPROCFS_CNTR_AVGMINMAX) {
/*
* currently lprocfs_count_add() can only be called in thread
else
percpu_cntr->lc_sum -= amount;
}
- cfs_atomic_inc(&percpu_cntr->lc_cntl.la_exit);
- lprocfs_stats_unlock(stats);
+ if (!(stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU))
+ cfs_atomic_inc(&percpu_cntr->lc_cntl.la_exit);
+ lprocfs_stats_unlock(stats, LPROCFS_GET_SMP_ID);
}
EXPORT_SYMBOL(lprocfs_counter_sub);
#endif /* LPROCFS */