update
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 6 Mar 2006 18:46:48 +0000 (18:46 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 6 Mar 2006 18:46:48 +0000 (18:46 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1589 04897980-b3bd-0310-b5e0-8ef037075253

usertrace-generic/README

index f466cf47f52465d51f3ed4a1ec08fe0b6fd7a5f4..b8c23018bc2f66fed0d23b0ae5ae52cf1aa33fce 100644 (file)
@@ -14,11 +14,11 @@ x86
 will work magically)
 
 * Compile your kernel with the latest LTTng patch. Make sure the option 
-       "Allow tracing from userspace" is _active_!
-       See the QUICKSTART guide at http://ltt.polymtl.ca/ for details about how to
-       setup a working tracer and viewer. See the genevent installation step : it is
-       required for method #2 below.
-       
+  "Allow tracing from userspace" is _active_!
+  See the QUICKSTART guide at http://ltt.polymtl.ca/ for details about how to
+  setup a working tracer and viewer. See the genevent installation step : it is
+  required for method #2 below.
+  
 * Extract the latest usertrace-generic archive :
 su
 cd /usr/src
@@ -34,10 +34,10 @@ make install
 * There are two ways to trace information from your application :
 
 1) Easy way, but slow (printf style)
-       See sample-printf.c for code example.
+  See sample-printf.c for code example.
 
 - Add the following statements to your program source (the define must come
-       _before_ the includes!) :
+  _before_ the includes!) :
 
 #define LTT_TRACE
 #define LTT_BLOCKING 1
@@ -49,26 +49,26 @@ application will block. The default of this parameter is 0 (non blocking) :
 events are lost when trace buffer is full. The choice is up to you.
 
 - Add something like the following sample line in your code. Note that this is a
-       very standard format string, this is only a suggested presentation.
-       
+  very standard format string, this is only a suggested presentation.
+  
 trace_user_generic_slow_printf("in: %s at: %s:%d: Counter value is: %u.",
                                __FILE__, __func__, __LINE__, count);
 
 - Compile your application with at least these parameters to gcc (it is splitted
-       on two lines, joined by a "\") :
+  on two lines, joined by a "\") :
 gcc -D LTT_SHOW_DEBUG -I /usr/src/usertrace-generic -o myapp myapp.c \
   /usr/src/usertrace-generic/ltt-facility-loader-user_generic.c
 
 To see what the final result looks like :
 - Start tracing
 - Start your application
-       ** You should see the following message when your program starts and the
-       LTT_SHOW_DEBUG is defined : 
-               "LTT : ltt-facility-user_generic init in userspace"
-               If you don't then you forgot to compile the facility loader in your
-               application. If you find this output annoying, you can remove the
-               "-D LTT_SHOW_DEBUG" gcc parameter, which will make the facility loader
-               silent.
+  ** You should see the following message when your program starts and the
+  LTT_SHOW_DEBUG is defined : 
+    "LTT : ltt-facility-user_generic init in userspace"
+    If you don't then you forgot to compile the facility loader in your
+    application. If you find this output annoying, you can remove the
+    "-D LTT_SHOW_DEBUG" gcc parameter, which will make the facility loader
+    silent.
 - Stop tracing
 Then, to see only the user_generic events :
 lttv -m textDump -t /tmp/trace1 -e "event.facility=user_generic"
@@ -83,7 +83,7 @@ user_generic.slow_printf: 35886.925685289 (/cpu_0), 15521, 7453,  SYSCALL { "in:
 2) The second way to log events is still easy, yet faster. It requires creating
    your own XML description of your data structures. It will make it easier to
    identify your data in the trace. Please read the comments in method 1)
-        explained previously, as they are not repeated here.
+   explained previously, as they are not repeated here.
    See sample.c for code example.
 
 - Go to the usertrace-generic directory
@@ -92,28 +92,28 @@ cd /usr/src/usertrace-generic
 
 - Create your own facility (i.e. user_myfacility.xml).
   See the ones available in /usr/share/LinuxTraceToolkitViewer/facilities for
-       examples.
-       You facility _must_ be named following this standard : "user_*", where * is
-       whatever you like. If it is not, it will be rejected by the kernel with a
-       Operation not permitted (can be seen with the -D LTT_SHOW_DEBUG compilation
-       parameter).
+  examples.
+  You facility _must_ be named following this standard : "user_*", where * is
+  whatever you like. If it is not, it will be rejected by the kernel with a
+  Operation not permitted (can be seen with the -D LTT_SHOW_DEBUG compilation
+  parameter).
 
 user_myfacility.xml:
 
 <facility name="user_myfacility">
-       <description>Sample facility</description>
-       <event name="myevent">
-               <description>Sample event</description>
-               <field name="file"><string></field>
-               <field name="function"><string></field>
-               <field name="line"><int></field>
-               <field name="firstval"><long></field>
-               <field name="secondval"><pointer></field>
-       </event>
+  <description>Sample facility</description>
+  <event name="myevent">
+    <description>Sample event</description>
+    <field name="file"><string></field>
+    <field name="function"><string></field>
+    <field name="line"><int></field>
+    <field name="firstval"><long></field>
+    <field name="secondval"><pointer></field>
+  </event>
 </facility>
 
 - AN IMPORTANT STEP FOLLOWS :
-       *copy* the user_myfacility.xml file in your system :
+  *copy* the user_myfacility.xml file in your system :
 su
 cp user_myfacility.xml /usr/share/LinuxTraceToolkitViewer/facilities
 
@@ -123,7 +123,7 @@ cd /tmp
 mkdir genevent
 cd genevent
 for a in /usr/share/LinuxTraceToolkitViewer/facilities/user_*.xml;
-       do /usr/local/bin/genevent $a;
+  do /usr/local/bin/genevent $a;
 done
 cd /usr/src/usertrace-generic
 cp /tmp/genevent/*load* .
@@ -134,19 +134,19 @@ cd ..
 make install
 
 - Add the following statements to your program source (the define must come
-       _before_ the includes!) :
+  _before_ the includes!) :
 
 #define LTT_TRACE
 #define LTT_BLOCKING 1
 #include <ltt/ltt-facility-user_myfacility.h>
 
 - Add a call following the trace_user_myfacility_myevent function found in 
-       /usr/include/ltt/ltt-facility-user_myfacility.h in your program.
+  /usr/include/ltt/ltt-facility-user_myfacility.h in your program.
 For instance :
 trace_user_myfacility_myevent(__FILE__, __func__, __LINE__, 1234, (void*)0xF0F0F0F0);
 
 - Compile your application with at least these parameters to gcc (it is splitted
-       on two lines, joined by a "\") :
+  on two lines, joined by a "\") :
 gcc -I /usr/src/usertrace-generic -o myapp myapp.c \
   /usr/src/usertrace-generic/ltt-facility-loader-user_myfacility.c
 
This page took 0.027434 seconds and 4 git commands to generate.