]> sourceware.org Git - systemtap.git/commitdiff
Get systemtap.base/vars.exp working on newer kernels.
authorDavid Smith <dsmith@redhat.com>
Mon, 13 Feb 2017 16:42:23 +0000 (10:42 -0600)
committerDavid Smith <dsmith@redhat.com>
Mon, 13 Feb 2017 16:42:23 +0000 (10:42 -0600)
* testsuite/systemtap.base/vars.exp: Test for function existence before
  trying to list function variables. Test 'bio_copy_user_iov', which
  exists on newer kernels.

testsuite/systemtap.base/vars.exp

index 415d195a9cb4ec222f66920908611f90df50b4dd..5fb7b84426e973652a3feba9d2be95fde8bda47e 100644 (file)
@@ -29,6 +29,16 @@ proc parse_lineno { function line } {
    }
 }
 
+proc func_exists { function } {
+    set probe_point "kernel.function\(\"$function\"\)"
+    set line [get_listings $probe_point]
+    if {$line == ""} {
+       return 0
+    } else {
+       return 1
+    }
+}
+
 proc get_first_valid_lineno { function } {
    set linenos ""
    set probe_point "kernel.statement\(\"$function:*\"\)"
@@ -78,6 +88,11 @@ proc test_function { function } {
    global test
    set subtest "$test - $function"
 
+   if {! [func_exists $function]} {
+      untested "$subtest - doesn't exist"
+      return
+   }
+
    set lineno [get_first_valid_lineno $function]
    if {$lineno == 0} {
       fail "$subtest (no first lineno)"
@@ -110,4 +125,5 @@ proc test_function { function } {
 
 # Test a few different functions
 test_function {bio_copy_user@*/bio.c}
+test_function {bio_copy_user_iov@*/bio.c}
 test_function {vfs_read@fs/read_write.c}
This page took 0.033009 seconds and 5 git commands to generate.