summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/network/tcpipstat.stp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.examples/network/tcpipstat.stp')
-rwxr-xr-xtestsuite/systemtap.examples/network/tcpipstat.stp16
1 files changed, 15 insertions, 1 deletions
diff --git a/testsuite/systemtap.examples/network/tcpipstat.stp b/testsuite/systemtap.examples/network/tcpipstat.stp
index 23f0e7cd..d545c09e 100755
--- a/testsuite/systemtap.examples/network/tcpipstat.stp
+++ b/testsuite/systemtap.examples/network/tcpipstat.stp
@@ -446,12 +446,18 @@ function print_tcpmib (key:long)
printf("Tcp:\n");
if (ActiveOpens[key]||!nozeros)
printf("\tActiveOpens = %d\n", ActiveOpens[key]);
+%( kernel_v > "2.6.21" %?
if (AttemptFails[key]||!nozeros)
printf("\tAttemptFails = %d\n", AttemptFails[key]);
+%)
+%( kernel_v > "2.6.24" %?
if (CurrEstab[key]||!nozeros)
printf("\tCurrEstab = %d\n", CurrEstab[key]);
+%)
+%( kernel_v > "2.6.24" %?
if (EstabResets[key]||!nozeros)
printf("\tEstabResets = %d\n", EstabResets[key]);
+%)
// if (InErrs[key]||!nozeros)
// printf("\tInErrs = %d\n", InErrs[key]);
if (InSegs[key]||!nozeros)
@@ -514,8 +520,10 @@ function _report(laddr:long, raddr:long, lport:long, rport:long)
}
key = key_list[laddr, raddr, lport, rport]
+%( kernel_v > "2.6.24" %?
if ( onclose && (CurrEstab[key] < 0) )
printf("Stats were not collected for the entire socket life.\n")
+%)
printf("-----------------------------------------\n");
print_sockmib(key)
@@ -560,6 +568,7 @@ probe linuxmib.* {}
* the dump off all stats for this socket. This feature only makes sense
* when index=tuple.
*/
+%( kernel_v > "2.6.24" %?
probe tcpmib.CurrEstab
{
if (!onclose) next
@@ -576,6 +585,7 @@ probe tcpmib.CurrEstab
delete key_list[laddr, raddr, lport, rport]
delete CurrEstab[key]
}
+%)
/* SNMP has no counter for the number of bytes sent or received by TCP.
@@ -584,7 +594,11 @@ probe tcpmib.CurrEstab
global SockSendbytes;
global SockSendmsg;
probe tcp.sendmsg.return {
- sk = $sock->sk;
+%( kernel_v < "2.6.23" %?
+ sk=$sk;
+%:
+ sk = $sock->sk;
+%)
op = size; // $return
if ( op <= 0 ) next;
if ( !sk ) next;