Deleted Added
full compact
fasttrap.c (277915) fasttrap.c (287642)
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

--- 6 unchanged lines hidden (view full) ---

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 * Portions Copyright 2010 The FreeBSD Foundation
22 *
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

--- 6 unchanged lines hidden (view full) ---

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 * Portions Copyright 2010 The FreeBSD Foundation
22 *
23 * $FreeBSD: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c 277915 2015-01-30 05:03:23Z markj $
23 * $FreeBSD: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c 287642 2015-09-11 03:06:34Z markj $
24 */
25
26/*
27 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
29 */
30
31/*
24 */
25
26/*
27 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
29 */
30
31/*
32 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
32 * Copyright (c) 2015, Joyent, Inc. All rights reserved.
33 */
34
35#include <sys/atomic.h>
36#include <sys/errno.h>
37#include <sys/stat.h>
38#include <sys/modctl.h>
39#include <sys/conf.h>
40#include <sys/systm.h>

--- 1144 unchanged lines hidden (view full) ---

1185#ifdef illumos
1186 if ((p = sprlock(probe->ftp_pid)) == NULL) {
1187 if ((curproc->p_flag & SFORKING) == 0)
1188 return;
1189
1190 mutex_enter(&pidlock);
1191 p = prfind(probe->ftp_pid);
1192
33 */
34
35#include <sys/atomic.h>
36#include <sys/errno.h>
37#include <sys/stat.h>
38#include <sys/modctl.h>
39#include <sys/conf.h>
40#include <sys/systm.h>

--- 1144 unchanged lines hidden (view full) ---

1185#ifdef illumos
1186 if ((p = sprlock(probe->ftp_pid)) == NULL) {
1187 if ((curproc->p_flag & SFORKING) == 0)
1188 return;
1189
1190 mutex_enter(&pidlock);
1191 p = prfind(probe->ftp_pid);
1192
1193 if (p == NULL) {
1194 /*
1195 * So it's not that the target process is being born,
1196 * it's that it isn't there at all (and we simply
1197 * happen to be forking). Anyway, we know that the
1198 * target is definitely gone, so bail out.
1199 */
1200 mutex_exit(&pidlock);
1201 return (0);
1202 }
1203
1193 /*
1194 * Confirm that curproc is indeed forking the process in which
1195 * we're trying to enable probes.
1196 */
1204 /*
1205 * Confirm that curproc is indeed forking the process in which
1206 * we're trying to enable probes.
1207 */
1197 ASSERT(p != NULL);
1198 ASSERT(p->p_parent == curproc);
1199 ASSERT(p->p_stat == SIDL);
1200
1201 mutex_enter(&p->p_lock);
1202 mutex_exit(&pidlock);
1203
1204 sprlock_proc(p);
1205 }

--- 1528 unchanged lines hidden ---
1208 ASSERT(p->p_parent == curproc);
1209 ASSERT(p->p_stat == SIDL);
1210
1211 mutex_enter(&p->p_lock);
1212 mutex_exit(&pidlock);
1213
1214 sprlock_proc(p);
1215 }

--- 1528 unchanged lines hidden ---