From owner-freebsd-arch@FreeBSD.ORG Mon Jul 29 18:47:16 2013 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 ESMTP id 6B316F40 for ; Mon, 29 Jul 2013 18:47:16 +0000 (UTC) (envelope-from matthew.ahrens@delphix.com) Received: from mail-pb0-x235.google.com (mail-pb0-x235.google.com [IPv6:2607:f8b0:400e:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA8C2846 for ; Mon, 29 Jul 2013 18:47:16 +0000 (UTC) Received: by mail-pb0-f53.google.com with SMTP id up15so4326512pbc.26 for ; Mon, 29 Jul 2013 11:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphix.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=S5o0Gj1KW/f2aa0fu1EVPmN7mktX8qKyghsgbpGAo8Y=; b=WNwh4VugdgHzBz4RdOc+C6hOKTrIGg+zJmTYy4K59MBFdK08Y18ChRs/h2LSeohB04 3yt3OcmcDeMg1fNLemMLlBH39fBhx+tqofHTvX6NSztbcUsnSpyPs6kP1a05JjDGkHCV jz21uv/WLLdfBUKTBsJZMdHxO5vpdC6C6iDes= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=S5o0Gj1KW/f2aa0fu1EVPmN7mktX8qKyghsgbpGAo8Y=; b=Ylf6Ux3of//2hknxNQbeXzjdS/FTfymYmclPBKwDQp051GcZK2/SoUPDNNy0wrIJ8b dQvcRenTiEXAXDSwYVD6+jup2qR7rnzwJ2XW8IIr46dJaVaAq1ATvJbaT16tYYX7Fscr K+Shvi7r97V+9T3Ml+BONQN4eAwcWP6SON6lX0KIyJvtiMgTnxbtXNkU8PodYcxvd/9f +ucocLjX6n0FAHErz4/qaEvu7Kq8TKEYIHCCwAqdCe5QhnEl2ZWRxeZb4uYDX+MTIYW4 ap3bIJ7q8wr5VHsaKtIClS6Wl46j65V0vP9prz30YDKB8pILThARMkU7YO5WO/Xw/2t4 +U3Q== MIME-Version: 1.0 X-Received: by 10.66.246.133 with SMTP id xw5mr69261373pac.114.1375123635826; Mon, 29 Jul 2013 11:47:15 -0700 (PDT) Received: by 10.70.132.66 with HTTP; Mon, 29 Jul 2013 11:47:15 -0700 (PDT) In-Reply-To: <51F67B2A.3040302@FreeBSD.org> References: <51F67B2A.3040302@FreeBSD.org> Date: Mon, 29 Jul 2013 11:47:15 -0700 Message-ID: Subject: Re: translate INVARIANTS to DEBUG for code from OpenSolaris From: Matthew Ahrens To: Andriy Gapon X-Gm-Message-State: ALoCoQn077IPMpapGnyIJEUQ++KQXYoKZ963UN1fHEvnG6ip23D6FdiKBzV9UbSd3P02deQ7wiH6 Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 18:47:16 -0000 >From my perspective (working primarily with the OpenSolaris / illumos code), this approach makes sense. --matt On Mon, Jul 29, 2013 at 7:24 AM, Andriy Gapon wrote: > [zfs-devel@, fs@, dtrace@ are Bcc-ed] > > In OpenSolaris and its descendants DEBUG is used in a fashion similar to > our > INVARIANTS. For example, ASSERT macros are enabled by it. > In our kernel code DEBUG has a different meaning and enables far too > verbose or > far too obscure code and, as such, it is very rarely enabled. > > The idea of a change that I would like to propose is to translate > INVARIANTS > kernel option into DEBUG for the files that originated from OpenSolaris > (and > hopefully only for them). > > The change: > opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG > > do this by forcing inclusion of > sys/cddl/compat/opensolaris/sys/debug_compat.h > via -include option into all source files from OpenSolaris. > Note that this -include option must always be after -include > opt_global.h. > > Additionally, remove forced definition of DEBUG for some modules and > fix > their build without DEBUG. > > Also, meaning of DEBUG was overloaded to enable WITNESS support for > some > OpenSolaris (primarily ZFS) locks. Now this overloading is removed and > that use of DEBUG is replaced with a new option OPENSOLARIS_WITNESS. > > http://people.freebsd.org/~avg/osol-invariants-debug.diff > > I would like to ask for your feedback on the soundness of the whole idea. > Also on the name, location and style of inclusion for > sys/cddl/compat/opensolaris/sys/debug_compat.h. > And on any other details of the proposed change. > > Testing is also welcome, of course. > > Thank you very much. > -- > Andriy Gapon > > _______________________________________________ > freebsd-dtrace@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org" >