From be7fd6299b45a46c9dc56bd6bd2ddb5b0afd9362 Mon Sep 17 00:00:00 2001 From: ddomingo Date: Fri, 28 Nov 2008 09:47:00 +1000 Subject: more indexes --- doc/SystemTap_Beginners_Guide/en-US/Scripts.xml | 12 ++++ .../en-US/Useful_Scripts-functioncalls.xml | 41 ++++++++++- .../en-US/Useful_Scripts-futexes.xml | 63 ++++++++++++++++- .../en-US/Useful_Scripts-inodewatch.xml | 79 +++++++++++++++++++++- .../en-US/Useful_Scripts-inodewatch2.xml | 27 +++++++- .../en-US/Useful_Scripts-nettop.xml | 42 +++++++++++- .../en-US/Useful_Scripts-sockettrace.xml | 42 +++++++++++- .../en-US/Useful_Scripts-threadtimes.xml | 41 ++++++++++- .../en-US/Useful_Scripts-traceio2.xml | 6 +- 9 files changed, 338 insertions(+), 15 deletions(-) (limited to 'doc/SystemTap_Beginners_Guide/en-US') diff --git a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml index 233dc069..e6ffc4ef 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml @@ -957,6 +957,18 @@ probe kernel.function("*@net/socket.c").return 4775 ftp(7223): <- sys_socketcall +This sample output contains the following information: + + + The time delta (in microseconds) since the previous entry; i.e. the number of microseconds since the last traced function call. + + The process name (and its corresponding ID) that made the function call. + + An arrow signifying whether the call was an entry (<-) or an exit (->); the indentations help you match specific function call entries with their corresponding exits. + + The name of the function called by the process. + + remember to add a reference later to "tapsets" from here, to clarify that thread_indent is defined in tapsets as a special function of sorts diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-functioncalls.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-functioncalls.xml index bcab2c47..6a5c8f4d 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-functioncalls.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-functioncalls.xml @@ -5,8 +5,33 @@
Counting Function Calls Made + +script examples +tallying function calls + + + +examples of SystemTap scripts +tallying function calls + + + +tallying function calls +examples of SystemTap scripts + - + + +counting function calls +examples of SystemTap scripts + + + +function calls, tallying +examples of SystemTap scripts + + + WAR STORY: Function call count http://sourceware.org/systemtap/wiki/WSFunctionCallCount?highlight=((WarStories)) @@ -28,6 +53,20 @@ no script in examples takes the targeted kernel function as an argument. The argument supports wildcards, which enables you to target multiple kernel functions up to a certain extent. + +script examples +timer.ms(), sample usage + + + +examples of SystemTap scripts +timer.ms(), sample usage + + + +timer.ms(), sample usage +examples of SystemTap scripts + You can increase the sample time by editing the timer in the second probe (timer.ms()). The output of contains the name of the function called and how many times it was called during the sample time (in alphabetical order). contains an excerpt from the output of stap countcalls.stp "*@mm/*.c": diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-futexes.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-futexes.xml index 34e51076..82bb762b 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-futexes.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-futexes.xml @@ -6,7 +6,28 @@
Identifying Contended User-Space Locks + +script examples +identifying contended user-space locks (i.e. futex contentions) + + + +examples of SystemTap scripts +identifying contended user-space locks (i.e. futex contentions) + + + +identifying contended user-space locks (i.e. futex contentions) +examples of SystemTap scripts + + + contended user-space locks (futex contentions), identifying + examples of SystemTap scripts + + + + WAR STORY: Futex contention http://sourceware.org/systemtap/wiki/WSFutexContention?highlight=((WarStories)) @@ -16,9 +37,49 @@ no script in examples - This section describes how to identify contended user-space locks throughout the system within a specific time period. The ability to identify contended user-space locks can help you investigate hangs that you suspect may be caused by futex contentions. + This section describes how to identify contended user-space locks throughout the system within a specific time period. The ability to identify contended user-space locks can help you investigate hangs that you suspect may be caused by futex contentions. + + futex contentions, identifying + examples of SystemTap scripts + + + + futex contention, definition + examples of SystemTap scripts + + + +script examples +process deadlocks (arising from futex contentions) + + + +examples of SystemTap scripts +process deadlocks (arising from futex contentions) + + + +process deadlocks (arising from futex contentions) +examples of SystemTap scripts + Simply put, a futex contention occurs when multiple processes are trying to access the same region of memory. In some cases, this can result in a deadlock between the processes in contention, thereby appearing as an application hang. + + + +script examples +futex system call + + + +examples of SystemTap scripts +futex system call + + + +futex system call +examples of SystemTap scripts + To do this, probes the futex system call. diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch.xml index e747771b..098524ae 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch.xml @@ -6,7 +6,36 @@
Monitoring Reads and Writes to a File - + +script examples +monitoring reads and writes to a file + + + +examples of SystemTap scripts +monitoring reads and writes to a file + + + +monitoring reads and writes to a file +examples of SystemTap scripts + + + +file reads/writes, monitoring +examples of SystemTap scripts + + + + reads/writes to a file, monitoring + examples of SystemTap scripts + + + + writes/reads to a file, monitoring + examples of SystemTap scripts + + WAR STORY: monitoring inode activity http://sourceware.org/systemtap/wiki/WSFileMonitor?highlight=((WarStories)) @@ -31,13 +60,45 @@ no script in examples takes the following information about the file as an argument: + + script examples + file device number (integer format) + + + + examples of SystemTap scripts + file device number (integer format) + + + + file device number (integer format) + examples of SystemTap scripts + + + + device number of a file (integer format) + examples of SystemTap scripts + The file's device number, in integer format. When this is passed to the script as the first argument, be sure to replace any 0 with a space. The file's inode number. - + + script examples + stat -c, determining file device number (integer format) + + + + examples of SystemTap scripts + stat -c, determining file device number (integer format) + + + + stat -c, determining file device number (integer format) + examples of SystemTap scripts + To get this information, use stat -c '%D %i' filename, where filename is an absolute path. For instance: if you wish to monitor /etc/crontab, run stat -c '%D %i' /etc/crontab first. This gives the following output: @@ -45,6 +106,20 @@ no script in examples 805 1078319 + + script examples + inode number + + + + examples of SystemTap scripts + inode number + + + + inode number + examples of SystemTap scripts + 805 is the device number, while 1078319 is the inode number. To start monitoring /etc/crontab, run stap inodewatch.stp 8 5 1078319. diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch2.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch2.xml index 04b8f1c8..0cc04dba 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch2.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch2.xml @@ -6,7 +6,32 @@
Monitoring Changes to File Attributes - + +script examples +monitoring changes to file attributes + + + +examples of SystemTap scripts +monitoring changes to file attributes + + + +monitoring changes to file attributes +examples of SystemTap scripts + + + + changes to file attributes, monitoring + examples of SystemTap scripts + + + + file attributes, monitoring changes to + examples of SystemTap scripts + + + WAR STORY: monitoring more inode activity http://sourceware.org/systemtap/wiki/WSFileMonitor2?highlight=((WarStories)) diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-nettop.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-nettop.xml index 7e01a1f8..c51d4b66 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-nettop.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-nettop.xml @@ -5,7 +5,20 @@
Network Profiling - + +script examples +network profiling + + + +examples of SystemTap scripts +network profiling + + + +network profiling +examples of SystemTap scripts + WAR STORY: Top network users by PID http://sourceware.org/systemtap/wiki/WSNetTop?highlight=((WarStories)) @@ -15,6 +28,15 @@ probably http://sourceware.org/systemtap/examples/network/nettop.stp + +profiling the network +examples of SystemTap scripts + + + +network traffic, monitoring +examples of SystemTap scripts + This section describes how to profile network activity. provides a glimpse into how much network traffic each process is generating on a machine. @@ -25,8 +47,22 @@ - - + + + + script examples + if/else conditionals, alternative syntax + + + + examples of SystemTap scripts + if/else conditionals, alternative syntax + + + + if/else conditionals, alternative syntax + examples of SystemTap scripts + Note that function print_activity() uses the following constructs: diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-sockettrace.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-sockettrace.xml index 85694faf..9a9e1c55 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-sockettrace.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-sockettrace.xml @@ -5,13 +5,46 @@
Tracing Functions Called in Network Socket Code - - + +script examples +tracing functions called in network socket code + + + +examples of SystemTap scripts +tracing functions called in network socket code + + + +tracing functions called in network socket code +examples of SystemTap scripts + + + network socket code, tracing functions called in + examples of SystemTap scripts + + + functions called in network socket code, tracing + examples of SystemTap scripts + http://sourceware.org/systemtap/examples/network/socket-trace.stp + + script examples + net/socket.c, tracing functions from + + + examples of SystemTap scripts + net/socket.c, tracing functions from + + + + net/socket.c, tracing functions from + examples of SystemTap scripts + This section describes how to trace functions called from the kernel's net/socket.c file. This task helps you identify, in finer detail, how each process interacts with the network at the kernel level. @@ -51,6 +84,9 @@ + contains a 3-second excerpt of the output for . For more information about the output of this script as provided by thread_indent(), refer to . + + script examples -stat -c +stat -c, determining whole device number examples of SystemTap scripts -stat -c +stat -c, determining whole device number -stat -c +stat -c, determining whole device number examples of SystemTap scripts -- cgit