diff options
| author | ahl <none@none> | 2006-06-12 13:43:23 -0700 |
|---|---|---|
| committer | ahl <none@none> | 2006-06-12 13:43:23 -0700 |
| commit | f498645a3eecf2ddd304b4ea9c7f1b4c155ff79e (patch) | |
| tree | cacfcba3f04509ac6ebbc15b8551d58cea36038f /usr/src | |
| parent | 9b8eb7324fc8b442bfd9c10f3c1f633eabe726f9 (diff) | |
| download | illumos-joyent-f498645a3eecf2ddd304b4ea9c7f1b4c155ff79e.tar.gz | |
6430221 few memory leaks from dtrace
6436303 the old fasttrap static probe needs to go
6436364 race between creating and enabling USDT probes
--HG--
rename : usr/src/lib/libdtrace/i386/dt_asmsubr.s => deleted_files/usr/src/lib/libdtrace/i386/dt_asmsubr.s
rename : usr/src/lib/libdtrace/sparc/dt_asmsubr.s => deleted_files/usr/src/lib/libdtrace/sparc/dt_asmsubr.s
Diffstat (limited to 'usr/src')
24 files changed, 176 insertions, 417 deletions
diff --git a/usr/src/cmd/mdb/sun4u/modules/unix/unix.c b/usr/src/cmd/mdb/sun4u/modules/unix/unix.c index ada87a6ef5..e4803b8d26 100644 --- a/usr/src/cmd/mdb/sun4u/modules/unix/unix.c +++ b/usr/src/cmd/mdb/sun4u/modules/unix/unix.c @@ -310,7 +310,7 @@ static const char *const ttdescr[] = { BAD, BAD, BAD4, /* 12A - 12F unused */ BAD4, BAD4, /* 130 - 137 unused */ "dtrace-pid", /* 138 DTrace pid provider */ - "dtrace-fasttrap", /* 139 DTrace pid provider */ + BAD, /* 139 unused */ "dtrace-return", /* 13A DTrace pid provider */ BAD, BAD4, /* 13B - 13F unused */ "syscall-64", /* 140 LP64 system call */ diff --git a/usr/src/cmd/trapstat/sun4/trapstat.c b/usr/src/cmd/trapstat/sun4/trapstat.c index 335ea13cdb..ec78a7f380 100644 --- a/usr/src/cmd/trapstat/sun4/trapstat.c +++ b/usr/src/cmd/trapstat/sun4/trapstat.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,9 @@ * * CDDL HEADER END */ + /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -554,7 +554,7 @@ static tstat_ent_t g_traps[] = { { NULL, NULL, TSTAT_ENT_UNUSED }, { NULL, NULL, TSTAT_ENT_UNUSED }, { "dtrace-pid", "DTrace pid provider" }, - { "dtrace-fasttrap", "DTrace fasttrap provider" }, + { NULL, NULL, TSTAT_ENT_UNUSED }, { "dtrace-return", "DTrace pid provider return" }, { NULL, NULL, TSTAT_ENT_UNUSED }, { NULL, NULL, TSTAT_ENT_UNUSED }, diff --git a/usr/src/lib/libdtrace/amd64/Makefile b/usr/src/lib/libdtrace/amd64/Makefile index 1cf21e7bc2..3805f674b5 100644 --- a/usr/src/lib/libdtrace/amd64/Makefile +++ b/usr/src/lib/libdtrace/amd64/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -29,12 +28,12 @@ ASFLAGS += $(AS_PICFLAGS) -P -D_ASM MAPDIR = ../spec/amd64 -MACHOBJS = dis_tables.o dt_asmsubr.o +MACHOBJS = dis_tables.o include ../Makefile.com include ../../Makefile.lib.64 -SRCS += $(SRC)/common/dis/i386/dis_tables.c ../$(MACH)/dt_asmsubr.s +SRCS += $(SRC)/common/dis/i386/dis_tables.c CPPFLAGS += -I$(SRC)/common/dis/i386 CPPFLAGS += -D_ELF64 diff --git a/usr/src/lib/libdtrace/i386/Makefile b/usr/src/lib/libdtrace/i386/Makefile index 6da800ae56..7f0a5f1bcf 100644 --- a/usr/src/lib/libdtrace/i386/Makefile +++ b/usr/src/lib/libdtrace/i386/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -28,12 +27,12 @@ ASFLAGS += $(AS_PICFLAGS) -P -D_ASM MAPDIR = ../spec/i386 -MACHOBJS = dis_tables.o dt_asmsubr.o +MACHOBJS = dis_tables.o DLIBSRCS = regs.d include ../Makefile.com -SRCS += $(SRC)/common/dis/i386/dis_tables.c dt_asmsubr.s +SRCS += $(SRC)/common/dis/i386/dis_tables.c CPPFLAGS += -I$(SRC)/common/dis/i386 LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN diff --git a/usr/src/lib/libdtrace/i386/dt_asmsubr.s b/usr/src/lib/libdtrace/i386/dt_asmsubr.s deleted file mode 100644 index 4b26b36e27..0000000000 --- a/usr/src/lib/libdtrace/i386/dt_asmsubr.s +++ /dev/null @@ -1,49 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/asm_linkage.h> -#include <sys/trap.h> - -#ifdef lint - -#include <dtrace.h> - -/*ARGSUSED*/ -int -dtrace_probe(uintptr_t arg0, ...) -{ return (0); } - -#else - - ENTRY(dtrace_probe) - int $T_DTRACE_PROBE - xorl %eax, %eax - ret - SET_SIZE(dtrace_probe) - -#endif diff --git a/usr/src/lib/libdtrace/sparc/Makefile b/usr/src/lib/libdtrace/sparc/Makefile index 35dfb3dce2..7b0e768522 100644 --- a/usr/src/lib/libdtrace/sparc/Makefile +++ b/usr/src/lib/libdtrace/sparc/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -30,8 +29,5 @@ ASFLAGS += -D_ASM -K PIC -P MAPDIR = ../spec/sparc include ../Makefile.com -SRCS += dt_asmsubr.s -OBJECTS += dt_asmsubr.o - install yydebug: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT) \ $(ROOTDLIBS) $(ROOTDOBJS) diff --git a/usr/src/lib/libdtrace/sparc/dt_asmsubr.s b/usr/src/lib/libdtrace/sparc/dt_asmsubr.s deleted file mode 100644 index 6ffba4c5da..0000000000 --- a/usr/src/lib/libdtrace/sparc/dt_asmsubr.s +++ /dev/null @@ -1,48 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/asm_linkage.h> - -#ifdef lint - -#include <dtrace.h> - -/*ARGSUSED*/ -int -dtrace_probe(uintptr_t arg0, ...) -{ return (0); } - -#else - - ENTRY(dtrace_probe) - ta ST_DTRACE_PROBE - retl - clr %o0 - SET_SIZE(dtrace_probe) - -#endif diff --git a/usr/src/lib/libdtrace/sparcv9/Makefile b/usr/src/lib/libdtrace/sparcv9/Makefile index 617f48f8aa..1db72d9e67 100644 --- a/usr/src/lib/libdtrace/sparcv9/Makefile +++ b/usr/src/lib/libdtrace/sparcv9/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -33,8 +32,5 @@ include ../../Makefile.lib.64 CPPFLAGS += -D_ELF64 -SRCS += ../sparc/dt_asmsubr.s -OBJECTS += dt_asmsubr.o - install yydebug: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64) \ $(ROOTDLIBS) $(ROOTDOBJS64) diff --git a/usr/src/lib/libdtrace/spec/dtrace.spec b/usr/src/lib/libdtrace/spec/dtrace.spec index f3a965eb68..86fe4ec44c 100644 --- a/usr/src/lib/libdtrace/spec/dtrace.spec +++ b/usr/src/lib/libdtrace/spec/dtrace.spec @@ -215,10 +215,6 @@ function dtrace_printf_format version SUNWprivate_1.1 end -function dtrace_probe -version SUNWprivate_1.1 -end - function dtrace_probe_info version SUNWprivate_1.1 end diff --git a/usr/src/uts/common/dtrace/dtrace.c b/usr/src/uts/common/dtrace/dtrace.c index 7f0ae6b2ff..fb834d3c8c 100644 --- a/usr/src/uts/common/dtrace/dtrace.c +++ b/usr/src/uts/common/dtrace/dtrace.c @@ -428,6 +428,7 @@ static intptr_t dtrace_buffer_reserve(dtrace_buffer_t *, size_t, size_t, static int dtrace_state_option(dtrace_state_t *, dtrace_optid_t, dtrace_optval_t); static int dtrace_ecb_create_enable(dtrace_probe_t *, void *); +static void dtrace_helper_provider_destroy(dtrace_helper_provider_t *); /* * DTrace Probe Context Functions @@ -12334,7 +12335,10 @@ dtrace_helper_destroygen(int gen) dtrace_helper_provider_t *prov; /* - * Look for a helper provider with the right generation. + * Look for a helper provider with the right generation. We + * have to start back at the beginning of the list each time + * because we drop dtrace_lock. It's unlikely that we'll make + * more than two passes. */ for (i = 0; i < help->dthps_nprovs; i++) { prov = help->dthps_provs[i]; @@ -12369,6 +12373,8 @@ dtrace_helper_destroygen(int gen) } mutex_exit(&dtrace_meta_lock); + dtrace_helper_provider_destroy(prov); + mutex_enter(&dtrace_lock); } diff --git a/usr/src/uts/common/dtrace/fasttrap.c b/usr/src/uts/common/dtrace/fasttrap.c index 2e3b6c1f06..5536bf3b24 100644 --- a/usr/src/uts/common/dtrace/fasttrap.c +++ b/usr/src/uts/common/dtrace/fasttrap.c @@ -106,10 +106,37 @@ * function are visible. Return probes must be fired _after_ we have * single-stepped the instruction whereas all other probes are fired * beforehand. + * + * + * Lock Ordering + * ------------- + * + * The lock ordering below -- both internally and with respect to the DTrace + * framework -- is a little tricky and bears some explanation. Each provider + * has a lock (ftp_mtx) that protects its members including reference counts + * for enabled probes (ftp_rcount), consumers actively creating probes + * (ftp_ccount) and USDT consumers (ftp_mcount); all three prevent a provider + * from being freed. A provider is looked up by taking the bucket lock for the + * provider hash table, and is returned with its lock held. The provider lock + * may be taken in functions invoked by the DTrace framework, but may not be + * held while calling functions in the DTrace framework. + * + * To ensure consistency over multiple calls to the DTrace framework, the + * creation lock (ftp_cmtx) should be held. Naturally, the creation lock may + * not be taken when holding the provider lock as that would create a cyclic + * lock ordering. In situations where one would naturally take the provider + * lock and then the creation lock, we instead up a reference count to prevent + * the provider from disappearing, drop the provider lock, and acquire the + * creation lock. + * + * Briefly: + * bucket lock before provider lock + * DTrace before provider lock + * creation lock before DTrace + * never hold the provider lock and creation lock simultaneously */ static dev_info_t *fasttrap_devi; -static dtrace_provider_id_t fasttrap_id; static dtrace_meta_provider_id_t fasttrap_meta_id; static timeout_id_t fasttrap_timeout; @@ -143,9 +170,7 @@ fasttrap_hash_t fasttrap_tpoints; static fasttrap_hash_t fasttrap_provs; static fasttrap_hash_t fasttrap_procs; -dtrace_id_t fasttrap_probe_id; -static int fasttrap_count; /* ref count */ -static int fasttrap_pid_count; /* pid ref count */ +static uint64_t fasttrap_pid_count; /* pid ref count */ static kmutex_t fasttrap_count_mtx; /* lock on ref count */ #define FASTTRAP_ENABLE_FAIL 1 @@ -293,10 +318,10 @@ fasttrap_pid_cleanup_cb(void *data) mutex_enter(&fp->ftp_mtx); /* - * If this provider is referenced either - * because it is a USDT provider or is being - * modified, we can't unregister or even - * condense. + * If this provider has consumers actively + * creating probes (ftp_ccount) or is a USDT + * provider (ftp_mcount), we can't unregister + * or even condense. */ if (fp->ftp_ccount != 0 || fp->ftp_mcount != 0) { @@ -464,15 +489,6 @@ fasttrap_pid_provide(void *arg, const dtrace_probedesc_t *desc) */ } -/*ARGSUSED*/ -static void -fasttrap_provide(void *arg, const dtrace_probedesc_t *desc) -{ - if (dtrace_probe_lookup(fasttrap_id, NULL, "fasttrap", "fasttrap") == 0) - fasttrap_probe_id = dtrace_probe_create(fasttrap_id, NULL, - "fasttrap", "fasttrap", FASTTRAP_AFRAMES, NULL); -} - static int fasttrap_tracepoint_enable(proc_t *p, fasttrap_probe_t *probe, uint_t index) { @@ -805,11 +821,8 @@ fasttrap_tracepoint_disable(proc_t *p, fasttrap_probe_t *probe, uint_t index) probe->ftp_gen = fasttrap_mod_gen; } -typedef int fasttrap_probe_f(struct regs *); - static void -fasttrap_enable_common(int *count, fasttrap_probe_f **fptr, fasttrap_probe_f *f, - fasttrap_probe_f **fptr2, fasttrap_probe_f *f2) +fasttrap_enable_callbacks(void) { /* * We don't have to play the rw lock game here because we're @@ -818,28 +831,27 @@ fasttrap_enable_common(int *count, fasttrap_probe_f **fptr, fasttrap_probe_f *f, * function pointer yet. */ mutex_enter(&fasttrap_count_mtx); - if (*count == 0) { - ASSERT(*fptr == NULL); - *fptr = f; - if (fptr2 != NULL) - *fptr2 = f2; + if (fasttrap_pid_count == 0) { + ASSERT(dtrace_pid_probe_ptr == NULL); + ASSERT(dtrace_return_probe_ptr == NULL); + dtrace_pid_probe_ptr = &fasttrap_pid_probe; + dtrace_return_probe_ptr = &fasttrap_return_probe; } - ASSERT(*fptr == f); - ASSERT(fptr2 == NULL || *fptr2 == f2); - (*count)++; + ASSERT(dtrace_pid_probe_ptr == &fasttrap_pid_probe); + ASSERT(dtrace_return_probe_ptr == &fasttrap_return_probe); + fasttrap_pid_count++; mutex_exit(&fasttrap_count_mtx); } static void -fasttrap_disable_common(int *count, fasttrap_probe_f **fptr, - fasttrap_probe_f **fptr2) +fasttrap_disable_callbacks(void) { ASSERT(MUTEX_HELD(&cpu_lock)); mutex_enter(&fasttrap_count_mtx); - (*count)--; - ASSERT(*count >= 0); - if (*count == 0) { + ASSERT(fasttrap_pid_count > 0); + fasttrap_pid_count--; + if (fasttrap_pid_count == 0) { cpu_t *cur, *cpu = CPU; for (cur = cpu->cpu_next_onln; cur != cpu; @@ -847,9 +859,8 @@ fasttrap_disable_common(int *count, fasttrap_probe_f **fptr, rw_enter(&cur->cpu_ft_lock, RW_WRITER); } - *fptr = NULL; - if (fptr2 != NULL) - *fptr2 = NULL; + dtrace_pid_probe_ptr = NULL; + dtrace_return_probe_ptr = NULL; for (cur = cpu->cpu_next_onln; cur != cpu; cur = cur->cpu_next_onln) { @@ -861,23 +872,6 @@ fasttrap_disable_common(int *count, fasttrap_probe_f **fptr, /*ARGSUSED*/ static void -fasttrap_enable(void *arg, dtrace_id_t id, void *parg) -{ - /* - * Enable the probe that corresponds to statically placed trace - * points which have not explicitly been placed in the process's text - * by the fasttrap provider. - */ - ASSERT(arg == NULL); - ASSERT(id == fasttrap_probe_id); - - fasttrap_enable_common(&fasttrap_count, - &dtrace_fasttrap_probe_ptr, fasttrap_probe, NULL, NULL); -} - - -/*ARGSUSED*/ -static void fasttrap_pid_enable(void *arg, dtrace_id_t id, void *parg) { fasttrap_probe_t *probe = parg; @@ -937,13 +931,11 @@ fasttrap_pid_enable(void *arg, dtrace_id_t id, void *parg) mutex_exit(&p->p_lock); /* - * We have to enable the trap entry before any user threads have + * We have to enable the trap entry point before any user threads have * the chance to execute the trap instruction we're about to place * in their process's text. */ - fasttrap_enable_common(&fasttrap_pid_count, - &dtrace_pid_probe_ptr, fasttrap_pid_probe, - &dtrace_return_probe_ptr, fasttrap_return_probe); + fasttrap_enable_callbacks(); /* * Enable all the tracepoints and add this probe's id to each @@ -977,8 +969,7 @@ fasttrap_pid_enable(void *arg, dtrace_id_t id, void *parg) * Since we're not actually enabling this probe, * drop our reference on the trap table entry. */ - fasttrap_disable_common(&fasttrap_pid_count, - &dtrace_pid_probe_ptr, &dtrace_return_probe_ptr); + fasttrap_disable_callbacks(); return; } } @@ -989,22 +980,6 @@ fasttrap_pid_enable(void *arg, dtrace_id_t id, void *parg) probe->ftp_enabled = 1; } - -/*ARGSUSED*/ -static void -fasttrap_disable(void *arg, dtrace_id_t id, void *parg) -{ - /* - * Disable the probe the corresponds to statically placed trace - * points. - */ - ASSERT(arg == NULL); - ASSERT(id == fasttrap_probe_id); - ASSERT(MUTEX_HELD(&cpu_lock)); - fasttrap_disable_common(&fasttrap_count, &dtrace_fasttrap_probe_ptr, - NULL); -} - /*ARGSUSED*/ static void fasttrap_pid_disable(void *arg, dtrace_id_t id, void *parg) @@ -1075,8 +1050,7 @@ fasttrap_pid_disable(void *arg, dtrace_id_t id, void *parg) probe->ftp_enabled = 0; ASSERT(MUTEX_HELD(&cpu_lock)); - fasttrap_disable_common(&fasttrap_pid_count, &dtrace_pid_probe_ptr, - &dtrace_return_probe_ptr); + fasttrap_disable_callbacks(); } /*ARGSUSED*/ @@ -1125,14 +1099,6 @@ fasttrap_pid_getargdesc(void *arg, dtrace_id_t id, void *parg, /*ARGSUSED*/ static void -fasttrap_destroy(void *arg, dtrace_id_t id, void *parg) -{ - ASSERT(arg == NULL); - ASSERT(id == fasttrap_probe_id); -} - -/*ARGSUSED*/ -static void fasttrap_pid_destroy(void *arg, dtrace_id_t id, void *parg) { fasttrap_probe_t *probe = parg; @@ -1158,27 +1124,6 @@ fasttrap_pid_destroy(void *arg, dtrace_id_t id, void *parg) } -static const dtrace_pattr_t fasttrap_attr = { -{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_ISA }, -{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, -{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, -{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_ISA }, -{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_ISA }, -}; - -static dtrace_pops_t fasttrap_pops = { - fasttrap_provide, - NULL, - fasttrap_enable, - fasttrap_disable, - NULL, - NULL, - NULL, - fasttrap_getarg, - NULL, - fasttrap_destroy -}; - static const dtrace_pattr_t pid_attr = { { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_ISA }, { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, @@ -1195,7 +1140,7 @@ static dtrace_pops_t pid_pops = { NULL, NULL, fasttrap_pid_getargdesc, - fasttrap_getarg, + fasttrap_pid_getarg, NULL, fasttrap_pid_destroy }; @@ -1572,49 +1517,23 @@ fasttrap_add_probe(fasttrap_probe_spec_t *pdata) /* * Increment this reference count to indicate that a consumer is - * actively adding a new probe associated with this provider. + * actively adding a new probe associated with this provider. This + * prevents the provider from being deleted -- we'll need to check + * for pending deletions when we drop this reference count. */ provider->ftp_ccount++; mutex_exit(&provider->ftp_mtx); - if (name != NULL) { - if (dtrace_probe_lookup(provider->ftp_provid, - pdata->ftps_mod, pdata->ftps_func, name) != 0) - goto done; - - atomic_add_32(&fasttrap_total, pdata->ftps_noffs); - - if (fasttrap_total > fasttrap_max) { - atomic_add_32(&fasttrap_total, -pdata->ftps_noffs); - goto no_mem; - } - - ASSERT(pdata->ftps_noffs > 0); - pp = kmem_zalloc(offsetof(fasttrap_probe_t, - ftp_tps[pdata->ftps_noffs]), KM_SLEEP); - - pp->ftp_prov = provider; - pp->ftp_faddr = pdata->ftps_pc; - pp->ftp_fsize = pdata->ftps_size; - pp->ftp_pid = pdata->ftps_pid; - pp->ftp_ntps = pdata->ftps_noffs; - - for (i = 0; i < pdata->ftps_noffs; i++) { - tp = kmem_zalloc(sizeof (fasttrap_tracepoint_t), - KM_SLEEP); - - tp->ftt_proc = provider->ftp_proc; - tp->ftt_pc = pdata->ftps_offs[i] + pdata->ftps_pc; - tp->ftt_pid = pdata->ftps_pid; - - pp->ftp_tps[i].fit_tp = tp; - pp->ftp_tps[i].fit_id.fti_probe = pp; - pp->ftp_tps[i].fit_id.fti_ptype = pdata->ftps_type; - } + /* + * Grab the creation lock to ensure consistency between calls to + * dtrace_probe_lookup() and dtrace_probe_create() in the face of + * other threads creating probes. We must drop the provider lock + * before taking this lock to avoid a three-way deadlock with the + * DTrace framework. + */ + mutex_enter(&provider->ftp_cmtx); - pp->ftp_id = dtrace_probe_create(provider->ftp_provid, - pdata->ftps_mod, pdata->ftps_func, name, aframes, pp); - } else { + if (name == NULL) { for (i = 0; i < pdata->ftps_noffs; i++) { char name_str[17]; @@ -1655,14 +1574,50 @@ fasttrap_add_probe(fasttrap_probe_spec_t *pdata) pdata->ftps_mod, pdata->ftps_func, name_str, FASTTRAP_OFFSET_AFRAMES, pp); } + + } else if (dtrace_probe_lookup(provider->ftp_provid, pdata->ftps_mod, + pdata->ftps_func, name) == 0) { + atomic_add_32(&fasttrap_total, pdata->ftps_noffs); + + if (fasttrap_total > fasttrap_max) { + atomic_add_32(&fasttrap_total, -pdata->ftps_noffs); + goto no_mem; + } + + ASSERT(pdata->ftps_noffs > 0); + pp = kmem_zalloc(offsetof(fasttrap_probe_t, + ftp_tps[pdata->ftps_noffs]), KM_SLEEP); + + pp->ftp_prov = provider; + pp->ftp_faddr = pdata->ftps_pc; + pp->ftp_fsize = pdata->ftps_size; + pp->ftp_pid = pdata->ftps_pid; + pp->ftp_ntps = pdata->ftps_noffs; + + for (i = 0; i < pdata->ftps_noffs; i++) { + tp = kmem_zalloc(sizeof (fasttrap_tracepoint_t), + KM_SLEEP); + + tp->ftt_proc = provider->ftp_proc; + tp->ftt_pc = pdata->ftps_offs[i] + pdata->ftps_pc; + tp->ftt_pid = pdata->ftps_pid; + + pp->ftp_tps[i].fit_tp = tp; + pp->ftp_tps[i].fit_id.fti_probe = pp; + pp->ftp_tps[i].fit_id.fti_ptype = pdata->ftps_type; + } + + pp->ftp_id = dtrace_probe_create(provider->ftp_provid, + pdata->ftps_mod, pdata->ftps_func, name, aframes, pp); } -done: + mutex_exit(&provider->ftp_cmtx); + /* * We know that the provider is still valid since we incremented the - * reference count. If someone tried to free this provider while we - * were using it (e.g. because the process called exec(2) or exit(2)), - * take note of that and try to free it now. + * creation reference count. If someone tried to clean up this provider + * while we were using it (e.g. because the process called exec(2) or + * exit(2)), take note of that and try to clean it up now. */ mutex_enter(&provider->ftp_mtx); provider->ftp_ccount--; @@ -1681,6 +1636,7 @@ no_mem: * the user has accidentally created many more probes than was * intended (e.g. pid123:::). */ + mutex_exit(&provider->ftp_cmtx); mutex_enter(&provider->ftp_mtx); provider->ftp_ccount--; provider->ftp_marked = 1; @@ -1763,11 +1719,22 @@ fasttrap_meta_create_probe(void *arg, void *parg, int i, j; uint32_t ntps; - mutex_enter(&provider->ftp_mtx); + /* + * Since the meta provider count is non-zero we don't have to worry + * about this provider disappearing. + */ + ASSERT(provider->ftp_mcount > 0); + + /* + * Grab the creation lock to ensure consistency between calls to + * dtrace_probe_lookup() and dtrace_probe_create() in the face of + * other threads creating probes. + */ + mutex_enter(&provider->ftp_cmtx); if (dtrace_probe_lookup(provider->ftp_provid, dhpb->dthpb_mod, dhpb->dthpb_func, dhpb->dthpb_name) != 0) { - mutex_exit(&provider->ftp_mtx); + mutex_exit(&provider->ftp_cmtx); return; } @@ -1778,7 +1745,7 @@ fasttrap_meta_create_probe(void *arg, void *parg, if (fasttrap_total > fasttrap_max) { atomic_add_32(&fasttrap_total, -ntps); - mutex_exit(&provider->ftp_mtx); + mutex_exit(&provider->ftp_cmtx); return; } @@ -1843,7 +1810,7 @@ fasttrap_meta_create_probe(void *arg, void *parg, pp->ftp_id = dtrace_probe_create(provider->ftp_provid, dhpb->dthpb_mod, dhpb->dthpb_func, dhpb->dthpb_name, FASTTRAP_OFFSET_AFRAMES, pp); - mutex_exit(&provider->ftp_mtx); + mutex_exit(&provider->ftp_cmtx); } /*ARGSUSED*/ @@ -2078,9 +2045,7 @@ fasttrap_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) } if (ddi_create_minor_node(devi, "fasttrap", S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE || - dtrace_register("fasttrap", &fasttrap_attr, DTRACE_PRIV_USER, NULL, - &fasttrap_pops, NULL, &fasttrap_id) != 0) { + DDI_PSEUDO, NULL) == DDI_FAILURE) { ddi_remove_minor_node(devi, NULL); return (DDI_FAILURE); } @@ -2229,7 +2194,7 @@ fasttrap_detach(dev_info_t *devi, ddi_detach_cmd_t cmd) mutex_exit(&bucket->ftb_mtx); } - if (fail || dtrace_unregister(fasttrap_id) != 0) { + if (fail) { uint_t work; /* * If we're failing to detach, we need to unblock timeouts @@ -2252,7 +2217,7 @@ fasttrap_detach(dev_info_t *devi, ddi_detach_cmd_t cmd) #ifdef DEBUG mutex_enter(&fasttrap_count_mtx); - ASSERT(fasttrap_count == 0); + ASSERT(fasttrap_pid_count == 0); mutex_exit(&fasttrap_count_mtx); #endif diff --git a/usr/src/uts/common/sys/dtrace.h b/usr/src/uts/common/sys/dtrace.h index 48d876a651..059609df41 100644 --- a/usr/src/uts/common/sys/dtrace.h +++ b/usr/src/uts/common/sys/dtrace.h @@ -2142,7 +2142,6 @@ extern void dtrace_vtime_disable(void); struct regs; extern int (*dtrace_pid_probe_ptr)(struct regs *); -extern int (*dtrace_fasttrap_probe_ptr)(struct regs *); extern int (*dtrace_return_probe_ptr)(struct regs *); extern void (*dtrace_fasttrap_fork_ptr)(proc_t *, proc_t *); extern void (*dtrace_fasttrap_exec_ptr)(proc_t *); diff --git a/usr/src/uts/common/sys/fasttrap_impl.h b/usr/src/uts/common/sys/fasttrap_impl.h index 4bd9e8f091..280951e741 100644 --- a/usr/src/uts/common/sys/fasttrap_impl.h +++ b/usr/src/uts/common/sys/fasttrap_impl.h @@ -83,6 +83,7 @@ typedef struct fasttrap_provider { uint_t ftp_marked; /* mark for possible removal */ uint_t ftp_retired; /* mark when retired */ kmutex_t ftp_mtx; /* provider lock */ + kmutex_t ftp_cmtx; /* lock on creating probes */ uint64_t ftp_rcount; /* enabled probes ref count */ uint64_t ftp_ccount; /* consumers creating probes */ uint64_t ftp_mcount; /* meta provider count */ @@ -176,11 +177,10 @@ extern int fasttrap_tracepoint_init(proc_t *, fasttrap_tracepoint_t *, extern int fasttrap_tracepoint_install(proc_t *, fasttrap_tracepoint_t *); extern int fasttrap_tracepoint_remove(proc_t *, fasttrap_tracepoint_t *); -extern int fasttrap_probe(struct regs *); extern int fasttrap_pid_probe(struct regs *); extern int fasttrap_return_probe(struct regs *); -extern uint64_t fasttrap_getarg(void *, dtrace_id_t, void *, int, int); +extern uint64_t fasttrap_pid_getarg(void *, dtrace_id_t, void *, int, int); extern uint64_t fasttrap_usdt_getarg(void *, dtrace_id_t, void *, int, int); #ifdef __cplusplus diff --git a/usr/src/uts/i86pc/io/pcplusmp/apic.c b/usr/src/uts/i86pc/io/pcplusmp/apic.c index 7504af2256..2052f1b085 100644 --- a/usr/src/uts/i86pc/io/pcplusmp/apic.c +++ b/usr/src/uts/i86pc/io/pcplusmp/apic.c @@ -3978,8 +3978,7 @@ apic_allocate_vector(int ipl, int irq, int pri) for (i = lowest; i < highest; i++) { if ((i == T_FASTTRAP) || (i == APIC_SPUR_INTR) || - (i == T_SYSCALLINT) || (i == T_DTRACE_PROBE) || - (i == T_DTRACE_RET)) + (i == T_SYSCALLINT) || (i == T_DTRACE_RET)) continue; if (apic_vector_to_irq[i] == APIC_RESV_IRQ) { apic_vector_to_irq[i] = (uchar_t)irq; diff --git a/usr/src/uts/i86pc/os/dtrace_subr.c b/usr/src/uts/i86pc/os/dtrace_subr.c index 5fd9f9b811..00da457012 100644 --- a/usr/src/uts/i86pc/os/dtrace_subr.c +++ b/usr/src/uts/i86pc/os/dtrace_subr.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,9 @@ * * CDDL HEADER END */ + /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -169,7 +169,6 @@ dtrace_sync(void) dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); } -int (*dtrace_fasttrap_probe_ptr)(struct regs *); int (*dtrace_pid_probe_ptr)(struct regs *); int (*dtrace_return_probe_ptr)(struct regs *); @@ -240,13 +239,6 @@ dtrace_user_probe(struct regs *rp, caddr_t addr, processorid_t cpuid) rw_exit(rwp); rp->r_pc = npc; - } else if (rp->r_trapno == T_DTRACE_PROBE) { - rwp = &CPU->cpu_ft_lock; - rw_enter(rwp, RW_READER); - if (dtrace_fasttrap_probe_ptr != NULL) - (void) (*dtrace_fasttrap_probe_ptr)(rp); - rw_exit(rwp); - } else if (rp->r_trapno == T_BPTFLT) { uint8_t instr; rwp = &CPU->cpu_ft_lock; diff --git a/usr/src/uts/intel/dtrace/fasttrap_isa.c b/usr/src/uts/intel/dtrace/fasttrap_isa.c index 4be5fab23e..b64be9243f 100644 --- a/usr/src/uts/intel/dtrace/fasttrap_isa.c +++ b/usr/src/uts/intel/dtrace/fasttrap_isa.c @@ -589,37 +589,6 @@ fasttrap_fuword32_noerr(const void *uaddr) return (0); } -/*ARGSUSED*/ -int -fasttrap_probe(struct regs *rp) -{ -#ifdef __amd64 - proc_t *p = curproc; -#endif - -#ifdef __amd64 - if (p->p_model == DATAMODEL_LP64) { - dtrace_probe(fasttrap_probe_id, rp->r_rdi, rp->r_rsi, - rp->r_rdx, rp->r_rcx, rp->r_r8); - } else { -#endif - uint32_t *stack = (uint32_t *)rp->r_sp; - uintptr_t s0, s1, s2, s3, s4; - - s0 = fasttrap_fuword32_noerr(&stack[1]); - s1 = fasttrap_fuword32_noerr(&stack[2]); - s2 = fasttrap_fuword32_noerr(&stack[3]); - s3 = fasttrap_fuword32_noerr(&stack[4]); - s4 = fasttrap_fuword32_noerr(&stack[5]); - - dtrace_probe(fasttrap_probe_id, s0, s1, s2, s3, s4); -#ifdef __amd64 - } -#endif - - return (0); -} - static void fasttrap_return_common(struct regs *rp, uintptr_t pc, pid_t pid, uintptr_t new_pc) @@ -1511,7 +1480,8 @@ fasttrap_return_probe(struct regs *rp) /*ARGSUSED*/ uint64_t -fasttrap_getarg(void *arg, dtrace_id_t id, void *parg, int argno, int aframes) +fasttrap_pid_getarg(void *arg, dtrace_id_t id, void *parg, int argno, + int aframes) { return (fasttrap_anarg(ttolwp(curthread)->lwp_regs, 1, argno)); } diff --git a/usr/src/uts/intel/ia32/ml/exception.s b/usr/src/uts/intel/ia32/ml/exception.s index be8a251727..11d38dc542 100644 --- a/usr/src/uts/intel/ia32/ml/exception.s +++ b/usr/src/uts/intel/ia32/ml/exception.s @@ -1052,11 +1052,6 @@ check_for_user_address: #endif /* __i386 */ - ENTRY_NP(dtrace_fasttrap) - TRAP_NOERR(T_DTRACE_PROBE) - jmp dtrace_trap - SET_SIZE(dtrace_fasttrap) - ENTRY_NP(dtrace_ret) TRAP_NOERR(T_DTRACE_RET) jmp dtrace_trap diff --git a/usr/src/uts/intel/ia32/os/desctbls.c b/usr/src/uts/intel/ia32/os/desctbls.c index c4052031b3..f53563eae3 100644 --- a/usr/src/uts/intel/ia32/os/desctbls.c +++ b/usr/src/uts/intel/ia32/os/desctbls.c @@ -592,10 +592,8 @@ init_idt(void) SDT_SYSIGT, SEL_UPL); /* - * Install the DTrace interrupt handlers for the fasttrap provider. + * Install the DTrace interrupt handler for the pid provider. */ - set_gatesegd(&idt0[T_DTRACE_PROBE], &dtrace_fasttrap, KCS_SEL, 0, - SDT_SYSIGT, SEL_UPL); set_gatesegd(&idt0[T_DTRACE_RET], &dtrace_ret, KCS_SEL, 0, SDT_SYSIGT, SEL_UPL); @@ -720,10 +718,8 @@ init_idt(void) SDT_SYSIGT, SEL_UPL); /* - * Install the DTrace interrupt handlers for the fasttrap provider. + * Install the DTrace interrupt handler for the pid provider. */ - set_gatesegd(&idt0[T_DTRACE_PROBE], &dtrace_fasttrap, KCS_SEL, 0, - SDT_SYSIGT, SEL_UPL); set_gatesegd(&idt0[T_DTRACE_RET], &dtrace_ret, KCS_SEL, 0, SDT_SYSIGT, SEL_UPL); diff --git a/usr/src/uts/intel/ia32/sys/trap.h b/usr/src/uts/intel/ia32/sys/trap.h index 9eafa6b197..b03f947fe8 100644 --- a/usr/src/uts/intel/ia32/sys/trap.h +++ b/usr/src/uts/intel/ia32/sys/trap.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -65,7 +64,6 @@ extern "C" { #define T_ENOEXTFLT 0x20 /* emulated ext not present */ #define T_FASTTRAP 0xd2 /* fast system call */ #define T_SYSCALLINT 0x91 /* general system call */ -#define T_DTRACE_PROBE 0x7e /* DTrace fasttrap probe */ #define T_DTRACE_RET 0x7f /* DTrace pid return */ #define T_SOFTINT 0x50fd /* pseudo softint trap type */ diff --git a/usr/src/uts/intel/sys/segments.h b/usr/src/uts/intel/sys/segments.h index c9c2ba7e52..b17b300cd6 100644 --- a/usr/src/uts/intel/sys/segments.h +++ b/usr/src/uts/intel/sys/segments.h @@ -551,7 +551,7 @@ extern void _start(), cmnint(); extern void achktrap(), mcetrap(); extern void xmtrap(); extern void fasttrap(); -extern void dtrace_fasttrap(), dtrace_ret(); +extern void dtrace_ret(); #if !defined(__amd64) extern void pentium_pftrap(); diff --git a/usr/src/uts/sparc/dtrace/fasttrap_isa.c b/usr/src/uts/sparc/dtrace/fasttrap_isa.c index 93d627adb7..9b50b1b52a 100644 --- a/usr/src/uts/sparc/dtrace/fasttrap_isa.c +++ b/usr/src/uts/sparc/dtrace/fasttrap_isa.c @@ -225,18 +225,6 @@ fasttrap_anarg(struct regs *rp, int argno) static ulong_t fasttrap_getreg(struct regs *, uint_t); static void fasttrap_putreg(struct regs *, uint_t, ulong_t); -int -fasttrap_probe(struct regs *rp) -{ - dtrace_probe(fasttrap_probe_id, - rp->r_o0, rp->r_o1, rp->r_o2, rp->r_o3, rp->r_o4); - - rp->r_pc = rp->r_npc; - rp->r_npc = rp->r_pc + 4; - - return (0); -} - static void fasttrap_usdt_args(fasttrap_probe_t *probe, struct regs *rp, int argc, uintptr_t *argv) @@ -1335,7 +1323,8 @@ fasttrap_tracepoint_init(proc_t *p, fasttrap_tracepoint_t *tp, uintptr_t pc, /*ARGSUSED*/ uint64_t -fasttrap_getarg(void *arg, dtrace_id_t id, void *parg, int argno, int aframes) +fasttrap_pid_getarg(void *arg, dtrace_id_t id, void *parg, int argno, + int aframes) { return (fasttrap_anarg(ttolwp(curthread)->lwp_regs, argno)); } diff --git a/usr/src/uts/sun4/os/dtrace_subr.c b/usr/src/uts/sun4/os/dtrace_subr.c index b59b0d9e75..d1afbe29b0 100644 --- a/usr/src/uts/sun4/os/dtrace_subr.c +++ b/usr/src/uts/sun4/os/dtrace_subr.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,9 @@ * * CDDL HEADER END */ + /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -72,24 +72,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) (*func)((uintptr_t)hole_start, (uintptr_t)hole_end); } -int (*dtrace_fasttrap_probe_ptr)(struct regs *); - -void -dtrace_fasttrap_probe(struct regs *rp) -{ - krwlock_t *rwp = &CPU->cpu_ft_lock; - - rw_enter(rwp, RW_READER); - if (dtrace_fasttrap_probe_ptr == NULL) { - rw_exit(rwp); - rp->r_pc = rp->r_npc; - rp->r_npc = rp->r_pc + 4; - } else { - (void) (*dtrace_fasttrap_probe_ptr)(rp); - rw_exit(rwp); - } -} - int (*dtrace_pid_probe_ptr)(struct regs *); void diff --git a/usr/src/uts/sun4u/ml/trap_table.s b/usr/src/uts/sun4u/ml/trap_table.s index 981749e8ee..d25ab51179 100644 --- a/usr/src/uts/sun4u/ml/trap_table.s +++ b/usr/src/uts/sun4u/ml/trap_table.s @@ -237,17 +237,6 @@ /* * DTrace traps. */ -#define DTRACE_FASTTRAP \ - .global dtrace_fasttrap_probe ;\ - .global dtrace_fasttrap_probe_ptr ;\ - sethi %hi(dtrace_fasttrap_probe_ptr), %g4 ;\ - ldn [%g4 + %lo(dtrace_fasttrap_probe_ptr)], %g4 ;\ - set dtrace_fasttrap_probe, %g1 ;\ - brnz,pn %g4, user_trap ;\ - sub %g0, 1, %g4 ;\ - FAST_TRAP_DONE ;\ - .align 32 - #define DTRACE_PID \ .global dtrace_pid_probe ;\ set dtrace_pid_probe, %g1 ;\ @@ -1468,7 +1457,7 @@ trap_table0: BAD; BAD; BAD4; /* 12A - 12F unused */ BAD4; BAD4; /* 130 - 137 unused */ DTRACE_PID; /* 138 dtrace pid tracing provider */ - DTRACE_FASTTRAP; /* 139 dtrace fasttrap provider */ + BAD; /* 139 unused */ DTRACE_RETURN; /* 13A dtrace pid return probe */ BAD; BAD4; /* 13B - 13F unused */ SYSCALL(syscall_trap) /* 140 LP64 system call */ diff --git a/usr/src/uts/sun4v/ml/trap_table.s b/usr/src/uts/sun4v/ml/trap_table.s index 24fb20058c..54eaa49462 100644 --- a/usr/src/uts/sun4v/ml/trap_table.s +++ b/usr/src/uts/sun4v/ml/trap_table.s @@ -18,6 +18,7 @@ * * CDDL HEADER END */ + /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. @@ -231,17 +232,6 @@ /* * DTrace traps. */ -#define DTRACE_FASTTRAP \ - .global dtrace_fasttrap_probe ;\ - .global dtrace_fasttrap_probe_ptr ;\ - sethi %hi(dtrace_fasttrap_probe_ptr), %g4 ;\ - ldn [%g4 + %lo(dtrace_fasttrap_probe_ptr)], %g4 ;\ - set dtrace_fasttrap_probe, %g1 ;\ - brnz,pn %g4, user_trap ;\ - sub %g0, 1, %g4 ;\ - FAST_TRAP_DONE ;\ - .align 32 - #define DTRACE_PID \ .global dtrace_pid_probe ;\ set dtrace_pid_probe, %g1 ;\ @@ -1263,7 +1253,7 @@ trap_table0: BAD; BAD; BAD4; /* 12A - 12F unused */ BAD4; BAD4; /* 130 - 137 unused */ DTRACE_PID; /* 138 dtrace pid tracing provider */ - DTRACE_FASTTRAP; /* 139 dtrace fasttrap provider */ + BAD; /* 139 unused */ DTRACE_RETURN; /* 13A dtrace pid return probe */ BAD; BAD4; /* 13B - 13F unused */ SYSCALL(syscall_trap) /* 140 LP64 system call */ |
