summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples
diff options
context:
space:
mode:
authorDavid J. Wilder <wilder@wilder.ibm.com>2010-02-05 15:59:06 -0800
committerDavid J. Wilder <wilder@wilder.ibm.com>2010-02-05 15:59:06 -0800
commit8bead5e11a391879f87565b5a3fc9bbeec187b78 (patch)
tree9a68b8a75fd2f0e856535eb22b542a936d12b386 /testsuite/systemtap.examples
parent0621eba1754d670d878c1511a4d444dd9e54e33c (diff)
downloadsystemtap-steved-8bead5e11a391879f87565b5a3fc9bbeec187b78.tar.gz
systemtap-steved-8bead5e11a391879f87565b5a3fc9bbeec187b78.tar.xz
systemtap-steved-8bead5e11a391879f87565b5a3fc9bbeec187b78.zip
Added backports required for 2.6.18 kernel for RHEL 5.
Files changed: tapset/ipmib.stp, tapset.tcpmib.stp, testsuite/systemtap.examples/network/tcpipstat.stp, testsuite/systemtap.examples/network/tcp_trace.stp Signed-of-by: David Wilder <dwilder@us.ibm.com>
Diffstat (limited to 'testsuite/systemtap.examples')
-rwxr-xr-xtestsuite/systemtap.examples/network/tcp_trace.stp25
-rwxr-xr-xtestsuite/systemtap.examples/network/tcpipstat.stp16
2 files changed, 37 insertions, 4 deletions
diff --git a/testsuite/systemtap.examples/network/tcp_trace.stp b/testsuite/systemtap.examples/network/tcp_trace.stp
index 4763b386..d5a685ed 100755
--- a/testsuite/systemtap.examples/network/tcp_trace.stp
+++ b/testsuite/systemtap.examples/network/tcp_trace.stp
@@ -283,6 +283,7 @@ probe kernel.function("tcp_write_timer")
find_timer[key] = @cast(sk, "inet_connection_sock")->icsk_pending
}
+%( kernel_v > "2.6.24" %?
probe kernel.function("tcp_set_state")
{
sk = $sk
@@ -295,6 +296,7 @@ probe kernel.function("tcp_set_state")
clean_up(key);
}
}
+%)
function print_header()
{
@@ -343,6 +345,7 @@ function print_packet_info:long ( key:long, SourceIsLocal:long)
printf("\n");
}
+%( kernel_v > "2.6.24" %?
function print_close:long (key:long, new_state:long)
{
foreach ( [laddr, raddr, lport, rport] in key_list ){
@@ -357,6 +360,7 @@ function print_close:long (key:long, new_state:long)
printf("%-12s",state_num2str(new_state))
printf("\n");
}
+%)
/*
* Update the values in the data collection arrays, returns 1 if one or more
@@ -508,8 +512,12 @@ function process_cmdline:long ()
snd_wnd_flg = 1; continue };
if ( byte == "srtt" ) {
srtt_flg = 1; continue };
+%( kernel_v > "2.6.24" %?
if ( byte == "state" ) {
state_flg = 1; continue };
+%:
+ state_flg = 0;
+%)
if ( byte == "txq" ) {
txq_flg = 1; continue };
if ( byte == "rxq" ) {
@@ -528,9 +536,12 @@ function process_cmdline:long ()
length_flg = 1; continue };
if ( byte == "all" ) {
snd_cwnd_flg = snd_wnd_flg = srtt_flg =
- state_flg = txq_flg = rxq_flg =
+ txq_flg = rxq_flg =
rexmit_flg = pmtu_flg = ssthresh_flg =
timer_flg = rcvwnd_flg = length_flg = 1;
+%( kernel_v > "2.6.24" %?
+ state_flg = 1;
+%)
continue
};
usage("Unknown filter value given!")
@@ -591,10 +602,12 @@ function process_cmdline:long ()
/* default filter is all */
if ( !filter_given )
snd_cwnd_flg = snd_wnd_flg = srtt_flg =
- state_flg = txq_flg = rxq_flg =
+ txq_flg = rxq_flg =
rexmit_flg = pmtu_flg = ssthresh_flg =
timer_flg = rcvwnd_flg = length_flg = 1;
-
+%( kernel_v > "2.6.24" %?
+ state_flg = 1;
+%)
return filter_number;
}
@@ -697,6 +710,7 @@ function filter_key:long (sk:long)
}
/* Free up a slot in the data arrays */
+%( kernel_v > "2.6.24" %?
function clean_up (key:long)
{
foreach ( [laddr, raddr, lport, rport] in key_list ){
@@ -723,6 +737,7 @@ function clean_up (key:long)
if (rcvwnd_flg) delete rcvwnd[key];
delete length[key];
}
+%)
/* Terminates the run in timeout seconds, using global timeout value */
probe timer.s(1) {
@@ -737,7 +752,11 @@ function usage (msg:string)
printf("\t\t\t[update=change|all] Rule\n\n");
printf("\tRule format:");
printf("<local address>:<local-port>-<remote address>:<remote-port>\n");
+%( kernel_v > "2.6.24" %?
printf("\tFilter values: all|state|txq|rxq|srtt|snd_cwnd|snd_wnd|\n");
+%:
+ printf("\tFilter values: all|txq|rxq|srtt|snd_cwnd|snd_wnd|\n");
+%)
printf("\t\t\trexmit|pmtu|ssthresh|timer|rcvwnd\n\n");
printf("%s\n\n",msg);
error(msg);
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;