From ccae4f38c9107f56b99bfc19ed01cea03d370576 Mon Sep 17 00:00:00 2001 From: ddomingo Date: Thu, 12 Feb 2009 11:36:55 +1000 Subject: added topsys.stp to examples (profiling) --- .../en-US/Useful_Scripts-timeout.xml | 23 ++-- .../en-US/Useful_Scripts-topsys.xml | 131 +++++++++++++++++++++ .../en-US/Useful_SystemTap_Scripts.xml | 1 + 3 files changed, 143 insertions(+), 12 deletions(-) create mode 100644 doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-topsys.xml (limited to 'doc/SystemTap_Beginners_Guide/en-US') diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-timeout.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-timeout.xml index 32ce8319..719f5c6d 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-timeout.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-timeout.xml @@ -67,10 +67,11 @@ uses systemtap/testsuite/systemtap.examples/profiling/timeout.stp - In some applications, these system calls are used excessively. For example, an application that - needs to perform a task once every hour could be configured (or even designed) to check the - clock every second if the hour has already passed. Such design idioms are throwbacks to earlier - kernel versions, which used a periodic tick. + In some applications, these system calls are used excessively. As such, they are normally identified as "likely + culprits" for polling applications. Note, however, that an application may be using a different system + call to poll excessively; sometimes, it is useful to find out the top system calls used by the system (refer to + for instructions). Doing so can help you identify any additional suspects, which you + can add to for tracking. @@ -88,13 +89,6 @@ uses systemtap/testsuite/systemtap.examples/profiling/timeout.stp timer.s(), sample usage examples of SystemTap scripts - - - You can increase the sample time by editing the timer in the second probe (timer.s()). - The output of contains the name and UID of the top 20 polling applications, - along with how many times each application performed each polling system call (over time). - contains an excerpt of the script: - <xref linkend="timeouts"/> Sample Output @@ -132,6 +126,11 @@ foreach (fn+ in called) # Sort by function name printf("%s %d\n", fn, @count(called[fn])) exit() }--> - + + You can increase the sample time by editing the timer in the second probe (timer.s()). + The output of contains the name and UID of the top 20 polling applications, + along with how many times each application performed each polling system call (over time). + contains an excerpt of the script: + diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-topsys.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-topsys.xml new file mode 100644 index 00000000..700ef4ed --- /dev/null +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-topsys.xml @@ -0,0 +1,131 @@ + + + + +
+Tracking Most Frequently Used System Calls + +script examples +monitoring system calls + + + +examples of SystemTap scripts +monitoring system calls + + + +monitoring system calls +examples of SystemTap scripts + + + + + +system calls, monitoring +examples of SystemTap scripts + + + +uses systemtap/testsuite/systemtap.examples/profiling/topsys.stp + + + + + from helps you identify which applications + are polling by pointing out which ones used the following system calls most frequently: + + + + poll + select + epoll + itimer + futex + nanosleep + signal + + + + However, in some systems, a different system call might be responsible for excessive polling. If you suspect + that a polling application might is using a different system call to poll, you need to identify first the top + system calls used by the system. To do this, use . + + + + topsys.stp + + + + + + + + + lists the top 20 system calls used by the system per 5-second interval. It also lists + how many times each system call was used during that period. Refer to for a sample output. + + + +script examples +timer.s(), sample usage + + + +examples of SystemTap scripts +timer.s(), sample usage + + + +timer.s(), sample usage +examples of SystemTap scripts + + + + + <xref linkend="topsys"/> Sample Output + +-------------------------------------------------------------- + SYSCALL COUNT + gettimeofday 1857 + read 1821 + ioctl 1568 + poll 1033 + close 638 + open 503 + select 455 + write 391 + writev 335 + futex 303 + recvmsg 251 + socket 137 + clock_gettime 124 + rt_sigprocmask 121 + sendto 120 + setitimer 106 + stat 90 + time 81 + sigreturn 72 + fstat 66 +-------------------------------------------------------------- + + + + +
+ diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml index ed089361..c2c83a82 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml @@ -63,6 +63,7 @@ + -- cgit