Date: Sun, 22 Aug 2004 14:12:53 +0000 From: Bosko Milekic <bmilekic@FreeBSD.org> To: Paolo Pisati <flag@oltrelinux.com>, FreeBSD_Hackers <freebsd-hackers@freebsd.org> Subject: Re: Playing with mbuf in userland Message-ID: <20040822141253.GA50325@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
I wrote: Another option to look into would be to implement a sysctl(8)-exported handler that iterates over the mbuf chain and prints out the mbuf chains in something like XML, which your userland application can then more or less easily parse, and reproduce the chain ("fake it up") in userland. This solution is rather attractive because you can do all sorts of things with the intermediate-parsing-language right from the kernel, as well as from userland (at the parsing stages). To see an example of a sysctl(8) handler, refer to src/sys/vm/uma_core.c (the bottom) in FreeBSD 5.x. I should also add: you should have various sysctl OIDs that call this handler passing, say, the mbuf chain as an argument (a reference to the top mbuf). This way certain OIDs can send out a snapshot of an mbuf chain at a particular point in the stack, and others can send snapshots from the socket buffer and driver entry-points (you can get some perception of how the chain changes as it makes its way up-and-down the layers). -Bosko
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040822141253.GA50325>