From cffd1e12179857f6fc50d848c7ecc35742aca75e Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 15 Dec 2008 14:29:30 -0500 Subject: Minor edits and format corrections. --- doc/SystemTap_Beginners_Guide/en-US/Scripts.xml | 138 ++++++++++----------- .../en-US/Understanding_How_SystemTap_Works.xml | 2 +- 2 files changed, 70 insertions(+), 70 deletions(-) (limited to 'doc/SystemTap_Beginners_Guide') diff --git a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml index fe2e69f4..bb71625e 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml @@ -129,7 +129,7 @@ SystemTap scripts use the file extension .stp, and - are conatains probes written in the following format: + contains probes written in the following format: @@ -555,21 +555,21 @@ probe timer.s(4) Consider the following sample script: - helloworld.stp - - probe begin - { - printf ("hello world\n") - exit () - } - - +helloworld.stp + +probe begin +{ + printf ("hello world\n") + exit () +} + + In , the event begin (i.e. the start of the session) triggers the handler enclosed in { }, which simply prints hello - world, then exits. + world followed by a new-line, then exits. @@ -666,15 +666,15 @@ probe timer.s(4) To illustrate this, consider the following probe example: - - variables-in-printf-statements.stp - - probe syscall.open - { - printf ("%s(%d) open\n", execname(), pid()) - } - - + +variables-in-printf-statements.stp + +probe syscall.open +{ + printf ("%s(%d) open\n", execname(), pid()) +} + + instructs SystemTap to probe all entries to @@ -688,16 +688,16 @@ probe timer.s(4) to "argument1", "format specifier2" is to "argument2", or is this clear enough? - - vmware-guestd(2206) open - hald(2360) open - hald(2360) open - hald(2360) open - df(3433) open - df(3433) open - df(3433) open - hald(2360) open - + +vmware-guestd(2206) open +hald(2360) open +hald(2360) open +hald(2360) open +df(3433) open +df(3433) open +df(3433) open +hald(2360) open + SystemTap Functions @@ -945,42 +945,42 @@ probe timer.s(4) thread_indent(): - thread_indent.stp - - probe kernel.function("*@net/socket.c") - { - printf ("%s -> %s\n", thread_indent(1), probefunc()) - } - probe kernel.function("*@net/socket.c").return - { - printf ("%s <- %s\n", thread_indent(-1), probefunc()) - } - - +thread_indent.stp + +probe kernel.function("*@net/socket.c") +{ + printf ("%s -> %s\n", thread_indent(1), probefunc()) +} +probe kernel.function("*@net/socket.c").return +{ + printf ("%s <- %s\n", thread_indent(-1), probefunc()) +} + + prints out the thread_indent() and probe functions at each event in the following format: - - 0 ftp(7223): -> sys_socketcall - 1159 ftp(7223): -> sys_socket - 2173 ftp(7223): -> __sock_create - 2286 ftp(7223): -> sock_alloc_inode - 2737 ftp(7223): <- sock_alloc_inode - 3349 ftp(7223): -> sock_alloc - 3389 ftp(7223): <- sock_alloc - 3417 ftp(7223): <- __sock_create - 4117 ftp(7223): -> sock_create - 4160 ftp(7223): <- sock_create - 4301 ftp(7223): -> sock_map_fd - 4644 ftp(7223): -> sock_map_file - 4699 ftp(7223): <- sock_map_file - 4715 ftp(7223): <- sock_map_fd - 4732 ftp(7223): <- sys_socket - 4775 ftp(7223): <- sys_socketcall - + +0 ftp(7223): -> sys_socketcall +1159 ftp(7223): -> sys_socket +2173 ftp(7223): -> __sock_create +2286 ftp(7223): -> sock_alloc_inode +2737 ftp(7223): <- sock_alloc_inode +3349 ftp(7223): -> sock_alloc +3389 ftp(7223): <- sock_alloc +3417 ftp(7223): <- __sock_create +4117 ftp(7223): -> sock_create +4160 ftp(7223): <- sock_create +4301 ftp(7223): -> sock_map_fd +4644 ftp(7223): -> sock_map_file +4699 ftp(7223): <- sock_map_file +4715 ftp(7223): <- sock_map_fd +4732 ftp(7223): <- sys_socket +4775 ftp(7223): <- sys_socketcall + This sample output contains the following information: @@ -1073,15 +1073,15 @@ probe timer.s(4) to it. For example: - - targetexample.stp - - probe syscall.* { - if (pid() == target()) - printf("%s/n", name) - } - - + +targetexample.stp + +probe syscall.* { + if (pid() == target()) + printf("%s/n", name) +} + + When is run with the argument diff --git a/doc/SystemTap_Beginners_Guide/en-US/Understanding_How_SystemTap_Works.xml b/doc/SystemTap_Beginners_Guide/en-US/Understanding_How_SystemTap_Works.xml index 4e61e247..d9fe6ab4 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Understanding_How_SystemTap_Works.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Understanding_How_SystemTap_Works.xml @@ -53,7 +53,7 @@ expiration, session termination, etc. A handler is a series of script language statements that specify the work to be done whenever the event occurs. This work normally includes extracting data from the event context, - storing them into internal variables, or printing results. + storing them into internal variables, and printing results.
-- cgit