Re: Playing with mbuf in userland
From: Bosko Milekic (bmilekic_at_FreeBSD.org)
Date: 08/22/04
- Previous message: Bosko Milekic: "Re: Playing with mbuf in userland"
- Maybe in reply to: Paolo Pisati: "Playing with mbuf in userland"
- Next in thread: gerarra_at_tin.it: "RE: Playing with mbuf in userland"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 22 Aug 2004 14:12:53 +0000 To: Paolo Pisati <flag@oltrelinux.com>, FreeBSD_Hackers <freebsd-hackers@freebsd.org>
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
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Bosko Milekic: "Re: Playing with mbuf in userland"
- Maybe in reply to: Paolo Pisati: "Playing with mbuf in userland"
- Next in thread: gerarra_at_tin.it: "RE: Playing with mbuf in userland"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]