diff options
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 7192df200ae2..853cfb845878 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -707,6 +707,31 @@ dtrace_error(uint32_t *counter) } while (dtrace_cas32(counter, oval, nval) != oval); } +void +dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) +{ + cpuset_t cpus; + + if (cpu == DTRACE_CPUALL) + cpus = all_cpus; + else + CPU_SETOF(cpu, &cpus); + + smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, + smp_no_rendezvous_barrier, arg); +} + +static void +dtrace_sync_func(void) +{ +} + +void +dtrace_sync(void) +{ + dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); +} + /* * Use the DTRACE_LOADFUNC macro to define functions for each of loading a * uint8_t, a uint16_t, a uint32_t and a uint64_t. @@ -7761,7 +7786,8 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, uintptr_t *memref = (uintptr_t *)(uintptr_t) val; if (!DTRACE_INSCRATCHPTR(&mstate, - (uintptr_t)memref, 2 * sizeof(uintptr_t))) { + (uintptr_t) memref, + sizeof (uintptr_t) + sizeof (size_t))) { *flags |= CPU_DTRACE_BADADDR; continue; } @@ -7773,21 +7799,21 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, * Check if the size exceeds the allocated * buffer size. */ - if (size + sizeof(uintptr_t) > dp->dtdo_rtype.dtdt_size) { + if (size + sizeof (size_t) > + dp->dtdo_rtype.dtdt_size) { /* Flag a drop! */ *flags |= CPU_DTRACE_DROP; continue; } /* Store the size in the buffer first. */ - DTRACE_STORE(uintptr_t, tomax, - valoffs, size); + DTRACE_STORE(size_t, tomax, valoffs, size); /* * Offset the buffer address to the start * of the data. */ - valoffs += sizeof(uintptr_t); + valoffs += sizeof(size_t); /* * Reset to the memory address rather than |