diff --git a/cmd/stat/common/statcommon.h b/cmd/stat/common/statcommon.h index 9ee077431ddb..fd3e9d2d9ba7 100644 --- a/cmd/stat/common/statcommon.h +++ b/cmd/stat/common/statcommon.h @@ -20,7 +20,10 @@ */ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. - * + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* * Common routines for acquiring snapshots of kstats for * iostat, mpstat, and vmstat. */ @@ -221,6 +224,7 @@ struct snapshot { size_t s_iodevs_is_name_maxlen; struct sys_snapshot s_sys; struct biostats s_biostats; + size_t s_nr_active_cpus; }; /* print a message and exit with failure */ diff --git a/uts/common/dtrace/dtrace.c b/uts/common/dtrace/dtrace.c index 7a5e67ea7065..4bee43839fd0 100644 --- a/uts/common/dtrace/dtrace.c +++ b/uts/common/dtrace/dtrace.c @@ -5861,7 +5861,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, size_t size; int vtime, onintr; volatile uint16_t *flags; - hrtime_t now; + hrtime_t now, end; /* * Kick out immediately if this CPU is still being born (in which case @@ -5876,6 +5876,8 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, cpuid = CPU->cpu_id; onintr = CPU_ON_INTR(CPU); + CPU->cpu_dtrace_probes++; + if (!onintr && probe->dtpr_predcache != DTRACE_CACHEIDNONE && probe->dtpr_predcache == curthread->t_predcache) { /* @@ -6455,8 +6457,11 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, buf->dtb_offset = offs + ecb->dte_size; } + end = dtrace_gethrtime(); if (vtime) - curthread->t_dtrace_start = dtrace_gethrtime(); + curthread->t_dtrace_start = end; + + CPU->cpu_dtrace_nsec += end - now; dtrace_interrupt_enable(cookie); } diff --git a/uts/common/sys/cpuvar.h b/uts/common/sys/cpuvar.h index d4075d580be7..6c07bcbc8a8c 100644 --- a/uts/common/sys/cpuvar.h +++ b/uts/common/sys/cpuvar.h @@ -21,6 +21,7 @@ /* * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_CPUVAR_H @@ -187,6 +188,9 @@ typedef struct cpu { uintptr_t cpu_dtrace_caller; /* DTrace: caller, if any */ hrtime_t cpu_dtrace_chillmark; /* DTrace: chill mark time */ hrtime_t cpu_dtrace_chilled; /* DTrace: total chill time */ + uint64_t cpu_dtrace_probes; /* DTrace: total probes fired */ + hrtime_t cpu_dtrace_nsec; /* DTrace: ns in dtrace_probe */ + volatile uint16_t cpu_mstate; /* cpu microstate */ volatile uint16_t cpu_mstate_gen; /* generation counter */ volatile hrtime_t cpu_mstate_start; /* cpu microstate start time */