manual: add sections
[ust.git] / doc / manual / manual.texinfo
index 53eae017e9e1e939d8c6b6faa6d574909ac1ab28..702d0492f8af015d8105375d3f2606b76799eeeb 100644 (file)
@@ -64,14 +64,19 @@ The LTTng Userspace Tracer is intended to be linkable to open source software
 as well as to proprietary applications. This was accomplished by licensing
 the code that needs to be linked to the traced program as @acronym{LGPL}.
 
-The @file{libust} library, including its headers, are licensed as @acronym{GNU}
-@acronym{LGPL} v2.1. It is also the case of some other helper libraries
-(@file{libmallocwrap}, @file{libinterfork}, @file{libustcomm}) that need to be linked to the traced
-program.
+Components licensed as LGPL v2.1:
+@itemize @bullet
+@item libust
+@item libinterfork
+@item libustcomm
+@end itemize
 
-The accompanying tools of the @acronym{UST} package are licensed as
-@acronym{GNU} @acronym{GPL} v2. These tools include the @file{ustctl} trace
-control program and the @file{ustd} daemon.
+Components licensed as GPL v2:
+@itemize @bullet
+@item ustctl
+@item libustcmd
+@item ustd
+@end itemize
 
 @node Supported platforms
 @section Supported platforms
@@ -381,7 +386,7 @@ $ ustctl --list-markers 1234
 # A column indicates 0 for an inactive marker and 1 for an active marker.
 
 # Enable a marker
-$ ustctl --enable-marker 1234 ust/mymark
+$ ustctl --enable-marker ust/mymark 1234
 
 # Create a trace
 $ ustctl --create-trace 1234
@@ -427,23 +432,51 @@ daemon even after the termination of the traced process.
 @node Tracing across @code{fork()} and @code{clone()}
 @section Tracing across @code{fork()} and @code{clone()}
 
-Tracing across @code{clone()} when @code{CLONE_VM} is specified is supported
-without any particular action.
+Tracing across @code{clone()} when the @code{CLONE_VM} flag is specified is
+supported without any particular action.
 
 When @code{clone()} is called without @code{CLONE_VM} or @code{fork()} is
 called, a new address space is created and the tracer must be notified to
-create new buffers for it. @strong{TODO: specify how to do it.}
+create new buffers for it.
+
+This can be done automatically, by @env{LD_PRELOAD}'ing @file{libinterfork.so}.
+This library intercepts calls to @code{fork()} and informs the tracer it is
+being called. When using @command{usttrace}, this is accomplied by specifying
+the @option{-f} command line argument.
+
+Alternatively, the program can call @code{ust_before_fork()} before calling
+@code{fork()} or @code{clone()} with @code{CLONE_VM}. After the call,
+@code{ust_after_fork_parent()} must be called in the parent process and
+@code{ust_after_fork_child()} must be called in the child process.
 
-This can be done automatically (for @code{fork()} only for now), by
-@env{LD_PRELOAD}'ing @file{libinterfork.so}. This library intercepts calls to
-@code{fork()} and informs the tracer it is being called. When using
-@command{usttrace}, this is accomplied by specifying the @option{-f} command
-line argument.
 
 @node Tracing programs and libraries that were not linked to libust
 @section Tracing programs and libraries that were not linked to libust
 
-Todo.
+Some programs need to be traced even though they were not linked to libust
+either because they were not instrumented or because it was not practical.
+
+An executable that is not instrumented can still yield interesting traces when
+at least one of its dynamic libraries is instrumented. It is also possible to
+trace certain function calls by intercepting them with a specially crafted
+library that is linked with @env{LD_PRELOAD} at program start.
+
+In any case, a program that was not linked to libust at compile time must be
+linked to it at run time with @env{LD_PRELOAD}. This can be accomplished with
+@command{usttrace}'s @option{-l} option. It can also be done by setting the
+@env{LD_PRELOAD} environment variable on the command line. For example:
+
+@example
+@verbatim
+# Run ls with usttrace, LD_PRELOAD'ing libust
+# (assuming one of the libraries used by ls is instrumented).
+$ usttrace -l ls
+
+# Run ls, manually adding the LD_PRELOAD.
+$ LD_PRELOAD=/usr/local/lib/libust.so.0 ls
+@end verbatim
+@end example
+
 
 @node Performance
 @chapter Performance
@@ -453,4 +486,31 @@ Todo.
 @node Viewing traces
 @chapter Viewing traces
 
+Traces may be viewed with LTTV. An example of command for launching LTTV is
+given in the quickstart.
+
+@menu
+* Viewing multiple traces::
+* Combined kernel-userspace tracing::
+@end menu
+
+@node Viewing multiple traces
+@section Viewing multiple traces
+
+When tracing multi-process applications or several applications simultaneously,
+more than one trace will be obtained. LTTV can open and display all these
+traces simultaneously.
+
+@node Combined kernel-userspace tracing
+@section Combined kernel-userspace tracing
+
+In addition to multiple userspace traces, LTTV can open a kernel trace recorded
+with the LTTng kernel tracer. This provides events that enable the rendering of
+the Control Flow View and the Resource View.
+
+When doing so, it is necessary to use the same time source for the kernel
+tracer as well as the userspace tracer. Currently, the recommended method is to
+use the timestamp counter for both. The TSC can however only be used on architectures
+where it is synchronized across cores.
+
 @bye
This page took 0.023714 seconds and 4 git commands to generate.