Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
@@ -169,13 +169,13 @@
return;
if (dtrace_probe_lookup(profile_id, NULL, NULL, name) != 0)
return;
- atomic_add_32(&profile_total, 1);
+ atomic_inc_32(&profile_total);
if (profile_total > profile_max) {
- atomic_add_32(&profile_total, -1);
+ atomic_dec_32(&profile_total);
return;
}
prof = kmem_zalloc(sizeof (profile_probe_t), KM_SLEEP);
(void) strcpy(prof->prof_name, name);
@@ -326,11 +326,11 @@
ASSERT(prof->prof_cyclic == CYCLIC_NONE);
kmem_free(prof, sizeof (profile_probe_t));
ASSERT(profile_total >= 1);
- atomic_add_32(&profile_total, -1);
+ atomic_dec_32(&profile_total);
}
/*ARGSUSED*/
static void
profile_online(void *arg, cpu_t *cpu, cyc_handler_t *hdlr, cyc_time_t *when)