Deleted Added
full compact
kern_clock.c (274610) kern_clock.c (260817)
1/*-
2 * Copyright (c) 1982, 1986, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
35 */
36
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: stable/10/sys/kern/kern_clock.c 274610 2014-11-17 01:01:45Z kib $");
38__FBSDID("$FreeBSD: stable/10/sys/kern/kern_clock.c 260817 2014-01-17 10:58:59Z avg $");
39
40#include "opt_kdb.h"
41#include "opt_device_polling.h"
42#include "opt_hwpmc_hooks.h"
43#include "opt_kdtrace.h"
44#include "opt_ntp.h"
45#include "opt_watchdog.h"
46

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

664void
665stopprofclock(p)
666 register struct proc *p;
667{
668
669 PROC_LOCK_ASSERT(p, MA_OWNED);
670 if (p->p_flag & P_PROFIL) {
671 if (p->p_profthreads != 0) {
39
40#include "opt_kdb.h"
41#include "opt_device_polling.h"
42#include "opt_hwpmc_hooks.h"
43#include "opt_kdtrace.h"
44#include "opt_ntp.h"
45#include "opt_watchdog.h"
46

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

664void
665stopprofclock(p)
666 register struct proc *p;
667{
668
669 PROC_LOCK_ASSERT(p, MA_OWNED);
670 if (p->p_flag & P_PROFIL) {
671 if (p->p_profthreads != 0) {
672 while (p->p_profthreads != 0) {
673 p->p_flag |= P_STOPPROF;
672 p->p_flag |= P_STOPPROF;
673 while (p->p_profthreads != 0)
674 msleep(&p->p_profthreads, &p->p_mtx, PPAUSE,
675 "stopprof", 0);
674 msleep(&p->p_profthreads, &p->p_mtx, PPAUSE,
675 "stopprof", 0);
676 }
676 p->p_flag &= ~P_STOPPROF;
677 }
678 if ((p->p_flag & P_PROFIL) == 0)
679 return;
680 p->p_flag &= ~P_PROFIL;
681 mtx_lock(&time_lock);
682 if (--profprocs == 0)
683 cpu_stopprofclock();
684 mtx_unlock(&time_lock);

--- 211 unchanged lines hidden ---
677 }
678 if ((p->p_flag & P_PROFIL) == 0)
679 return;
680 p->p_flag &= ~P_PROFIL;
681 mtx_lock(&time_lock);
682 if (--profprocs == 0)
683 cpu_stopprofclock();
684 mtx_unlock(&time_lock);

--- 211 unchanged lines hidden ---