From owner-freebsd-arch@FreeBSD.ORG Sat Sep 27 09:01:56 2014 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 561893EF; Sat, 27 Sep 2014 09:01:56 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4447027E; Sat, 27 Sep 2014 09:01:54 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA22176; Sat, 27 Sep 2014 12:01:52 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XXnt2-0002oO-6j; Sat, 27 Sep 2014 12:01:52 +0300 Message-ID: <54267CAE.4090009@FreeBSD.org> Date: Sat, 27 Sep 2014 12:00:30 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Bryan Drewery , freebsd-arch@FreeBSD.org Subject: Re: KASSERT_WARN for asserting malloc(M_WAITOK) not in a non-sleepable thread References: <54236CD6.4050807@FreeBSD.org> <5424392D.9030201@FreeBSD.org> <1411668571.66615.247.camel@revolution.hippie.lan> <5425CAB6.2010102@FreeBSD.org> In-Reply-To: <5425CAB6.2010102@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: jhibbits@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 09:01:56 -0000 On 26/09/2014 23:21, Bryan Drewery wrote: > On 9/25/2014 1:22 PM, Justin Hibbits wrote: >> I like my bikeshed a nice royal blue. At a previous job we used >> ASSERT and VERIFY macros. VERIFY was comparable to this (warn if >> condition not met, don't panic), so how about KVERIFY() (I'll also >> support KWARN, but I think KVERIFY() conveys a better message by >> name). > > I will commit it as KVERIFY tonight based on the majority consensus. > Even at work right now we are tracking down an odd bug where this could > be useful to have temporarily. > Not sure if the following bit of information will influence your decision, but anyway. In the Solaris source code ASSERT is used like our KASSERT where DEBUG macro controls its definition like our INVARIANTS do. But VERIFY is used like KASSERT that is never compiled out. So, my personal preference would be to use KWARN for something that only warns. -- Andriy Gapon