summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-01-12 20:05:33 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-01-12 20:05:33 -0500
commit3123c38b81426c07b8a95428d5c1d8c3b188964e (patch)
treeb7fc9a3d151d9e7ae3dc1af4b595f6e0cbd63ca4
parent56e036e4a7ea5d858c22aaf0683aa905c20d5104 (diff)
update tracing doc for 2011.1
-rw-r--r--doc/tracing.html38
-rw-r--r--doc/tracing.txt36
2 files changed, 24 insertions, 50 deletions
diff --git a/doc/tracing.html b/doc/tracing.html
index 6a54b62..3513bb4 100644
--- a/doc/tracing.html
+++ b/doc/tracing.html
@@ -11,9 +11,9 @@
11<!-- 11<!--
12 Note: DO NOT EDIT THE HTML FILES! 12 Note: DO NOT EDIT THE HTML FILES!
13 13
14 The documentation is written using the markdown. The .html files are 14 The documentation is written using markdown. The .html files are
15 generated from the .text files. If you want to update the 15 generated from the .text files. If you want to update the
16 documentation you must edit the .text file and re-generate the 16 documentation you must edit the .txt file and re-generate the
17 corresponding .html file by executing make. 17 corresponding .html file by executing make.
18 18
19 See 19 See
@@ -27,7 +27,7 @@
27 Note: PLEASE UPDATE THE CHANGE HISTORY AT THE END OF THE FILE WHEN YOU 27 Note: PLEASE UPDATE THE CHANGE HISTORY AT THE END OF THE FILE WHEN YOU
28 UPDATE THIS FILE. 28 UPDATE THIS FILE.
29 29
30# The following line is picked up bye the gen_html script. 30# The following line is picked up by the gen_html script.
31TITLE=Tracing with LITMUS^RT 31TITLE=Tracing with LITMUS^RT
32--> 32-->
33 33
@@ -37,7 +37,7 @@ TITLE=Tracing with LITMUS^RT
37This document is part of the documentation of the <a href="../index.html">LITMUS<sup>RT</sup> project</a>. 37This document is part of the documentation of the <a href="../index.html">LITMUS<sup>RT</sup> project</a>.
38</div> 38</div>
39 39
40<p>As of version 2010.2, there are three tracing mechanisms available in LITMUS<sup>RT</sup>:</p> 40<p>As of version 2011.1, there are three tracing mechanisms available in LITMUS<sup>RT</sup>:</p>
41 41
42<ol> 42<ol>
43<li><p><code>litmus_log</code>: This trace contains text messages (created with the <code>TRACE()</code> 43<li><p><code>litmus_log</code>: This trace contains text messages (created with the <code>TRACE()</code>
@@ -49,28 +49,15 @@ macro, see <code>litmus.h</code>) that convey information useful for debugging.
49 49
50<h2>Accessing Trace Buffers</h2> 50<h2>Accessing Trace Buffers</h2>
51 51
52<p><code>litmus_log</code> functionality is provided through the kernel's <code>misc</code> driver interface. As a result, <code>litmus_log</code> is automatically made available through <code>/dev/litmus/log</code> on systems with default udev rules.</p> 52<p><code>litmus_log</code> functionality is provided through the kernel's <code>misc</code> driver interface. The other two traces are exported to user space through standard character device drivers.</p>
53 53
54<p>The other two traces are exported to user space through standard character device drivers. The major numbers allocated by the drivers can be discovered by looking at <code>/proc/devices</code>. Usually, the major numbers are 252 and 253, respectively. The per-processor buffers are accessible via the minor numbers of the <code>sched_trace</code> driver.</p> 54<p>On systems with default udev rules, the devices are created in the <code>/dev/litmus/</code> directory:</p>
55 55
56<p>Thus, device files for <code>ft_trace</code> and <code>sched_trace</code> can be created with the following script.</p> 56<ul>
57 57<li>The <code>litmus_log</code> trace is exported as <code>/dev/litmus/log</code>.</li>
58<pre><code>#!/bin/bash 58<li>The <code>ft_trace</code> trace is exported as <code>/dev/litmus/ft_trace0</code>.</li>
59 59<li>The <code>sched_trace</code> traces are exported as <code>/dev/litmus/sched_trace0</code>, <code>/dev/litmus/sched_trace1</code>, etc. </li>
60FT_TRACE_MAJOR=`grep ft_trace /proc/devices | awk '{print $1}'` 60</ul>
61SCHED_TRACE_MAJOR=`grep sched_trace /proc/devices | awk '{print $1}'`
62
63mknod ft_trace c $FT_TRACE_MAJOR 0
64
65NUM_PROCS=$((`grep 'processor' /proc/cpuinfo | wc -l` - 1))
66
67for P in `seq 0 $NUM_PROCS`
68do
69 mknod "sched_trace$P" c $SCHED_TRACE_MAJOR $P
70done
71</code></pre>
72
73<p>Alternatively, one can setup <code>udev</code> rules to create the devices on demand. This, however, is beyond the scope of this document.</p>
74 61
75<h2>Recording Debug Traces</h2> 62<h2>Recording Debug Traces</h2>
76 63
@@ -185,7 +172,7 @@ Disabling 9 events.
185 172
186<p><strong>Hint</strong>: The dummy real-time task <code>rtspin</code> (distributed as part of the <code>liblitmus</code> package) may be useful when studying/testing the behavior of a scheduler plugin.</p> 173<p><strong>Hint</strong>: The dummy real-time task <code>rtspin</code> (distributed as part of the <code>liblitmus</code> package) may be useful when studying/testing the behavior of a scheduler plugin.</p>
187 174
188<p>Recorded scheduling traces can be analyzed with <a href="http://cs.unc.edu/~mollison/unit-trace">Unit-Trace</a>. Alternatively, the user space library and tools package <code>liblitmus</code> contains the necessary headers to write <code>sched_trace</code> post-processing and analysis tools (see <code>include/sched_trace.h</code> and <code>src/sched_trace.c</code>).</p> 175<p>Recorded scheduling traces can be analyzed with <a href="http://cs.unc.edu/~mollison/unit-trace">Unit-Trace</a>.</p>
189 176
190<h2>Concluding Remarks</h2> 177<h2>Concluding Remarks</h2>
191 178
@@ -196,6 +183,7 @@ Disabling 9 events.
196<ul> 183<ul>
197<li>Initially written by <a href="http://www.cs.unc.edu/~bbb">Bjoern B. Brandenburg</a> (bbb at cs.unc.edu) on 12/09/2008.</li> 184<li>Initially written by <a href="http://www.cs.unc.edu/~bbb">Bjoern B. Brandenburg</a> (bbb at cs.unc.edu) on 12/09/2008.</li>
198<li>Updated for LITMUS<sup>RT</sup> version 2010.2 by <a href="http://www.cs.unc.edu/~mollison">Mac Mollison</a> (mollison at cs.unc.edu) on 11/08/2010.</li> 185<li>Updated for LITMUS<sup>RT</sup> version 2010.2 by <a href="http://www.cs.unc.edu/~mollison">Mac Mollison</a> (mollison at cs.unc.edu) on 11/08/2010.</li>
186<li>Updated for LITMUS<sup>RT</sup> version 2011.1 by <a href="http://www.cs.unc.edu/~bbb">Bjoern B. Brandenburg</a> (bbb at cs.unc.edu) on 01/12/2011. </li>
199</ul> 187</ul>
200<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> 188<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
201</script> 189</script>
diff --git a/doc/tracing.txt b/doc/tracing.txt
index 80d14b0..106ec04 100644
--- a/doc/tracing.txt
+++ b/doc/tracing.txt
@@ -1,9 +1,9 @@
1<!-- 1<!--
2 Note: DO NOT EDIT THE HTML FILES! 2 Note: DO NOT EDIT THE HTML FILES!
3 3
4 The documentation is written using the markdown. The .html files are 4 The documentation is written using markdown. The .html files are
5 generated from the .text files. If you want to update the 5 generated from the .text files. If you want to update the
6 documentation you must edit the .text file and re-generate the 6 documentation you must edit the .txt file and re-generate the
7 corresponding .html file by executing make. 7 corresponding .html file by executing make.
8 8
9 See 9 See
@@ -17,7 +17,7 @@
17 Note: PLEASE UPDATE THE CHANGE HISTORY AT THE END OF THE FILE WHEN YOU 17 Note: PLEASE UPDATE THE CHANGE HISTORY AT THE END OF THE FILE WHEN YOU
18 UPDATE THIS FILE. 18 UPDATE THIS FILE.
19 19
20# The following line is picked up bye the gen_html script. 20# The following line is picked up by the gen_html script.
21TITLE=Tracing with LITMUS^RT 21TITLE=Tracing with LITMUS^RT
22--> 22-->
23 23
@@ -28,7 +28,7 @@ Tracing with LITMUS<sup>RT</sup>
28This document is part of the documentation of the <a href="../index.html">LITMUS<sup>RT</sup> project</a>. 28This document is part of the documentation of the <a href="../index.html">LITMUS<sup>RT</sup> project</a>.
29</div> 29</div>
30 30
31As of version 2010.2, there are three tracing mechanisms available in LITMUS<sup>RT</sup>: 31As of version 2011.1, there are three tracing mechanisms available in LITMUS<sup>RT</sup>:
32 32
331. `litmus_log`: This trace contains text messages (created with the `TRACE()` 331. `litmus_log`: This trace contains text messages (created with the `TRACE()`
34macro, see `litmus.h`) that convey information useful for debugging. There is one global 34macro, see `litmus.h`) that convey information useful for debugging. There is one global
@@ -41,27 +41,13 @@ macro, see `litmus.h`) that convey information useful for debugging. There is on
41Accessing Trace Buffers 41Accessing Trace Buffers
42----------------------- 42-----------------------
43 43
44`litmus_log` functionality is provided through the kernel's `misc` driver interface. As a result, `litmus_log` is automatically made available through `/dev/litmus/log` on systems with default udev rules. 44`litmus_log` functionality is provided through the kernel's `misc` driver interface. The other two traces are exported to user space through standard character device drivers.
45 45
46The other two traces are exported to user space through standard character device drivers. The major numbers allocated by the drivers can be discovered by looking at `/proc/devices`. Usually, the major numbers are 252 and 253, respectively. The per-processor buffers are accessible via the minor numbers of the `sched_trace` driver. 46On systems with default udev rules, the devices are created in the `/dev/litmus/` directory:
47 47
48Thus, device files for `ft_trace` and `sched_trace` can be created with the following script. 48- The `litmus_log` trace is exported as `/dev/litmus/log`.
49 49- The `ft_trace` trace is exported as `/dev/litmus/ft_trace0`.
50 #!/bin/bash 50- The `sched_trace` traces are exported as `/dev/litmus/sched_trace0`, `/dev/litmus/sched_trace1`, etc.
51
52 FT_TRACE_MAJOR=`grep ft_trace /proc/devices | awk '{print $1}'`
53 SCHED_TRACE_MAJOR=`grep sched_trace /proc/devices | awk '{print $1}'`
54
55 mknod ft_trace c $FT_TRACE_MAJOR 0
56
57 NUM_PROCS=$((`grep 'processor' /proc/cpuinfo | wc -l` - 1))
58
59 for P in `seq 0 $NUM_PROCS`
60 do
61 mknod "sched_trace$P" c $SCHED_TRACE_MAJOR $P
62 done
63
64Alternatively, one can setup `udev` rules to create the devices on demand. This, however, is beyond the scope of this document.
65 51
66Recording Debug Traces 52Recording Debug Traces
67---------------------- 53----------------------
@@ -171,7 +157,7 @@ Note that `st_trace` may have to be modified to change the default `sched_trace`
171 157
172**Hint**: The dummy real-time task `rtspin` (distributed as part of the `liblitmus` package) may be useful when studying/testing the behavior of a scheduler plugin. 158**Hint**: The dummy real-time task `rtspin` (distributed as part of the `liblitmus` package) may be useful when studying/testing the behavior of a scheduler plugin.
173 159
174Recorded scheduling traces can be analyzed with [Unit-Trace](http://cs.unc.edu/~mollison/unit-trace). Alternatively, the user space library and tools package `liblitmus` contains the necessary headers to write `sched_trace` post-processing and analysis tools (see `include/sched_trace.h` and `src/sched_trace.c`). 160Recorded scheduling traces can be analyzed with [Unit-Trace](http://cs.unc.edu/~mollison/unit-trace).
175 161
176Concluding Remarks 162Concluding Remarks
177------------------ 163------------------
@@ -182,4 +168,4 @@ Change History
182-------------- 168--------------
183- Initially written by <a href="http://www.cs.unc.edu/~bbb">Bjoern B. Brandenburg</a> (bbb at cs.unc.edu) on 12/09/2008. 169- Initially written by <a href="http://www.cs.unc.edu/~bbb">Bjoern B. Brandenburg</a> (bbb at cs.unc.edu) on 12/09/2008.
184- Updated for LITMUS<sup>RT</sup> version 2010.2 by <a href="http://www.cs.unc.edu/~mollison">Mac Mollison</a> (mollison at cs.unc.edu) on 11/08/2010. 170- Updated for LITMUS<sup>RT</sup> version 2010.2 by <a href="http://www.cs.unc.edu/~mollison">Mac Mollison</a> (mollison at cs.unc.edu) on 11/08/2010.
185 171- Updated for LITMUS<sup>RT</sup> version 2011.1 by <a href="http://www.cs.unc.edu/~bbb">Bjoern B. Brandenburg</a> (bbb at cs.unc.edu) on 01/12/2011.