diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | testsuite/buildok/vfs_testcase.stp | 2 | ||||
-rw-r--r-- | testsuite/systemtap.examples/ChangeLog | 8 | ||||
-rw-r--r-- | testsuite/systemtap.examples/functioncallcount.meta | 13 | ||||
-rw-r--r-- | testsuite/systemtap.examples/functioncallcount.stp | 17 | ||||
-rw-r--r-- | testsuite/systemtap.examples/para-callgraph.meta | 13 | ||||
-rw-r--r-- | testsuite/systemtap.examples/para-callgraph.stp | 20 |
7 files changed, 79 insertions, 0 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index eda51529..9353cc32 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,9 @@ + +2008-07-01 Wenji Huang <wenji.huang@oracle.com> + + * buildok/vfs_testcase.stp: Test _vfs.generic_commit_write only when + kernel<=2.6.25. + 2008-06-27 David Smith <dsmith@redhat.com> * systemtap.base/utrace_p4.exp: Added tests for 'process(PID)' diff --git a/testsuite/buildok/vfs_testcase.stp b/testsuite/buildok/vfs_testcase.stp index dc78399c..5d8dff25 100644 --- a/testsuite/buildok/vfs_testcase.stp +++ b/testsuite/buildok/vfs_testcase.stp @@ -410,6 +410,7 @@ probe _vfs.generic_block_bmap print("get_block = %p\n", get_block); } +%( kernel_v <= "2.6.25" %? probe _vfs.generic_commit_write { print("Probe hit the function: %s\n", probefunc()); @@ -417,6 +418,7 @@ probe _vfs.generic_commit_write print("page = %p\n", page); print("from = %u to=%u\n", from, to); } +%) probe _vfs.block_prepare_write { diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog index b1c34347..dcaafe59 100644 --- a/testsuite/systemtap.examples/ChangeLog +++ b/testsuite/systemtap.examples/ChangeLog @@ -1,3 +1,11 @@ +2008-07-02 William Cohen <wcohen@redhat.com> + + * functioncallcount.meta, functioncallcount.stp: New. + +2008-07-02 William Cohen <wcohen@redhat.com> + + * para-callgraph.stp, para-callgraph.meta: New. + 2008-06-20 William Cohen <wcohen@redhat.com> * traceio2.meta: Correct test_check and test_installcheck commands. diff --git a/testsuite/systemtap.examples/functioncallcount.meta b/testsuite/systemtap.examples/functioncallcount.meta new file mode 100644 index 00000000..4d419528 --- /dev/null +++ b/testsuite/systemtap.examples/functioncallcount.meta @@ -0,0 +1,13 @@ +title: Count Times Functions Called +name: functioncallcount.stp +version: 1.0 +author: anonymous +keywords: profiling functions +subsystem: kernel +status: production +exit: user-controlled +output: sorted-list on-exit +scope: system-wide +description: The functioncallcount.stp script takes one argument, a list of functions to probe. The script will run and count the number of times that each of the functions on the list is called. On exit the script will print a sorted list from most frequently to least frequently called function. +test_check: stap -p4 functioncallcount.stp "*@mm/*.c" +test_installcheck: stap functioncallcount.stp "*@mm/*.c" -c "sleep 1" diff --git a/testsuite/systemtap.examples/functioncallcount.stp b/testsuite/systemtap.examples/functioncallcount.stp new file mode 100644 index 00000000..e393b612 --- /dev/null +++ b/testsuite/systemtap.examples/functioncallcount.stp @@ -0,0 +1,17 @@ +# The following line command will probe all the functions +# in kernel's memory management code: +# +# stap functioncallcount.stp "*@mm/*.c" + +probe kernel.function(@1) { # probe functions listed on commandline + called[probefunc()] <<< 1 # add a count efficiently +} + +global called + +probe end { + foreach (fn in called-) # Sort by call count (in decreasing order) + # (fn+ in called) # Sort by function name + printf("%s %d\n", fn, @count(called[fn])) + exit() +} diff --git a/testsuite/systemtap.examples/para-callgraph.meta b/testsuite/systemtap.examples/para-callgraph.meta new file mode 100644 index 00000000..3ce4b648 --- /dev/null +++ b/testsuite/systemtap.examples/para-callgraph.meta @@ -0,0 +1,13 @@ +title: Tracing Calls for Sections of Code +name: para-callgraph.stp +version: 1.0 +author: anonymous +keywords: trace callgraph +subsystem: kernel +status: production +exit: user-controlled +output: trace +scope: system-wide +description: The script takes two arguments: the first argument is the function to starts/stops the per thread call graph traces and the second argument is the list of functions to generate trace information on. The script prints out a timestap for the thread, the function name and pid, followed by entry or exit symboly and function name. +test_check: stap -p4 para-callgraph.stp sys_read "*@fs/*.c" +test_installcheck: stap para-callgraph.stp sys_read "*@fs/*.c" -c "sleep 1" diff --git a/testsuite/systemtap.examples/para-callgraph.stp b/testsuite/systemtap.examples/para-callgraph.stp new file mode 100644 index 00000000..1afb8837 --- /dev/null +++ b/testsuite/systemtap.examples/para-callgraph.stp @@ -0,0 +1,20 @@ +function trace(entry_p) { + if(tid() in trace) + printf("%s%s%s\n",thread_indent(entry_p), + (entry_p>0?"->":"<-"), + probefunc()) +} + +global trace +probe kernel.function(@1).call { + if (execname() == "stapio") next # skip our own helper process + trace[tid()] = 1 + trace(1) +} +probe kernel.function(@1).return { + trace(-1) + delete trace[tid()] +} + +probe kernel.function(@2).call { trace(1) } +probe kernel.function(@2).return { trace(-1) } |