Deleted Added
full compact
kern_synch.c (172482) kern_synch.c (173600)
1/*-
2 * Copyright (c) 1982, 1986, 1990, 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_synch.c 8.9 (Berkeley) 5/19/95
35 */
36
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1990, 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_synch.c 8.9 (Berkeley) 5/19/95
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/kern/kern_synch.c 172482 2007-10-08 23:40:40Z jeff $");
38__FBSDID("$FreeBSD: head/sys/kern/kern_synch.c 173600 2007-11-14 06:21:24Z julian $");
39
40#include "opt_ktrace.h"
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/condvar.h>
45#include <sys/kdb.h>
46#include <sys/kernel.h>

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

414 td->td_generation++; /* bump preempt-detect counter */
415 PCPU_INC(cnt.v_swtch);
416 PCPU_SET(switchticks, ticks);
417 CTR4(KTR_PROC, "mi_switch: old thread %ld (kse %p, pid %ld, %s)",
418 td->td_tid, td->td_sched, p->p_pid, p->p_comm);
419#if (KTR_COMPILE & KTR_SCHED) != 0
420 if (TD_IS_IDLETHREAD(td))
421 CTR3(KTR_SCHED, "mi_switch: %p(%s) prio %d idle",
39
40#include "opt_ktrace.h"
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/condvar.h>
45#include <sys/kdb.h>
46#include <sys/kernel.h>

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

414 td->td_generation++; /* bump preempt-detect counter */
415 PCPU_INC(cnt.v_swtch);
416 PCPU_SET(switchticks, ticks);
417 CTR4(KTR_PROC, "mi_switch: old thread %ld (kse %p, pid %ld, %s)",
418 td->td_tid, td->td_sched, p->p_pid, p->p_comm);
419#if (KTR_COMPILE & KTR_SCHED) != 0
420 if (TD_IS_IDLETHREAD(td))
421 CTR3(KTR_SCHED, "mi_switch: %p(%s) prio %d idle",
422 td, td->td_proc->p_comm, td->td_priority);
422 td, td->td_name, td->td_priority);
423 else if (newtd != NULL)
424 CTR5(KTR_SCHED,
425 "mi_switch: %p(%s) prio %d preempted by %p(%s)",
423 else if (newtd != NULL)
424 CTR5(KTR_SCHED,
425 "mi_switch: %p(%s) prio %d preempted by %p(%s)",
426 td, td->td_proc->p_comm, td->td_priority, newtd,
427 newtd->td_proc->p_comm);
426 td, td->td_name, td->td_priority, newtd,
427 newtd->td_name);
428 else
429 CTR6(KTR_SCHED,
430 "mi_switch: %p(%s) prio %d inhibit %d wmesg %s lock %s",
428 else
429 CTR6(KTR_SCHED,
430 "mi_switch: %p(%s) prio %d inhibit %d wmesg %s lock %s",
431 td, td->td_proc->p_comm, td->td_priority,
431 td, td->td_name, td->td_priority,
432 td->td_inhibitors, td->td_wmesg, td->td_lockname);
433#endif
434 /*
435 * We call thread_switchout after the KTR_SCHED prints above so kse
436 * selecting a new thread to run does not show up as a preemption.
437 */
438#ifdef KSE
439 if ((flags & SW_VOL) && (td->td_proc->p_flag & P_SA))
440 newtd = thread_switchout(td, flags, newtd);
441#endif
442 sched_switch(td, newtd, flags);
443 CTR3(KTR_SCHED, "mi_switch: running %p(%s) prio %d",
432 td->td_inhibitors, td->td_wmesg, td->td_lockname);
433#endif
434 /*
435 * We call thread_switchout after the KTR_SCHED prints above so kse
436 * selecting a new thread to run does not show up as a preemption.
437 */
438#ifdef KSE
439 if ((flags & SW_VOL) && (td->td_proc->p_flag & P_SA))
440 newtd = thread_switchout(td, flags, newtd);
441#endif
442 sched_switch(td, newtd, flags);
443 CTR3(KTR_SCHED, "mi_switch: running %p(%s) prio %d",
444 td, td->td_proc->p_comm, td->td_priority);
444 td, td->td_name, td->td_priority);
445
446 CTR4(KTR_PROC, "mi_switch: new thread %ld (kse %p, pid %ld, %s)",
447 td->td_tid, td->td_sched, p->p_pid, p->p_comm);
448
449 /*
450 * If the last thread was exiting, finish cleaning it up.
451 */
452 if ((td = PCPU_GET(deadthread))) {

--- 111 unchanged lines hidden ---
445
446 CTR4(KTR_PROC, "mi_switch: new thread %ld (kse %p, pid %ld, %s)",
447 td->td_tid, td->td_sched, p->p_pid, p->p_comm);
448
449 /*
450 * If the last thread was exiting, finish cleaning it up.
451 */
452 if ((td = PCPU_GET(deadthread))) {

--- 111 unchanged lines hidden ---