witness patch

John Baldwin jhb at FreeBSD.org
Mon Mar 22 16:00:47 PST 2004


On Monday 22 March 2004 05:29 pm, Alfred Perlstein wrote:
> This gives a traceback when witness_warn() is called like when
> we get a lock order reversal in witness_checkorder().
>
> Please review or commit.

Looks ok.  If you want to match what witness_checkorder() does, you can make 
it do 'if (n) { if (trace) backtrace(); if (ddb) Debugger(); }', but I 
actually prefer what you did.  I wouldn't mind if you made the 
witness_checkorder() code do the same in fact (i.e., don't dump the trace if 
we are going to drop into the debugger anyways),

> Index: subr_witness.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/kern/subr_witness.c,v
> retrieving revision 1.170
> diff -u -r1.170 subr_witness.c
> --- subr_witness.c	27 Feb 2004 18:33:09 -0000	1.170
> +++ subr_witness.c	15 Mar 2004 09:47:45 -0000
> @@ -1150,6 +1150,8 @@
>  #ifdef DDB
>  	else if (witness_ddb && n)
>  		Debugger(__func__);
> +	else if (witness_trace && n)
> +		backtrace();
>  #endif
>  	return (n);
>  }

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-current mailing list