dtrace.c (211608) | dtrace.c (212357) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 4 unchanged lines hidden (view full) --- 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 * | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 4 unchanged lines hidden (view full) --- 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 * |
21 * $FreeBSD: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c 211608 2010-08-22 10:53:32Z rpaulo $ | 21 * $FreeBSD: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c 212357 2010-09-09 09:58:05Z rpaulo $ |
22 */ 23 24/* 25 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 26 * Use is subject to license terms. 27 */ 28 29#pragma ident "%Z%%M% %I% %E% SMI" --- 9183 unchanged lines hidden (view full) --- 9213 9214 svar->dtsv_refcnt++; 9215 } 9216 9217 dtrace_difo_chunksize(dp, vstate); 9218 dtrace_difo_hold(dp); 9219} 9220 | 22 */ 23 24/* 25 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 26 * Use is subject to license terms. 27 */ 28 29#pragma ident "%Z%%M% %I% %E% SMI" --- 9183 unchanged lines hidden (view full) --- 9213 9214 svar->dtsv_refcnt++; 9215 } 9216 9217 dtrace_difo_chunksize(dp, vstate); 9218 dtrace_difo_hold(dp); 9219} 9220 |
9221#if defined(sun) | |
9222static dtrace_difo_t * 9223dtrace_difo_duplicate(dtrace_difo_t *dp, dtrace_vstate_t *vstate) 9224{ 9225 dtrace_difo_t *new; 9226 size_t sz; 9227 9228 ASSERT(dp->dtdo_buf != NULL); 9229 ASSERT(dp->dtdo_refcnt != 0); --- 27 unchanged lines hidden (view full) --- 9257 new->dtdo_vartab = kmem_alloc(sz, KM_SLEEP); 9258 bcopy(dp->dtdo_vartab, new->dtdo_vartab, sz); 9259 new->dtdo_varlen = dp->dtdo_varlen; 9260 } 9261 9262 dtrace_difo_init(new, vstate); 9263 return (new); 9264} | 9221static dtrace_difo_t * 9222dtrace_difo_duplicate(dtrace_difo_t *dp, dtrace_vstate_t *vstate) 9223{ 9224 dtrace_difo_t *new; 9225 size_t sz; 9226 9227 ASSERT(dp->dtdo_buf != NULL); 9228 ASSERT(dp->dtdo_refcnt != 0); --- 27 unchanged lines hidden (view full) --- 9256 new->dtdo_vartab = kmem_alloc(sz, KM_SLEEP); 9257 bcopy(dp->dtdo_vartab, new->dtdo_vartab, sz); 9258 new->dtdo_varlen = dp->dtdo_varlen; 9259 } 9260 9261 dtrace_difo_init(new, vstate); 9262 return (new); 9263} |
9265#endif | |
9266 9267static void 9268dtrace_difo_destroy(dtrace_difo_t *dp, dtrace_vstate_t *vstate) 9269{ 9270 int i; 9271 9272 ASSERT(dp->dtdo_refcnt == 0); 9273 --- 5336 unchanged lines hidden (view full) --- 14610 14611 p->p_dtrace_helpers = help; 14612 dtrace_helpers++; 14613 14614 return (help); 14615} 14616 14617#if defined(sun) | 9264 9265static void 9266dtrace_difo_destroy(dtrace_difo_t *dp, dtrace_vstate_t *vstate) 9267{ 9268 int i; 9269 9270 ASSERT(dp->dtdo_refcnt == 0); 9271 --- 5336 unchanged lines hidden (view full) --- 14608 14609 p->p_dtrace_helpers = help; 14610 dtrace_helpers++; 14611 14612 return (help); 14613} 14614 14615#if defined(sun) |
14618static void 14619dtrace_helpers_destroy(void) | 14616static 14617#endif 14618void 14619dtrace_helpers_destroy(proc_t *p) |
14620{ 14621 dtrace_helpers_t *help; 14622 dtrace_vstate_t *vstate; | 14620{ 14621 dtrace_helpers_t *help; 14622 dtrace_vstate_t *vstate; |
14623#if defined(sun) |
|
14623 proc_t *p = curproc; | 14624 proc_t *p = curproc; |
14625#endif |
|
14624 int i; 14625 14626 mutex_enter(&dtrace_lock); 14627 14628 ASSERT(p->p_dtrace_helpers != NULL); 14629 ASSERT(dtrace_helpers > 0); 14630 14631 help = p->p_dtrace_helpers; --- 70 unchanged lines hidden (view full) --- 14702 kmem_free(help->dthps_actions, 14703 sizeof (dtrace_helper_action_t *) * DTRACE_NHELPER_ACTIONS); 14704 kmem_free(help, sizeof (dtrace_helpers_t)); 14705 14706 --dtrace_helpers; 14707 mutex_exit(&dtrace_lock); 14708} 14709 | 14626 int i; 14627 14628 mutex_enter(&dtrace_lock); 14629 14630 ASSERT(p->p_dtrace_helpers != NULL); 14631 ASSERT(dtrace_helpers > 0); 14632 14633 help = p->p_dtrace_helpers; --- 70 unchanged lines hidden (view full) --- 14704 kmem_free(help->dthps_actions, 14705 sizeof (dtrace_helper_action_t *) * DTRACE_NHELPER_ACTIONS); 14706 kmem_free(help, sizeof (dtrace_helpers_t)); 14707 14708 --dtrace_helpers; 14709 mutex_exit(&dtrace_lock); 14710} 14711 |
14710static void | 14712#if defined(sun) 14713static 14714#endif 14715void |
14711dtrace_helpers_duplicate(proc_t *from, proc_t *to) 14712{ 14713 dtrace_helpers_t *help, *newhelp; 14714 dtrace_helper_action_t *helper, *new, *last; 14715 dtrace_difo_t *dp; 14716 dtrace_vstate_t *vstate; 14717 int i, j, sz, hasprovs = 0; 14718 --- 64 unchanged lines hidden (view full) --- 14783 hasprovs = 1; 14784 } 14785 14786 mutex_exit(&dtrace_lock); 14787 14788 if (hasprovs) 14789 dtrace_helper_provider_register(to, newhelp, NULL); 14790} | 14716dtrace_helpers_duplicate(proc_t *from, proc_t *to) 14717{ 14718 dtrace_helpers_t *help, *newhelp; 14719 dtrace_helper_action_t *helper, *new, *last; 14720 dtrace_difo_t *dp; 14721 dtrace_vstate_t *vstate; 14722 int i, j, sz, hasprovs = 0; 14723 --- 64 unchanged lines hidden (view full) --- 14788 hasprovs = 1; 14789 } 14790 14791 mutex_exit(&dtrace_lock); 14792 14793 if (hasprovs) 14794 dtrace_helper_provider_register(to, newhelp, NULL); 14795} |
14791#endif | |
14792 14793#if defined(sun) 14794/* 14795 * DTrace Hook Functions 14796 */ 14797static void 14798dtrace_module_loaded(modctl_t *ctl) 14799{ --- 1715 unchanged lines hidden --- | 14796 14797#if defined(sun) 14798/* 14799 * DTrace Hook Functions 14800 */ 14801static void 14802dtrace_module_loaded(modctl_t *ctl) 14803{ --- 1715 unchanged lines hidden --- |