Detecting changes when mapping /dev/devstat
Conrad Meyer
cem at freebsd.org
Sat Dec 31 21:29:18 UTC 2016
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 at 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!
More information about the freebsd-hackers
mailing list