summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@Serenity.local>2008-12-09 09:20:36 -0500
committerBjoern Brandenburg <bbb@Serenity.local>2008-12-09 09:20:36 -0500
commit2231847a582cc8cff3679aff63fcc97188ca8b7c (patch)
tree075d54c57afb5f61e8576f4bd57887da684d4f16
parent24f7b73819445cbf7e4856334e688293ffda301a (diff)
Started work on Documentation
-rw-r--r--doc/Makefile12
-rwxr-xr-xdoc/gen_html.sh46
-rw-r--r--doc/tracing.html80
-rw-r--r--doc/tracing.text62
4 files changed, 200 insertions, 0 deletions
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..ebe8c3a
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,12 @@
1SHELL=/bin/bash
2
3DOCS=tracing.html
4
5all: ${DOCS}
6
7clean:
8 rm -f ${DOCS}
9
10%.html: %.text
11 echo $$PWD
12 ./gen_html.sh $< > $@
diff --git a/doc/gen_html.sh b/doc/gen_html.sh
new file mode 100755
index 0000000..62d4490
--- /dev/null
+++ b/doc/gen_html.sh
@@ -0,0 +1,46 @@
1#!/bin/bash
2
3function die {
4 echo "Error:" $*
5 exit 1
6}
7
8TITLE=$2
9FILE=$1
10
11
12[ -z "$FILE" ] && die "File missing!"
13
14# extract title from file if missing
15[ -z "$TITLE" ] && TITLE=`sed -e '/^TITLE=\(.*\)/!d' -e 's/^TITLE=\(.*\)/\1/' $FILE`
16# if no title specified used file name
17[ -z "$TITLE" ] && TITLE=$FILE
18
19# check environment for markdown binary
20[ -z "$MARKDOWN" ] && MARKDOWN=markdown2
21
22cat <<EOF
23<?xml version="1.0" encoding="utf-8" ?>
24<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
25<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
26 <head>
27 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
28 <meta name="verify-v1" content="pZNmf5XyUUfAPdlSPbFSavMUsLgVsmBYOXzOhbIy2gw=" />
29 <link rel="stylesheet" type="text/css" href="../inc/format.css"/>
30 <title>$TITLE</title>
31 </head>
32 <body>
33EOF
34
35$MARKDOWN --extra code-friendly "$FILE"
36
37cat <<EOF
38<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
39</script>
40<script type="text/javascript">
41_uacct = "UA-3184628-1";
42urchinTracker();
43</script>
44</body>
45</html>
46EOF
diff --git a/doc/tracing.html b/doc/tracing.html
new file mode 100644
index 0000000..679457f
--- /dev/null
+++ b/doc/tracing.html
@@ -0,0 +1,80 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
6 <meta name="verify-v1" content="pZNmf5XyUUfAPdlSPbFSavMUsLgVsmBYOXzOhbIy2gw=" />
7 <link rel="stylesheet" type="text/css" href="../inc/format.css"/>
8 <title>Tracing with LITMUS^RT</title>
9 </head>
10 <body>
11<!--
12
13 Note: DO NOT EDIT THE HTML FILES!
14
15 The documentation is written using the markdown text markup
16 language. The .html files are generated from the .text files. If you
17 want to update the documentation you must edit the .text file and
18 re-generate the corresponding .html file.
19
20 See
21
22 http://code.google.com/p/python-markdown2/
23 and
24 http://daringfireball.net/projects/markdown/
25
26 for further information.
27
28-->
29
30<!--
31TITLE=Tracing with LITMUS^RT
32-->
33
34<h1>Tracing with LITMUS<sup>RT</sup></h1>
35
36<p>There are three kind of traces in LITMUS^RT:</p>
37
38<ol>
39<li><p>litmus_log: This trace contains text messages (created with the TRACE() macro) that convey information useful for debugging. Enabling this trace (at compile time) incurs high overheads. There is one global litmus_log buffer for the whole system.</p></li>
40<li><p>ft_trace: This trace contains binary-encoded time stamps. It is used for overhead tracing. There is one ft_trace buffer per processor. The "ft" stands for Feather-Trace.</p></li>
41<li><p>sched_trace: This trace contains binary-encoded scheduling event information, e.g., a task got scheduled, a job was released, a job completed, etc. There is one sched_trace buffer per processor.</p></li>
42</ol>
43
44<p>Currently, all three traces are exported through character device drivers. You can find out the major numbers for the drivers by looking at /proc/devices. Usually, the major numbers should be 251, 252, and 253 respectively.</p>
45
46<p>The per-processor buffers are accessible via the minor numbers of the drivers. Hence, you can create the trace devices as follows:</p>
47
48<p>---[snip]---
49 #!/bin/bash</p>
50
51<p>LITMUS_LOG_MAJOR=<code>grep litmus_log /proc/devices | awk '{print $1}'</code>
52 FT_TRACE_MAJOR=<code>grep ft_trace /proc/devices | awk '{print $1}'</code>
53 SCHED_TRACE_MAJOR=<code>grep sched_trace /proc/devices | awk '{print $1}'</code></p>
54
55<p>NUM_PROCS=$((<code>grep 'processor' /proc/cpuinfo | wc -l</code> - 1))</p>
56
57<p>mknod litmus_log c $LITMUS_LOG_MAJOR 0
58 for P in <code>seq 0 $NUM_PROCS</code>
59 do
60 mknod "ft_trace$P" c $FT_TRACE_MAJOR $P
61 mknod "sched_trace$P" c $SCHED_TRACE_MAJOR $P
62 done
63---[snap]---</p>
64
65<p>Alternatively, you can setup udev rules to create the devices on demand.</p>
66
67<p>The litmus_log buffer can be read by simply opening the file and reading its contents:</p>
68
69<pre><code>cat litmus_log &gt; my_debug_log
70</code></pre>
71
72<p>The other files only produce output after events have been enabled. I yet have to release the tool to enable events, but hope to do so later today.</p>
73<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
74</script>
75<script type="text/javascript">
76_uacct = "UA-3184628-1";
77urchinTracker();
78</script>
79</body>
80</html>
diff --git a/doc/tracing.text b/doc/tracing.text
new file mode 100644
index 0000000..ecd641a
--- /dev/null
+++ b/doc/tracing.text
@@ -0,0 +1,62 @@
1<!--
2
3 Note: DO NOT EDIT THE HTML FILES!
4
5 The documentation is written using the markdown text markup
6 language. The .html files are generated from the .text files. If you
7 want to update the documentation you must edit the .text file and
8 re-generate the corresponding .html file.
9
10 See
11
12 http://code.google.com/p/python-markdown2/
13 and
14 http://daringfireball.net/projects/markdown/
15
16 for further information.
17
18-->
19
20<!--
21TITLE=Tracing with LITMUS^RT
22-->
23
24Tracing with LITMUS<sup>RT</sup>
25================================
26
27There are three kind of traces in LITMUS^RT:
28
291. litmus_log: This trace contains text messages (created with the TRACE() macro) that convey information useful for debugging. Enabling this trace (at compile time) incurs high overheads. There is one global litmus_log buffer for the whole system.
30
312. ft_trace: This trace contains binary-encoded time stamps. It is used for overhead tracing. There is one ft_trace buffer per processor. The "ft" stands for Feather-Trace.
32
333. sched_trace: This trace contains binary-encoded scheduling event information, e.g., a task got scheduled, a job was released, a job completed, etc. There is one sched_trace buffer per processor.
34
35Currently, all three traces are exported through character device drivers. You can find out the major numbers for the drivers by looking at /proc/devices. Usually, the major numbers should be 251, 252, and 253 respectively.
36
37The per-processor buffers are accessible via the minor numbers of the drivers. Hence, you can create the trace devices as follows:
38
39---[snip]---
40 #!/bin/bash
41
42 LITMUS_LOG_MAJOR=`grep litmus_log /proc/devices | awk '{print $1}'`
43 FT_TRACE_MAJOR=`grep ft_trace /proc/devices | awk '{print $1}'`
44 SCHED_TRACE_MAJOR=`grep sched_trace /proc/devices | awk '{print $1}'`
45
46 NUM_PROCS=$((`grep 'processor' /proc/cpuinfo | wc -l` - 1))
47
48 mknod litmus_log c $LITMUS_LOG_MAJOR 0
49 for P in `seq 0 $NUM_PROCS`
50 do
51 mknod "ft_trace$P" c $FT_TRACE_MAJOR $P
52 mknod "sched_trace$P" c $SCHED_TRACE_MAJOR $P
53 done
54---[snap]---
55
56Alternatively, you can setup udev rules to create the devices on demand.
57
58The litmus_log buffer can be read by simply opening the file and reading its contents:
59
60 cat litmus_log > my_debug_log
61
62The other files only produce output after events have been enabled. I yet have to release the tool to enable events, but hope to do so later today.