[patch] .statement("function@file.c+5")

Stan Cox scox@redhat.com
Mon Jun 9 11:43:00 GMT 2008


Here is a simple test for relative .statement.  It sets two probes in
the function bio_init and makes sure they are both hit.


-------------- next part --------------
global stack2, stack2func, stack3, stack3func

probe kernel.statement("bio_init@fs/bio.c+2") {
  stack2 = tokenize(backtrace(), " ")
  stack2func = probefunc()
}
probe kernel.statement("bio_init@fs/bio.c+3") {
  stack3 = tokenize(backtrace(), " " )
  stack3func = probefunc()
  if (stack2func == stack3func) {
     printf ("PASS %s\n", stack2func)
  }
  else {
     printf ("FAIL %s %s\n", stack2func, stack3func)
  }
  if (stack2 < stack3) {
     printf ("PASS address\n")
  }
  else {
     printf ("FAIL address %s %s\n", stack2, stack3)
  }
  
  exit()
}
-------------- next part --------------
# test integer limits. Set and print variables and print constants.

set test "stmt_rel"
set ::result_string {PASS bio_init
PASS address
}

stap_run2 $srcdir/$subdir/$test.stp


More information about the Systemtap mailing list