From f8ae7322cff9a9c62f511b09021643aba6752692 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 15 Jul 2009 18:12:24 -0400 Subject: Add description of dropwatch to the examples. --- .../en-US/Useful_Scripts-dropwatch.xml | 114 +++++++++++++++++++++ .../en-US/Useful_SystemTap_Scripts.xml | 1 + 2 files changed, 115 insertions(+) create mode 100644 doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-dropwatch.xml (limited to 'doc/SystemTap_Beginners_Guide/en-US') diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-dropwatch.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-dropwatch.xml new file mode 100644 index 00000000..c7bee988 --- /dev/null +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-dropwatch.xml @@ -0,0 +1,114 @@ + + + + +
+ Monitoring Network Packets Drops in Kernel + +script examples +network profiling + + + +examples of SystemTap scripts +network profiling + + + +network profiling +examples of SystemTap scripts + + + + + probably http://sourceware.org/systemtap/examples/network/nettop.stp + + + +profiling the network +examples of SystemTap scripts + + + +network traffic, monitoring +examples of SystemTap scripts + + + +tracepoint +The network stack in Linux +can discard packets for various reasons. Some Linux kernels include a +tracepoint, kernel.trace("kfree_skb"), to allow easy probing +to determine where the packets are discarded. The +script uses that tracepoint trace packet discards. The script summarizes the +locations discarding packets every five seconds as totals number of packets +discarded for each location. + + + + dropwatch.stp + + + + + + + + +The kernel.trace("kfree_skb") instruments each of the places +in the kernel that drops network packets. Like probes for functions the +tracepoint probes also have arguments. The +kernel.trace("kfree_skb") has two arguments: a pointer to the +buffer being freed ($skb) and the location in kernel code the +buffer is being freed ($location). + + + +Running the dropwatch.stp script 15 seconds would result in output similar in +. The output lists the number of misses for +tracepoint address and the actual address. + + + + <xref linkend="dropwatch"/> Sample Output + +Monitoring for dropped packets + +51 packets dropped at location 0xffffffff8024cd0f +2 packets dropped at location 0xffffffff8044b472 + +51 packets dropped at location 0xffffffff8024cd0f +1 packets dropped at location 0xffffffff8044b472 + +97 packets dropped at location 0xffffffff8024cd0f +1 packets dropped at location 0xffffffff8044b472 +Stopping dropped packet monitor + + + + +The functions containing the location of the packet drops is determined using +/boot/System.map-`uname -r` file. The System.map file lists +the starting addesses for each function. Below are the sections of the +System.map file containing the addresses in the dropwatch.stp output. The +address 0xffffffff8024cd0f maps to the function +unix_stream_recvmsg and the address 0xffffffff8044b472 maps +to the function arp_rcv. + + + +[...] +ffffffff8024c5cd T unlock_new_inode +ffffffff8024c5da t unix_stream_sendmsg +ffffffff8024c920 t unix_stream_recvmsg +ffffffff8024cea1 t udp_v4_lookup_longway +[...] +ffffffff8044addc t arp_process +ffffffff8044b360 t arp_rcv +ffffffff8044b487 t parp_redo +ffffffff8044b48c t arp_solicit +[...] + +
+ diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml index eeab9b27..f9ba4290 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml @@ -43,6 +43,7 @@ +
Disk -- cgit