From 379c58568dbb247ed6583434ff4658c0794b977d Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Wed, 2 Dec 2009 17:45:20 +0800 Subject: Make tapset and tests compatible with old kernel * tapset/ioscheduler.stp : Make probe optional. * tapset/irq.stp : Ditto. * tapset/scheduler.stp : Ditto. * tapset/tcpmib.stp : Ditto. * tapset/linuxmib.stp : Switch variable by version. * tapset/tty.stp : Ditto. * testsuite/buildok/irq.stp : Make probe test optional. * testsuite/buildok/tty.stp : Ditto. * testsuite/systemtap.examples/network/netdev.stp : Ditto. * testsuite/buildok/tcpmib-all-probes.stp : Add embedded functions. --- testsuite/buildok/irq.stp | 6 +++--- testsuite/buildok/tcpmib-all-probes.stp | 22 ++++++++++++++-------- testsuite/buildok/tty.stp | 8 ++++---- 3 files changed, 21 insertions(+), 15 deletions(-) (limited to 'testsuite/buildok') diff --git a/testsuite/buildok/irq.stp b/testsuite/buildok/irq.stp index b1a141dc..7f1c2ab6 100644 --- a/testsuite/buildok/irq.stp +++ b/testsuite/buildok/irq.stp @@ -2,6 +2,6 @@ // Tests if all probes in irq tapset are resolvable -probe workqueue.* {} -probe irq_handler.* {} -probe softirq.* {} +probe workqueue.* !, never {} +probe irq_handler.* !, never {} +probe softirq.* !, never {} diff --git a/testsuite/buildok/tcpmib-all-probes.stp b/testsuite/buildok/tcpmib-all-probes.stp index f20ba8bb..8d1105e1 100755 --- a/testsuite/buildok/tcpmib-all-probes.stp +++ b/testsuite/buildok/tcpmib-all-probes.stp @@ -4,12 +4,18 @@ probe tcpmib.* {} -function tcpmib_filter_key:long (sk:long, op:long) { - // Insure all these functions will build - if ( tcpmib_get_state(sk) ) return 0 - if ( tcpmib_local_addr(sk) ) return 0 - if ( tcpmib_remote_addr(sk) ) return 0 - if ( tcpmib_local_port(sk) ) return 0 - if ( tcpmib_remote_port(sk) ) return 0 - return op +probe begin{ + print(tcpmib_get_state(0) + + tcpmib_local_addr(0) + + tcpmib_remote_addr(0) + + tcpmib_local_port(0) + + tcpmib_remote_port(0) + + _rtn_local() + + _is_reset(0) + +%( kernel_v < "2.6.31" %? + __tcpmib_input_route_type_old(0) +%: + __tcpmib_input_route_type_new(0) +%) + ) } diff --git a/testsuite/buildok/tty.stp b/testsuite/buildok/tty.stp index 0b5018d9..3e717f6e 100755 --- a/testsuite/buildok/tty.stp +++ b/testsuite/buildok/tty.stp @@ -24,7 +24,7 @@ probe tty.open { printf("File: %s mode %x flags %x\n", file_name, file_mode, file_flags) } -probe tty.resize { +probe tty.resize ? { printf("Resizing %s from %dx%d (%d/%d) to %dx%d (%d/%d)\n", name, old_row, old_col, old_xpixel, old_ypixel, new_row, new_col, new_xpixel, new_ypixel) } @@ -33,7 +33,7 @@ probe tty.ioctl { printf("Ioctling file %s with %d %d\n", name, cmd, arg) } -probe tty.init { +probe tty.init ? { printf("new tty with name %s from driver %s and module %s\nn", driver_name, name, module) } @@ -42,10 +42,10 @@ probe tty.receive { } -probe tty.write { +probe tty.write ? { printf("Buffer %s (len %d) wrote on file %s (driver %s)\n", buffer, nr, file_name, driver_name) } -probe tty.read { +probe tty.read ? { printf("Reading tty file %s (driver %s) to a buffer with size %d containing %s\n", file_name, driver_name, nr, buffer) } -- cgit