mbuf question again
Hi I would like to know if it is possible to write a program to check which mbuf's are allocated to which programs that are currently running, or is this totally not possible? If it is possible, could someone point me in the right direction as in which libraries / functions / reading material i would need to look at in order to do so? Thanx Cole / Stalker ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: mbuf question again
On Tue, Apr 01, 2003 at 11:34:03AM +0200, Stalker wrote: Hi I would like to know if it is possible to write a program to check which mbuf's are allocated to which programs that are currently running, or is this totally not possible? If it is possible, could someone point me in the right direction as in which libraries / functions / reading material i would need to look at in order to do so? It's not so easy. mbuf objects primary used to represent fragmented packet in the system or incapsulated packet as list of protocols headers and packet data. mbuf objects are allocated when NIC receive packet and transfer it from NIC's memory to main RAM. In that moment mbuf object is unqueued and referenced only by interface driver code so you cant find a system structure points to mbuf object. Packet incapsulated in mbuf object can be bridged out, fast-forwarded or queued for other processing. Network stack then dequeue it and pop it up until packet is added to process socket buffer sockbuf (see sys/socketvar.h) [*] At this moment you can map mbufs against running processes. But in the context of fixing network problems it can be total useless to view this mapping. Same process is on sending packets. Theoretically it's possible to write kernel module to print all allocated mbufs in the system but it's much easy just to coredump the kernel, save core and use gdb for browsing. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: mbuf question again
Stalker wrote: I would like to know if it is possible to write a program to check which mbuf's are allocated to which programs that are currently running, or is this totally not possible? If it is possible, could someone point me in the right direction as in which libraries / functions / reading material i would need to look at in order to do so? The mbufs are not accounted to particular processes; our TCP/IP stack is kernel code, not user space code. 8-). If you look at the output of netstat -aA, you will get the application data pending in so_snd and so_rcv queues. You don't get the mbufs in progress, and you don't get the size of the freelist; you can approximate the second one with vmstat -m, but the in progress numbers are simply not available, because it's more important to use the memory and CPU for actual data, rather than accounting structures. -- Terry ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Mbuf Question
Hey Just a quick question, we have a bsd box that is running out of mbufs, its just constantly increasing and we cant quite shut down a process at a time to find the cause since its a live box. So what i would like to know, is, is it possible to code a program to see how many mbufs are allocated to which program and find the one using them all up? Or is that not at all possible? If it is possible, could you put me in the right direction to accomplish this and the libraries or functions i might need to read/learn? Thanx Cole/Stalker ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Mbuf Question
Hey I have a quick question. Is it possible to find out which mbuf clusters are allocated to specific programs that are running or is that impossible. If it is possible, then could someone point me in the right direction for reading material or the functions / libraries that i would need to look at? Thanx Cole / Stalker ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]