Lines Matching refs:counters
50 * Only lock the counters if 64-bit atomic operations are
115 isc_stat_t *counters;
118 * We don't want to lock the counters while we are dumping, so we first
146 stats->counters = isc_mem_get(mctx, sizeof(isc_stat_t) * ncounters);
147 if (stats->counters == NULL) {
165 memset(stats->counters, 0, sizeof(isc_stat_t) * ncounters);
176 isc_mem_put(mctx, stats->counters, sizeof(isc_stat_t) * ncounters);
220 isc_mem_put(stats->mctx, stats->counters,
256 prev = atomic_fetch_add_explicit(&stats->counters[counter].lo, 1,
259 prev = isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].lo, 1);
271 atomic_fetch_add_explicit(&stats->counters[counter].hi, 1,
274 isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].hi, 1);
280 atomic_fetch_add_explicit(&stats->counters[counter], 1,
283 isc_atomic_xaddq((isc_int64_t *)&stats->counters[counter], 1);
287 stats->counters[counter]++;
305 prev = atomic_fetch_sub_explicit(&stats->counters[counter].lo, 1,
308 prev = isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].lo, -1);
312 atomic_fetch_sub_explicit(&stats->counters[counter].hi, 1,
315 isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].hi,
322 atomic_fetch_sub_explicit(&stats->counters[counter], 1,
325 isc_atomic_xaddq((isc_int64_t *)&stats->counters[counter], -1);
329 stats->counters[counter]--;
343 * We use a "write" lock before "reading" the statistics counters as
352 (isc_uint64_t)(stats->counters[i].hi) << 32 |
353 stats->counters[i].lo;
357 atomic_load_explicit(&stats->counters[i],
362 (isc_uint64_t)isc_atomic_xaddq((isc_int64_t *)&stats->counters[i], 0);
365 stats->copiedcounters[i] = stats->counters[i];
424 * We use a "write" lock before "reading" the statistics counters as
431 stats->counters[counter].hi = (isc_uint32_t)((val >> 32) & 0xffffffff);
432 stats->counters[counter].lo = (isc_uint32_t)(val & 0xffffffff);
435 atomic_store_explicit(&stats->counters[counter], val,
438 isc_atomic_storeq((isc_int64_t *)&stats->counters[counter], val);
441 stats->counters[counter] = val;