RFC: DTrace probes for debugging or testing in userland programs
Hiroki Sato
hrs at FreeBSD.org
Mon Dec 19 21:08:44 UTC 2016
Domagoj Stolfa <domagoj.stolfa at gmail.com> wrote
in <20161219204719.GE65993 at freebsd-laptop>:
do> Hello,
do>
do> > I'd love to see a unified-ish logging API for FreeBSD applications. I
do> > always end up reusing some C code I have here that I based on some
do> > Squid style logging API in ages past. I could always polish it up and
do> > put it up for review.
do> >
do> > I'm not a big fan of requiring dtrace to use it though. On a lot of
do> > the embedded systems dtrace varies from "it's very big" through to "we
do> > don't have enough RAM/flash to do this".
do>
do> DTrace indeed is very heavyweight, this could be an opt-in kind of thing
do> compile time, hidden somewhere in the logging system employed.
do> Personally, I think that keeping the diffs in the actual daemons to the
do> bare minimum(1-2 LoC) should be one of the priorities. Additionally, the
do> logging system should by default be lightweight, with compile time
do> options to change the actual logging method(a simple log, DTrace, ...).
do>
do> > So although I like the sentiment, I don't think using dtrace for
do> > program logging is the right answer. I like what apple did to wrap
do> > the program logging stuff so people didn't just write their own
do> > libraries (hi!) and so there's a unified-ish way to interact with
do> > apple programs. I think we could do with that.
do>
do> This sounds like a pretty clean solution, and the logging method could
do> be hid somewhere deep in there. I would personally like to see an option
do> where I could pick DTrace for logging, as it allows for some interesting
do> scripts to be written, however I tend to agree that this should not be
do> the default.
To be clear: my proposal is to replace only debug logging (i.e. for
developers), not the other logging in general, as the subject line
says. Although I agree that DTrace is not lightweight, I think
impact of just adding tracing probes is small.
-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20161220/ca4deab4/attachment.sig>
More information about the freebsd-arch
mailing list