diff options
-rw-r--r-- | testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | testsuite/systemtap.examples/index.html | 3 | ||||
-rw-r--r-- | testsuite/systemtap.examples/index.txt | 8 | ||||
-rw-r--r-- | testsuite/systemtap.examples/keyword-index.html | 3 | ||||
-rw-r--r-- | testsuite/systemtap.examples/keyword-index.txt | 8 | ||||
-rw-r--r-- | testsuite/systemtap.examples/profiling/topsys.meta | 13 | ||||
-rw-r--r-- | testsuite/systemtap.examples/profiling/topsys.stp | 24 | ||||
-rw-r--r-- | testsuite/systemtap.samples/topsys.stp | 69 |
8 files changed, 69 insertions, 69 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index c8883da4..4c0a85a9 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,5 +1,15 @@ 2009-02-02 Will Cohen <wcohen@redhat.com> + * systemtap.samples/topsys.stp: Revised and moved to examples. + * systemtap.examples/profiling/topsys.stp: + * systemtap.examples/profiling/topsys.meta: New. + * systemtap.examples/index.html: + * systemtap.examples/index.txt: + * systemtap.examples/keyword-index.html: + * systemtap.examples/keyword-index.txt: Regenerate. + +2009-02-02 Will Cohen <wcohen@redhat.com> + * systemtap.samples/tcp_connections.stp: Revised and moved to examples. * systemtap.examples/network/tcp_connections.stp: * systemtap.examples/network/tcp_connections.meta: New. diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index 3395edca..e02ab867 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -121,6 +121,9 @@ keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> <li><a href="profiling/timeout.stp">profiling/timeout.stp</a> - Show Processes Doing Polling Operations<br> keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> <p>The timeout.stp script is based on a blog entry (http://udrepper.livejournal.com/19041.html) mentioning a need for a tool to help developers find applications that are polling. The timeout.stp script monitors systemcall used for polling and records the systemcalls that timed out rather than returned because some action occurred. The script updates the screen once a second with the top twenty processes.</p></li> +<li><a href="profiling/topsys.stp">profiling/topsys.stp</a> - Show Processes Doing Polling Operations<br> +keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> +<p> The topsys.stp script lists out the top twenty systemcalls for the previous 5 seconds. The output is sorted from most frequent to least frequent.</p></li> </ul> </td> </tr> diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt index ddf24471..0076afaa 100644 --- a/testsuite/systemtap.examples/index.txt +++ b/testsuite/systemtap.examples/index.txt @@ -243,3 +243,11 @@ keywords: profiling top twenty processes. +profiling/topsys.stp - Show Processes Doing Polling Operations +keywords: profiling + + The topsys.stp script lists out the top twenty systemcalls for the + previous 5 seconds. The output is sorted from most frequent to least + frequent. + + diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index 6c367ad7..3156cc08 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -156,6 +156,9 @@ keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> <li><a href="profiling/timeout.stp">profiling/timeout.stp</a> - Show Processes Doing Polling Operations<br> keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> <p>The timeout.stp script is based on a blog entry (http://udrepper.livejournal.com/19041.html) mentioning a need for a tool to help developers find applications that are polling. The timeout.stp script monitors systemcall used for polling and records the systemcalls that timed out rather than returned because some action occurred. The script updates the screen once a second with the top twenty processes.</p></li> +<li><a href="profiling/topsys.stp">profiling/topsys.stp</a> - Show Processes Doing Polling Operations<br> +keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> +<p> The topsys.stp script lists out the top twenty systemcalls for the previous 5 seconds. The output is sorted from most frequent to least frequent.</p></li> </ul> <h3><a name="READ">READ</a></h3> <ul> diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt index 3cb0c3cf..a940ccfa 100644 --- a/testsuite/systemtap.examples/keyword-index.txt +++ b/testsuite/systemtap.examples/keyword-index.txt @@ -266,6 +266,14 @@ keywords: profiling top twenty processes. +profiling/topsys.stp - Show Processes Doing Polling Operations +keywords: profiling + + The topsys.stp script lists out the top twenty systemcalls for the + previous 5 seconds. The output is sorted from most frequent to least + frequent. + + = READ = io/iotime.stp - Trace Time Spent in Read and Write for Files diff --git a/testsuite/systemtap.examples/profiling/topsys.meta b/testsuite/systemtap.examples/profiling/topsys.meta new file mode 100644 index 00000000..3642713d --- /dev/null +++ b/testsuite/systemtap.examples/profiling/topsys.meta @@ -0,0 +1,13 @@ +title: Show Processes Doing Polling Operations +name: topsys.stp +version: 1.0 +author: anonymous +keywords: profiling +subsystem: kernel syscalls +status: production +exit: user-controlled +output: sorted-list +scope: system-wide +description: The topsys.stp script lists out the top twenty systemcalls for the previous 5 seconds. The output is sorted from most frequent to least frequent. +test_check: stap -p4 topsys.stp +test_installcheck: stap topsys.stp -c "sleep 1" diff --git a/testsuite/systemtap.examples/profiling/topsys.stp b/testsuite/systemtap.examples/profiling/topsys.stp new file mode 100644 index 00000000..34cf826c --- /dev/null +++ b/testsuite/systemtap.examples/profiling/topsys.stp @@ -0,0 +1,24 @@ +#! /usr/bin/env stap +# +# This script continuously lists the top 20 systemcalls in the interval +# 5 seconds +# + +global syscalls_count + +probe syscall.* { + syscalls_count[name]++ +} + +function print_systop () { + printf ("%25s %10s\n", "SYSCALL", "COUNT") + foreach (syscall in syscalls_count- limit 20) { + printf("%25s %10d\n", syscall, syscalls_count[syscall]) + } + delete syscalls_count +} + +probe timer.s(5) { + print_systop () + printf("--------------------------------------------------------------\n") +} diff --git a/testsuite/systemtap.samples/topsys.stp b/testsuite/systemtap.samples/topsys.stp deleted file mode 100644 index da31c858..00000000 --- a/testsuite/systemtap.samples/topsys.stp +++ /dev/null @@ -1,69 +0,0 @@ -#! stap -g -# -# This script continuously lists the top 20 systemcalls in the interval -# of 2000 jiffies. -# - -global syscalls_count, syscalls - -function syscall_name:string () %{ - char *str, buff[80]; - char *tok; - str = buff; - strlcpy(str, CONTEXT->probe_point, sizeof(buff)); - tok = strsep(&str, "\""); - tok = strsep(&str, "@"); - sprintf(str, "%-25s", tok); - strlcpy(THIS->__retvalue, str, MAXSTRINGLEN); -%} - -function reset_maxaction () %{ - if (CONTEXT && CONTEXT->actioncount) - CONTEXT->actioncount=0; -%} - -function accumulate () { - syscall=syscall_name() - syscalls_count[syscall]++ - # I use this array to refer to syscalls_count array in - # the reset_syscalls_count. Initalize with a non-zero. - syscalls[syscall]=1 -} - - -function print_top () { - lcnt=0 - reset_maxaction () - foreach ([syscall] in syscalls_count-) { - sys_cnt = syscalls_count[syscall] - log (syscall . "\t\t\t\t" . sprint(sys_cnt)) - if (lcnt++ == 20) - break; - } - syscalls_count[lsyscall]=0 -} - -function reset_syscalls_count () { - # For some reason, I have to do this to get pass the elaboration - # phase on RHEL4 (seg fault). Under FC4, it works fine with out - # the 'dummy_init' - syscalls["dummy_init"]=0 - foreach ([sys] in syscalls) - syscalls_count[sys]=0 -} - -function print_systop () { - log ("SYSCALL \t\t\t\tCOUNT") - print_top() - reset_syscalls_count () -} - -probe kernel.function("sys_*").call { - accumulate () -} - -probe timer.jiffies(2000) { - print_systop () - log("--------------------------------------------------------------") -} - |