From owner-freebsd-testing@freebsd.org Fri Jun 19 21:55:28 2020 Return-Path: Delivered-To: freebsd-testing@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0938F33A1CE for ; Fri, 19 Jun 2020 21:55:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pXfl6CpRz3bx5; Fri, 19 Jun 2020 21:55:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pj1-x1041.google.com with SMTP id ga6so4632542pjb.1; Fri, 19 Jun 2020 14:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=DmpABfxYq+RoVt7OC43o88nqhYItvnrWPYx30tlMhB8=; b=JpFBzim/54OXaaupFsK+CmHCqHJzH7W46ngaiqHqZjPjVjvUcy6Tm7jZx+9D42HdBT MZdq+wlvnMEmAqClIySv/6X0oaq3YmbHo4tXBUYhIo+H47zzojyg2iMIBH1GmBxzYzyt M4nAr0cbJuU9v4egIOyN5HaAT8WS8OcjT6sqAcBO0ecQCrq47P5BzLloIK08vWlm3Y+g RofKn4Z19UIv1VWFDqb5ibfkENNZUg+f60FtGTftIM3OBC4CnXzm2G5+oomm0WiJFbCM PDaVZ7Ka5SvmCfOlDM1o7OiGqoy93+tePaq3UC7eSKNvKgpQMyN55Ro38l5JoJ2yJJ+q vZ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=DmpABfxYq+RoVt7OC43o88nqhYItvnrWPYx30tlMhB8=; b=AQXj0RzFPY5ELabkT3WB+krmVZFZT+MCePtKruFo/RgBf3I7Aa5Jd47LBb2nFJCvA5 czS1uBLfGhYv3gHCOrRrfArwbzBUCrCe2qoFSCSL0uZQqCy0iUka+ciGuaseENWoP0Gw aOP0W+L4aYmibqRsZo/lYCG8u8n0s/QhYRtPYPulPLXbMYp1hSnoPfsenua7nO72DWdt Da9wDCHBFtKwOXEQIsVpfOWiNJNbaI7U+WIjOtmu9NQAbIE6P4Jlw/wIHWUcfoKcYY80 T2bxQHr/OJJYI44U6wtvsfulhPm7XDIOVFtlbUvgcoQ3ybfJ/z6n5O1N0uajO/8vYk8y /aNA== X-Gm-Message-State: AOAM531Cx+E4OK0KEzccS0uYwNR3hkfG1sZBufyPPSOgjT/+emm5SMXv Zc9uxyxQWGr0jUDMCZ2fRtZDjUQHibU= X-Google-Smtp-Source: ABdhPJxhYKRJAZB3qzcel3XeHR/Rcmw4F/aGQwtSU9O6tIpjXtkSQ3GpnpMLudRxtKWTTJ2DZl4Gyg== X-Received: by 2002:a17:90a:ad03:: with SMTP id r3mr5567702pjq.104.1592603725980; Fri, 19 Jun 2020 14:55:25 -0700 (PDT) Received: from [192.168.20.26] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id n189sm6711406pfn.108.2020.06.19.14.55.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jun 2020 14:55:25 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: Querying kernel features From: Enji Cooper In-Reply-To: <8B2AC268-7CA2-4FDA-BA58-FAEF7F0715BF@FreeBSD.org> Date: Fri, 19 Jun 2020 14:55:24 -0700 Cc: John-Mark Gurney , freebsd-testing@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0CC36359-9354-4C34-BD65-C01CB15BD5E6@gmail.com> References: <6C6C4F2B-CD11-4777-A97C-D249C514DEEA@FreeBSD.org> <20200618231944.GB4213@funkthat.com> <8B2AC268-7CA2-4FDA-BA58-FAEF7F0715BF@FreeBSD.org> To: Kristof Provost X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49pXfl6CpRz3bx5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; REPLY(-4.00)[] X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 21:55:28 -0000 > On Jun 19, 2020, at 10:47 AM, Kristof Provost wrote: >=20 > On 19 Jun 2020, at 1:19, John-Mark Gurney wrote: >> Kristof Provost wrote this message on Thu, Jun 18, 2020 at 22:57 = +0200: >>> Say that I have a test for an optional kernel feature (say ALTQ, or >>> TMPFS) is there an elegant way of figuring out at runtime if it???s >>> available? >>>=20 >>> Doing `sysctl kern.conftxt | grep ALTQ` feels a little inelegant, = and is >>> begging for issues with incorrect matches. >>>=20 >>> I???m tempted to add a sysctl node for ALTQ, but perhaps there???s a >>> better way. Or perhaps this should be a general feature (so we???d = have >>> nodes like kernel.feature.tmpfs=3D1). >>=20 >> Look at kern.features... There's a FEATURE macro to add entries to >> that, but looks like there isn't any man page for it... >>=20 >> sys/geom/eli/g_eli.c:FEATURE(geom_eli, "GEOM crypto module"); >>=20 > Ah, thanks, that=E2=80=99s pretty much exactly what I was looking for. >=20 > There is a man page for feature_present(3), which is a C function to = check for the presence of a given feature. It does the sysctl for you. > That=E2=80=99s not quite what I need (atf-sh make sysctl the easiest = interface), but I figured I=E2=80=99d point out at least something is = documented. There are some convenience macros in tests/freebsd_test_suite/macros.h . = I=E2=80=99ll work on adding some atf-sh available functions for the lot = (seeing as there isn=E2=80=99t really any good documentation for it = anywhere). HTH, -Enji=