From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 15 06:15:48 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 152D09E4; Thu, 15 Nov 2012 06:15:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id B7B0A8FC08; Thu, 15 Nov 2012 06:15:47 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id 16so1654740obc.13 for ; Wed, 14 Nov 2012 22:15:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=+X3hI/ivxIXd0+H7ewJ23HBr6k+KpZ9WITZjfUjX/Yk=; b=IafJ1gysZKKUZlwTlbfs9FmDYKfS/ZcbL8uPQI7JemgHxTLyfXPYFWpXQ1HwnSEULE i+6ySnP5hNWjz8zrZ6hia0TVioK3R89tev5WtjRYig9qXHjk8eZzXmehlJ3vVBWzCg1O HHHZWEMJFfNJZWsGhjitQPkCqpbVR/iYFksxHfuxwG+tZsTMoSQCnfnqofAaPtFJsUxm nO4CzMFvgWSnT5PtTI+//VGltF9FWUEA4f7K0hqA33B9vCjT7+y9xcnZgV/ym+lLMmrU XHRHAJwRb7FauzhRZC3CkrfNikpR7t7zjq6YXdCmTOg53O7Wyh8rzjwcyTclMfD8Iwek 3u/Q== MIME-Version: 1.0 Received: by 10.182.69.50 with SMTP id b18mr52208obu.75.1352960146780; Wed, 14 Nov 2012 22:15:46 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.76.27.65 with HTTP; Wed, 14 Nov 2012 22:15:46 -0800 (PST) Date: Wed, 14 Nov 2012 22:15:46 -0800 X-Google-Sender-Auth: 0Rz1azTUUeP__CP-U11sAXzxaeA Message-ID: Subject: [RFQ] make witness panic an option From: Adrian Chadd To: freebsd-hackers@freebsd.org Content-Type: multipart/mixed; boundary=14dae93b5780f1b3ca04ce8294f5 Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 06:15:48 -0000 --14dae93b5780f1b3ca04ce8294f5 Content-Type: text/plain; charset=ISO-8859-1 Hi all, When debugging and writing wireless drivers/stack code, I like to sprinkle lots of locking assertions everywhere. However, this does cause things to panic quite often during active development. This patch (against stable/9) makes the actual panic itself configurable. It still prints the message regardless. This has allowed me to sprinkle more locking assertions everywhere to investigate whether particular paths have been hit or not. I don't necessarily want those to panic the kernel. I'd like everyone to consider this for FreeBSD-HEAD. Thanks! Adrian --14dae93b5780f1b3ca04ce8294f5 Content-Type: application/octet-stream; name="20121114-witness-1.diff" Content-Disposition: attachment; filename="20121114-witness-1.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h9jhl24w0 SW5kZXg6IHN5cy9rZXJuL3N1YnJfd2l0bmVzcy5jCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9rZXJuL3N1 YnJfd2l0bmVzcy5jCShyZXZpc2lvbiAyNDE0OTEpCisrKyBzeXMva2Vybi9zdWJyX3dpdG5lc3Mu Ywkod29ya2luZyBjb3B5KQpAQCAtMzE5LDYgKzMxOSwyOCBAQAogCXJldHVybiAoYS0+ZnJvbSA9 PSBiLT5mcm9tICYmIGEtPnRvID09IGItPnRvKTsKIH0KIAorLyoKKyAqIFdoZXRoZXIgdG8gcGFu aWMgb3Igbm90IHdoZW4gYSB3aXRuZXNzIGNvbmRpdGlvbiBvY2N1cnMuCisgKi8KK3N0YXRpYyBp bnQgd2l0b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