(no commit message)
[openafs-wiki.git] / debugging.mdwn
index 4d55dff..5301179 100644 (file)
@@ -25,10 +25,33 @@ displays only threads which are not in this boring rx_GetCall (threads are waiti
 
 ## Debugging Clients
 
+### unix client tracing with fstrace
+
+Low-level debugging of a client can be done using "fstrace".  The analysis of
+the "fstrace" output requires detailed knowledge of cache manager internals.
+"fstrace" logs to an internal memory based ring buffer, which can be dumped to
+a file for analysis.
+
+To capture a trace, set the ring buffer size, enable the tracing to the buffer,
+run your tests, then dump the buffer. The following example creates a 1 Mb buffer:
+
+    fstrace setlog -buffersize 1024
+    fstrace setset -active
+    fstrace clear
+
+    -- do your tests --
+
+    fstrace dump -file /tmp/fstrace.out
+
+
+To disable the tracing when you are done:
+
+    fstrace setset -inactive
+
+
 ### intermittent issues
 
-Low-level debugging of a client can be done using "fstrace". <br/>
-Unfortunately, this produces a lot of output, so it is not easy to catch an intermittent error-condition with "fstrace".
+Unfortunately, "fstrace" produces a lot of output, so it is may not be easy to catch an intermittent error-condition.
 
 The attached script [[ClientTracing.py]] (presently for Unix only) gives you the opportunity to continuously run a fstrace, <br/>
 where the output is stored in rotating log-files. 
@@ -39,4 +62,4 @@ Thus, all you need to do is to write a script which creates this predefined file
 
 ### defined issue
 
-When you exactly know how to reproduce the issue, or you don't want to install python on your client, you can use the attached script [[ClientTracing.bat]] (for Windows only). It is setting up the client tracing, starting up a tshark (terminal-version of wireshark) and waits for you to tell it to stop tracing. In order to synchronize the timestamps of the wireshark log and the afsd-trace-log, a "dir \\AFS\openafs.org" is issued on startup. The logfiles are copied to a predefined directory. The script itself should be self-explanatory.]
+When you exactly know how to reproduce the issue, or you don't want to install python on your client, you can use the attached script [[ClientTracing.bat]] (for Windows only). It is setting up the client tracing, starting up a tshark (terminal-version of wireshark) and waits for you to tell it to stop tracing. In order to synchronize the timestamps of the wireshark log and the afsd-trace-log, a "dir \\\\AFS\grand.central.org" is issued on startup. The logfiles are copied to a predefined directory. The script itself should be self-explanatory.]