Date: Sat, 27 Sep 2014 12:00:30 +0300 From: Andriy Gapon <avg@FreeBSD.org> To: Bryan Drewery <bdrewery@FreeBSD.org>, freebsd-arch@FreeBSD.org Cc: jhibbits@FreeBSD.org Subject: Re: KASSERT_WARN for asserting malloc(M_WAITOK) not in a non-sleepable thread Message-ID: <54267CAE.4090009@FreeBSD.org> In-Reply-To: <5425CAB6.2010102@FreeBSD.org> References: <54236CD6.4050807@FreeBSD.org> <CACYV=-Eg69AQ72DOGppPSL7whJVCdcNg-auhBZ771iG7DfPdAw@mail.gmail.com> <5424392D.9030201@FreeBSD.org> <CAJ-Vmok5Xaa6aZvfL1GoW8C==dY47P=vKAEZhu16JhHjV%2BTk9g@mail.gmail.com> <CACYV=-GMpMxEAs-X7umMdYX2Awf3G0La1cUGsXeH9MoX34CdxQ@mail.gmail.com> <1411668571.66615.247.camel@revolution.hippie.lan> <CACYV=-HDVxhQ=CDK7HWuK2t-rsFkW2gKD45NDjC86jQ2wq6v9A@mail.gmail.com> <CAHSQbTCwwxvudijaanvUohF9Em_%2B2%2Bac-%2B1j0OEcNFY=vEx2gA@mail.gmail.com> <5425CAB6.2010102@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54267CAE.4090009>