From 82f426c231754da7c58ddbeca29c3e36baa0b291 Mon Sep 17 00:00:00 2001 From: ddomingo Date: Mon, 8 Sep 2008 14:29:23 +1000 Subject: added content for Ch1 and 2, to add more later --- .../en-US/Introduction.xml | 33 ++++++++++++++---- .../en-US/SystemTap_Beginners_Guide.ent | 3 +- .../en-US/Understanding_How_SystemTap_Works.xml | 40 ++++++++++++++++++++-- 3 files changed, 66 insertions(+), 10 deletions(-) (limited to 'doc/SystemTap_Beginners_Guide/en-US') diff --git a/doc/SystemTap_Beginners_Guide/en-US/Introduction.xml b/doc/SystemTap_Beginners_Guide/en-US/Introduction.xml index 9285d0ae..f60ab2f3 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Introduction.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Introduction.xml @@ -5,15 +5,36 @@ Introduction - A short introduction on SystemTap_Beginners_Guide + SystemTap is a tracing and probing tool that provides users deep technical insight into what the operating system (particularly, the kernel) is doing at any given time. It provides information similar to the output of tools like netstat, ps, top, and iostat; however, SystemTap is designed to provide information that is more "granular" in nature. - + + For system administrators, SystemTap can be used as a performance monitoring tool for ∏. It is most useful when other similar tools cannot precisely pinpoint a bottleneck in the system, requiring a deep analysis of kernel activity. In the same manner, application developers can also use SystemTap to monitor, in finer detail, how their application behaves. + + + +
Goals - TBD - + The goal of SystemTap is to provide infrastructure to monitor the running Linux kernel for detailed analysis. This can assist in identifying the underlying cause of a performance or functional problem. + + Without SystemTap, monitoring the activity of a running kernel would require a tedious instrument, recompile, install, and reboot sequence. SystemTap is designed to eliminate this, allowing you to gather the same information by simply running its suite of tools against specific tapsets or SystemTap scripts. + + However, SystemTap was initially designed for users with intermediate to advanced knowledge of the kernel. This could present a steep learning curve for administrators or developers whose knowledge of the Linux kernel is little to none. + + In line with that, the main goal of the SystemTap Beginner's Guide is two-fold: + + + To introduce users to SystemTap, familiarize them with its architecture, and provide setup instructions for all kernel types. + + To provide pre-written SystemTap scripts for monitoring and forensic tasks, along with instructions on how to analyze their output. + + above, Short description on the underlying goals of SystemTap_Beginners_Guide, what we want to teach users. - +
Usage @@ -25,7 +46,7 @@
SystemTap Versus Other Monitoring Tools - Short summary; when is SystemTap suitable vs other popular monitoring tools (e.g. top, Oprofile, /proc) + ** Short summary; when is SystemTap suitable vs other popular monitoring tools (e.g. top, Oprofile, /proc) diff --git a/doc/SystemTap_Beginners_Guide/en-US/SystemTap_Beginners_Guide.ent b/doc/SystemTap_Beginners_Guide/en-US/SystemTap_Beginners_Guide.ent index 46bb6c06..994cf1a4 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/SystemTap_Beginners_Guide.ent +++ b/doc/SystemTap_Beginners_Guide/en-US/SystemTap_Beginners_Guide.ent @@ -1,3 +1,4 @@ - \ No newline at end of file + + \ No newline at end of file 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 b3a1cbed..3194dba0 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 @@ -8,18 +8,52 @@ Short summary; probes, handlers, events + SystemTap allows users to write and reuse simple scripts to deeply examine the activities of a running Linux system. These scripts can be designed to extract data, filter it, and summarize it quickly (and safely), enabling the diagnosis of complex performance (or even functional) problems. + + The essential idea behind a SystemTap script is to name events, and to give them handlers. When SystemTap runs the script, SystemTap monitors for the event; once the event occurs, the Linux kernel then runs the handler as a quick sub-routine, then resumes. + + There are several kind of events; entering/exiting a function, timer 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. +
Architecture - add diagram, describe architecture, enumerate common tools + ** add diagram, describe architecture, enumerate common tools -
+ + + ** architecture diagram must be simpler, if at all included + + + + ** add design advantages? e.g. "building kmods on-the-fly allows safer execution of script etc etc" + + + + test + + + A SystemTap session begins when you run a SystemTap script. This session occurs in the following fashion: + + + SystemTap Session + SystemTap first translates the script to C, running the system C compiler to create a kernel module from it. + + SystemTap then loads the module, then enables all the probed events by "hooking" those events into the kernel. + + As the events occur, their corresponding handlers are executed. + + Once the SystemTap session is terminated, the hooked events are disconnected from the kernel; afterwards, the kernel module is unloaded. + + +This sequence is driver from a single command-line program: stap. This program is SystemTap's main front-end tool. For more information about stap, refer to man stap (once SystemTap is set up on your machine). + +
SystemTap Scripts - definition, significance, structure, very basic examples, reference to later chapter (how to read library of preset SystemTap scripts in this book, using them) + ** definition, significance, structure, very basic examples, reference to later chapter (how to read library of preset SystemTap scripts in this book, using them)
-- cgit From e36b5fc35d4033d5718eb8e101968b79d0360202 Mon Sep 17 00:00:00 2001 From: ddomingo Date: Mon, 8 Sep 2008 14:42:17 +1000 Subject: remove test tag --- .../en-US/Understanding_How_SystemTap_Works.xml | 4 ---- 1 file changed, 4 deletions(-) (limited to 'doc/SystemTap_Beginners_Guide/en-US') 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 3194dba0..e418f561 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 @@ -26,10 +26,6 @@ ** add design advantages? e.g. "building kmods on-the-fly allows safer execution of script etc etc" - - - - test A SystemTap session begins when you run a SystemTap script. This session occurs in the following fashion: -- cgit From a5e2a4c92910faf6ef6a2f84b6b58a85dece300c Mon Sep 17 00:00:00 2001 From: ddomingo Date: Tue, 9 Sep 2008 09:23:21 +1000 Subject: separated Scripts, edited accordingly --- doc/SystemTap_Beginners_Guide/en-US/Scripts.xml | 46 ++++++++++++++++++++++ .../en-US/Understanding_How_SystemTap_Works.xml | 7 ++-- 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 doc/SystemTap_Beginners_Guide/en-US/Scripts.xml (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 new file mode 100644 index 00000000..abb087bc --- /dev/null +++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml @@ -0,0 +1,46 @@ + + + +
+ SystemTap Scripts + + + For the most part, SystemTap scripts are the foundation of each SystemTap session. The SystemTap scripts you use or write yourself instruct SystemTap on what type of information to trap, and what to do once that information is trapped. + + + + As stated in , SystemTap scripts are made up of two components: events and handlers. Once a SystemTap session is underway, SystemTap monitors the operating system for the specified events and executes the handlers as they occur. + + + + Note + An event and its corresponding handler is collectively called a probe. A SystemTap script can have multiple probes, in the same manner that each event can have multiple corresponding handlers. + + + + In terms of application development, using events and handlers is similar to inserting print statements in a program's sequence of commands. These print statements allow you to view a history of commands executed once the program is run. + + + + SystemTap scripts go one step further by allowing you more flexibility with regard to handlers. Events serve as the triggers for handlers to run; handlers can be specified to trap specified data and print it in a certain manner. + + + + +
+ Format + + SystemTap scripts use the following format: + +
+ + + +
+ 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 e418f561..de5d41b0 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 @@ -41,10 +41,11 @@ Once the SystemTap session is terminated, the hooked events are disconnected from the kernel; afterwards, the kernel module is unloaded. -This sequence is driver from a single command-line program: stap. This program is SystemTap's main front-end tool. For more information about stap, refer to man stap (once SystemTap is set up on your machine). +This sequence is driven from a single command-line program: stap. This program is SystemTap's main front-end tool. For more information about stap, refer to man stap (once SystemTap is set up on your machine).
- + +
Tapsets -- cgit