Deleted Added
full compact
subr_witness.c (100011) subr_witness.c (102448)
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.

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

22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $
29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $
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.

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

22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $
29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $
30 * $FreeBSD: head/sys/kern/subr_witness.c 100011 2002-07-15 02:03:17Z mp $
30 * $FreeBSD: head/sys/kern/subr_witness.c 102448 2002-08-26 18:31:26Z iedowse $
31 */
32
33/*
34 * Implementation of the `witness' lock verifier. Originally implemented for
35 * mutexes in BSD/OS. Extended to handle generic lock objects and lock
36 * classes in FreeBSD.
37 */
38

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

924 }
925#ifdef DDB
926 if (witness_ddb && n)
927 Debugger(__func__);
928#endif /* DDB */
929 return (n);
930}
931
31 */
32
33/*
34 * Implementation of the `witness' lock verifier. Originally implemented for
35 * mutexes in BSD/OS. Extended to handle generic lock objects and lock
36 * classes in FreeBSD.
37 */
38

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

924 }
925#ifdef DDB
926 if (witness_ddb && n)
927 Debugger(__func__);
928#endif /* DDB */
929 return (n);
930}
931
932const char *
933witness_file(struct lock_object *lock)
934{
935 struct witness *w;
936
937 if (witness_cold || witness_dead || lock->lo_witness == NULL)
938 return ("?");
939 w = lock->lo_witness;
940 return (w->w_file);
941}
942
943int
944witness_line(struct lock_object *lock)
945{
946 struct witness *w;
947
948 if (witness_cold || witness_dead || lock->lo_witness == NULL)
949 return (0);
950 w = lock->lo_witness;
951 return (w->w_line);
952}
953
932static struct witness *
933enroll(const char *description, struct lock_class *lock_class)
934{
935 struct witness *w;
936
937 if (!witness_watch || witness_dead || panicstr != NULL)
938 return (NULL);
939 if ((lock_class->lc_flags & LC_SPINLOCK) && witness_skipspin)

--- 558 unchanged lines hidden ---
954static struct witness *
955enroll(const char *description, struct lock_class *lock_class)
956{
957 struct witness *w;
958
959 if (!witness_watch || witness_dead || panicstr != NULL)
960 return (NULL);
961 if ((lock_class->lc_flags & LC_SPINLOCK) && witness_skipspin)

--- 558 unchanged lines hidden ---