Deleted Added
full compact
subr_turnstile.c (182879) subr_turnstile.c (183054)
1/*-
2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

52 * already has a turnstile, then it gives its turnstile to the lock's
53 * turnstile's free list. When a thread is woken up, it takes a turnstile from
54 * the free list if there are any other waiters. If it is the only thread
55 * blocked on the lock, then it reclaims the turnstile associated with the lock
56 * and removes it from the hash table.
57 */
58
59#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

52 * already has a turnstile, then it gives its turnstile to the lock's
53 * turnstile's free list. When a thread is woken up, it takes a turnstile from
54 * the free list if there are any other waiters. If it is the only thread
55 * blocked on the lock, then it reclaims the turnstile associated with the lock
56 * and removes it from the hash table.
57 */
58
59#include <sys/cdefs.h>
60__FBSDID("$FreeBSD: head/sys/kern/subr_turnstile.c 182879 2008-09-08 21:40:15Z jhb $");
60__FBSDID("$FreeBSD: head/sys/kern/subr_turnstile.c 183054 2008-09-15 22:45:14Z sam $");
61
62#include "opt_ddb.h"
63#include "opt_turnstile_profiling.h"
64#include "opt_sched.h"
65
66#include <sys/param.h>
67#include <sys/systm.h>
68#include <sys/kernel.h>

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

1145 if (have_addr)
1146 td = db_lookup_thread(addr, TRUE);
1147 else
1148 td = kdb_thread;
1149
1150 print_lockchain(td, "");
1151}
1152
61
62#include "opt_ddb.h"
63#include "opt_turnstile_profiling.h"
64#include "opt_sched.h"
65
66#include <sys/param.h>
67#include <sys/systm.h>
68#include <sys/kernel.h>

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

1145 if (have_addr)
1146 td = db_lookup_thread(addr, TRUE);
1147 else
1148 td = kdb_thread;
1149
1150 print_lockchain(td, "");
1151}
1152
1153DB_SHOW_COMMAND(allchains, db_show_allchains)
1153DB_SHOW_ALL_COMMAND(chains, db_show_allchains)
1154{
1155 struct thread *td;
1156 struct proc *p;
1157 int i;
1158
1159 i = 1;
1160 FOREACH_PROC_IN_SYSTEM(p) {
1161 FOREACH_THREAD_IN_PROC(p, td) {
1162 if (TD_ON_LOCK(td) && LIST_EMPTY(&td->td_contested)) {
1163 db_printf("chain %d:\n", i++);
1164 print_lockchain(td, " ");
1165 }
1166 if (db_pager_quit)
1167 return;
1168 }
1169 }
1170}
1154{
1155 struct thread *td;
1156 struct proc *p;
1157 int i;
1158
1159 i = 1;
1160 FOREACH_PROC_IN_SYSTEM(p) {
1161 FOREACH_THREAD_IN_PROC(p, td) {
1162 if (TD_ON_LOCK(td) && LIST_EMPTY(&td->td_contested)) {
1163 db_printf("chain %d:\n", i++);
1164 print_lockchain(td, " ");
1165 }
1166 if (db_pager_quit)
1167 return;
1168 }
1169 }
1170}
1171DB_SHOW_ALIAS(allchains, db_show_allchains)
1171
1172/*
1173 * Show all the threads a particular thread is waiting on based on
1174 * sleepable locks.
1175 */
1176static void
1177print_sleepchain(struct thread *td, const char *prefix)
1178{

--- 120 unchanged lines hidden ---
1172
1173/*
1174 * Show all the threads a particular thread is waiting on based on
1175 * sleepable locks.
1176 */
1177static void
1178print_sleepchain(struct thread *td, const char *prefix)
1179{

--- 120 unchanged lines hidden ---