Date: Sat, 31 Dec 2016 10:32:23 -0800 From: Conrad Meyer <cem@freebsd.org> To: Shea Levy <shea@shealevy.com> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: Detecting changes when mapping /dev/devstat Message-ID: <CAG6CVpWrmx9Y4DMmqFnQw3FQUFvZSzPmGe3ewNom%2Btp%2BBDFxCw@mail.gmail.com> In-Reply-To: <87r34o3ity.fsf@shlevy-laptop.i-did-not-set--mail-host-address--so-tickle-me> References: <87r34o3ity.fsf@shlevy-laptop.i-did-not-set--mail-host-address--so-tickle-me>
next in thread | previous in thread | raw e-mail | index | archive | help
Shea, You might try looking at how devstat(8) uses the interface. http://devstat.googlecode.com/ ("pkg install devstat"). Best, Conrad On Fri, Dec 30, 2016 at 6:58 PM, Shea Levy <shea@shealevy.com> wrote: > 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!
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpWrmx9Y4DMmqFnQw3FQUFvZSzPmGe3ewNom%2Btp%2BBDFxCw>