How Can I Monitor TCP Kernel Stats?
You can either use the kernel's built-in tcp_trace() routines or insert
your own printfs. It's always a help, though, to run your application in
socket debug mode so you know exactly which connection your TCP statistics are
for.
Using trpt and tcp_trace()
- Compile a kernel with "options TCPDEBUG" in the config file
- Run trpt
to process the debug info saved by the kernel.
Using console and tcp_trace()
- Run an application with a socket in debug mode (socket option SO_DEBUG)
- Set "options TCPCONSDEBUG" to dump the debugging info to the console,
where you can look at it with dmesg or in /var/log/messages.
Using console and printfs
- Run an application with a socket in debug mode (socket option SO_DEBUG)
- Use "if (so->so_options & SO_DEBUG)" around the printfs.
- Put printfs in the code and the output will go to the console which you
can look at it with dmesg or in /var/log/messages.
Other
DiRT documents
Author: Michele Clark