From owner-freebsd-hackers@freebsd.org Sat Dec 31 12:26:33 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 2CF54C98C43 for ; Sat, 31 Dec 2016 12:26:33 +0000 (UTC) (envelope-from shea@shealevy.com) Received: from smtprelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0315518EA for ; Sat, 31 Dec 2016 12:26:32 +0000 (UTC) (envelope-from shea@shealevy.com) Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave05.hostedemail.com (Postfix) with ESMTP id D1623183EB8 for ; Sat, 31 Dec 2016 02:58:59 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 165F5235A7 for ; Sat, 31 Dec 2016 02:58:52 +0000 (UTC) X-Session-Marker: 7368656140736865616C6576792E636F6D X-Spam-Summary: 2, 0, 0, , d41d8cd98f00b204, shea@shealevy.com, :, RULES_HIT:41:355:379:871:966:968:973:988:989:1000:1260:1313:1314:1345:1381:1437:1516:1518:1534:1540:1575:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:3138:3139:3140:3141:3142:3352:3622:3690:3865:3866:3867:3868:3870:3871:3872:3874:4362:4385:5007:6261:6506:6747:7281:7909:9010:9040:10004:10848:11658:11914:12296:12663:13138:13161:13192:13229:13231:14096:14180:14721:21060:21080:21433:30034:30041:30054:30070:30075, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0, LFtime:1, LUA_SUMMARY:none X-HE-Tag: mist57_132c622e7ce63 X-Filterd-Recvd-Size: 2518 Received: from localhost (238.sub-174-192-30.myvzw.com [174.192.30.238]) (Authenticated sender: shea@shealevy.com) by omf08.hostedemail.com (Postfix) with ESMTPA for ; Sat, 31 Dec 2016 02:58:51 +0000 (UTC) From: Shea Levy To: freebsd-hackers@freebsd.org Subject: Detecting changes when mapping /dev/devstat Date: Fri, 30 Dec 2016 21:58:49 -0500 Message-ID: <87r34o3ity.fsf@shlevy-laptop.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" 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: Sat, 31 Dec 2016 12:26:33 -0000 --=-=-= Content-Type: text/plain Hi all, What is the appropriate way to detect changes when accessing devstat info via a mapping of /dev/devstat? I'm interested both in changes to the device list as a whole and new statistics on a given device. For new stats on a given device, it seems the only way to detect a new stat is to check the sequence number for that device. Is that right? For changes in the device list, it's a bit less clear. My hope was that I could map space for one more struct devstat than the current numdevs and just check to see if some field or other is nonzero, but in my glances through subr_devstat.c I'm not sure if there are any guarantees about those fields for structures past the current list, especially if a device was added and removed. Is there anything doable here? Thanks, Shea P.S. I wasn't quite sure which list was appropriate for this question, please feel free to point me to another! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE6ESKvwKkwnxgMLnaXAvWlX2G/icFAlhnHukACgkQXAvWlX2G /icRQw//QqWGAy+nTglYUMMP1H9/JD+UHlFj3bbewU+yGELA/boVHauAqT53VmiE qbYr0W+d7lc0NgkUSVJzTOZfcxMKFqAuGZu3B/u3FVf1fif7VqBu80egqYmt2AaG FKrRfOUA/y6MJq0SRfNUCLeia7BIbaUMLOiqzWcmRZH7p0Tl9V4ZzhKq6sADWKEg 6BOKN9DN2U4v/4ZYtom9jZwKpecf/Vzp4rdCeweAi1cVuTlHul7QFk36lBKQJhhb +5zrFsiJfmVpxnZgHM9gXLlGotm+EB70tBzvKcUFe27MZx3L6gZOiz3zUpXsWm88 RZWX5F3p+A6TxhxcROnvsbKTCots/2vZYzhfufYhsyF12Kr2om9c4T+W201il1gv d9HNpjMjBHM0oHLAHEo3GVVlkWVHu4RdxJ08tTlMGlrmfdXhks/nbOk/1jk3QfNJ pLs+CvihnO7iYGzF4Llyp+sCpJJRh1GH53fs71260qJidtVgSjKXbMQsI4upoqLr fhorfPHvxiG0flOXOH3ngJMMgLuNOtMsIXIKP59ypj6f5kLEe+cDAY9JDNFjrnRv D4H5pZx3rQtMdMrdsnU8Xk+lmxu+/GwXn57TXzb1orxGpA5sJBtPDeanq7UJqEoc VhN6E53YC5epiCiKbL0/yzePOUf5WYgiFEU7PmBRYxDyuvBOXTc= =OEO6 -----END PGP SIGNATURE----- --=-=-=--