From owner-freebsd-hackers@freebsd.org Tue Dec 13 05:33:23 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0125C7586E for ; Tue, 13 Dec 2016 05:33:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6629184B for ; Tue, 13 Dec 2016 05:33:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id d9so207167240ioe.0 for ; Mon, 12 Dec 2016 21:33:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=bXR2w1w3Ka3LiSXypnmcvKxRs7kgouIK05kTLi3pDZY=; b=h6vzeUZz9I0Hne8qnWnpT0JnExjEbqzTV6i8h1mFLi35N7MCiYz3uOOWQyziUfqaZ1 9gAnQzACuIN3WFP6dovhahZUN23gg+cthzBtSoCgdyJsJ+rDUNco/cn+JzFVxe7zSA8i /n7cqDmUCldNBcy1bbU0nB8/o5MG0oHxyYWeuHa4Q/uGi+yEa+EQUBpKO5OQX9DprUGX FqHIsahsEZeY93cwSStrAd3LxlTBwluZektYXzZUTBupuh2Zcj50LmoVLc0LLQSxqlEa jLcR+6N+PH6+lliw98bkJR6vFsXmacZ53Hd48gk92jZtMUV95aR+YVmK4EGOnPQuHzTI HO1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=bXR2w1w3Ka3LiSXypnmcvKxRs7kgouIK05kTLi3pDZY=; b=KK8Xs3Jt8oRsVqqn+EzMXvb04Eyq99RLAO1Ur0VFUr+lKUROu0gMiW9P2CKRBtkuhD RtHCOgdRvo6yFtsAUcJDP82IS3yj4grhdHJr3BWdL+AsdVtLzaDn7RlfTisDAfM5P2SU mgt3GnxS+IO/WSkRb2l5lyKKkdFu5ObEFRJDwqJZwc23zuwSt/7ejxS/c3t5UTMRbIeD XZ2oScp3agGvSjXJz6KvvrrjNDVtpKTaR3Ip7/xUykxgEHBGHoPS4h7k47Ub7AeHJAVh T5lmLICUiHXues5j3P7ciSWqPLVNSZn1fzPlQfD7h7U07uj7P8/9Iv3cUYCUO1hk9Vi6 o3uw== X-Gm-Message-State: AKaTC03x2Pko2ZSU0FUzLYp5YHy14HB/Y0qWn0iPly8zdjyIpcRWOf7T5Iyc4+x+qtof5fIVvjjP2aYiRHXThw== X-Received: by 10.36.84.138 with SMTP id t132mr971646ita.103.1481607203010; Mon, 12 Dec 2016 21:33:23 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.31.199 with HTTP; Mon, 12 Dec 2016 21:33:22 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: References: <200A5D70-24CE-4843-B99D-E10A2AF4F68F@FreeBSD.org> <20161213052759.GP61036@server.rulingia.com> From: Warner Losh Date: Mon, 12 Dec 2016 22:33:22 -0700 X-Google-Sender-Auth: 3DBRxeCesdlcPptbC8F3BM8b-n8 Message-ID: Subject: Re: Sysctl as a Service, or: making sysctl(3) more friendly for monitoring systems To: Peter Jeremy Cc: Warner Losh , Ed Schouten , FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2016 05:33:24 -0000 On Mon, Dec 12, 2016 at 10:29 PM, Warner Losh wrote: > >> On Dec 12, 2016, at 10:27 PM, Peter Jeremy wrote: >> >> On 2016-Dec-12 17:57:07 -0700, Warner Losh wrote: >>> On Mon, Dec 12, 2016 at 6:34 AM, Ed Schouten wrote: >>>> $ time ./prometheus_sysctl_exporter | wc -l >>>> 0.00 real 0.00 user 0.00 sys >>>> 3162 >>>> >>>> If our sysctl tree would get substantially larger at some point, we >>>> should of course revisit this. >>> >>> That sounds cool. I'd love to see what you came up with to get those results. >> >> I think that's impressive as well. >> >>> While we're here... there's one thing I'd love to see from a >>> hypothetical /dev/sysctl... When a sysctl value changes (or some >>> subset), I'd like it to appear on a read-channel. That way, I could >>> monitor temperature w/o needing to constantly poll for changes, for >>> example. >> >> That sounds like a job for kqueue(2), though it would need to be plumbed >> through. The biggest problem I see is that nothing in the sysctl mechanism >> has any way of reporting that a value has changed and so consumers of that >> data should re-check. This means that you'd probably just wind up polling >> in the kernel. > > It does if you had a read-channel :) Yea, forgot about the pointer case, you're right. This is a cool idea, but it can't work. Warner