vminfo provider for FreeBSD

From: Peter Johnson <pete-fbsd_at_hiddenrock.com>
Date: Thu, 02 Jun 2022 17:08:27 UTC
Hi there --

I would find the probes in Illumos' vminfo provider [1] really handy to have
in FreeBSD and I'm happy to do the work to make it happen.  The only
FreeBSD-related mention of the vminfo provider I can find is an old mailing
list post [2] that I interpret to mean that the existing fbt probes aren't a
meaningful alternative (not to mention that using fbt probes effectively
requires more understanding of the source code than is perhaps desirable given
DTrace's intended purpose/audience).

My first question is: would such an addition be welcome?  I can make a more
detailed case for its inclusion if that would be helpful/persuasive.

If it is welcome, my plan would be to get very well-acquainted with FreeBSD's
VM subsystem, identify where each of the vminfo probes described in the
Illumos documentation should go, and then develop a patch to add those probes,
seeking feedback from both freebsd-dtrace folks and whichever group has
dominion over the VM stuff.

My second question is: does this sound like a reasonable plan?  It is,
admittedly, almost uselessly high level, but I expect I will need more than a
little familiarity with the codebase before I can get more specific.

Given the mailing list post I mentioned above, it seems possible that some of
the vminfo probes described in the Illumos documentation don't make sense in
the context of FreeBSD (eg, if FreeBSD doesn't have a distinct paging daemon,
then the pgrrun, rev, and scan probes aren't suited for transfer).  On the
other hand, there may be aspects on the FreeBSD side which would be beneficial
to monitor, but for which Illumos does not define probes.

Therefore, my third question is: how important is it for a vminfo provider
implementation in FreeBSD to hew closely to the Illumos implementation?  Would
it be acceptable to not transfer some probes that don't make sense and add
some new probes that do?  Documentation is obviously vital for any deviations,
and I will make darn sure to make it a central part of the work.

Any and all feedback is most appreciated.

Thanks.

pete


[1] https://illumos.org/books/dtrace/chp-vminfo.html
[2] https://lists.freebsd.org/pipermail/freebsd-dtrace/2014-April/000209.html