diff options
author | Mac Mollison <mollison@cs.unc.edu> | 2010-03-27 19:56:12 -0400 |
---|---|---|
committer | Mac Mollison <mollison@cs.unc.edu> | 2010-03-27 19:56:12 -0400 |
commit | 15743fd8cfff5b90a18b24c90d40a6adcd6bd314 (patch) | |
tree | fe79f6680d496cb1a344b23bc860a99ac84eab6a | |
parent | 0a7886a1faf7c5d0fa18dd3c81a067ad8c7b9c2d (diff) |
Brought documentation up to date
-rw-r--r-- | doc/header.html | 4 | ||||
-rw-r--r-- | doc/index.txt | 172 |
2 files changed, 105 insertions, 71 deletions
diff --git a/doc/header.html b/doc/header.html index 58dc0da..b53a7a3 100644 --- a/doc/header.html +++ b/doc/header.html | |||
@@ -23,6 +23,10 @@ | |||
23 | margin-top: 50px; | 23 | margin-top: 50px; |
24 | text-align: center; | 24 | text-align: center; |
25 | } | 25 | } |
26 | h3 { | ||
27 | margin-top: 30px; | ||
28 | text-align: center; | ||
29 | } | ||
26 | codeblock { | 30 | codeblock { |
27 | padding: 0px 15px; | 31 | padding: 0px 15px; |
28 | margin: 5px 0 15px; | 32 | margin: 5px 0 15px; |
diff --git a/doc/index.txt b/doc/index.txt index 78551c9..69aa971 100644 --- a/doc/index.txt +++ b/doc/index.txt | |||
@@ -13,100 +13,129 @@ information about scheduler behavior. | |||
13 | This document contains instructions for people who want to use and/or contribute to Unit-Trace. | 13 | This document contains instructions for people who want to use and/or contribute to Unit-Trace. |
14 | It is the complete documentation for Unit-Trace. | 14 | It is the complete documentation for Unit-Trace. |
15 | 15 | ||
16 | ## Architecture ## | ||
17 | Before trying to use Unit-Trace, it will help to understand the architecture of Unit-Trace. | ||
18 | |||
19 | Unit-Trace performs various options on **trace files**. Oftentimes, when scheduler tracing takes | ||
20 | place, multiple trace files are generated for each experiment (e.g. one per CPU). We call a | ||
21 | related group of trace files a **trace**. | ||
22 | |||
23 | The user interacts with the tool using `unit-trace`, a Python script which is to be installed | ||
24 | on the local executable path. | ||
25 | `unit-trace` invokes operations provided by the `unit_trace` Python module, which is installed | ||
26 | in the local `site_packages` directory (the default install location for Python modules). | ||
27 | |||
28 | The `unit_trace` module provides submodule(s) for parsing trace files into a **stream** of Python objects (which we call **records**). | ||
29 | This stream is then passed from one `unit_trace` submodule to the next (like a pipe), undergoing | ||
30 | various transformations in the process, and ultimately arriving at one or more output submodules. | ||
31 | Intermediate modules generally add records; for example, the `gedf_test` module adds records to indicate | ||
32 | priority inversions, which can be treated appropriately by output submodules. | ||
33 | |||
34 | This architecture provides a clean and easy-to-use interface for both users and contributors. | ||
35 | The stream is implemented using Python iterators. | ||
36 | This allows records are evaluated lazily (i.e. on an as-needed basis), making it possible to pull into memory only | ||
37 | the records that are needed, and only as long as they are needed. | ||
38 | This is important for dealing with very large traces. | ||
39 | |||
40 | ## Obtaining Unit-Trace ## | 16 | ## Obtaining Unit-Trace ## |
41 | Members of UNC's Real-Time Group can obtain Unit-Trace using: | 17 | Members of UNC's Real-Time Group can obtain Unit-Trace using:<br> |
42 | <codeblock>git clone ssh://cvs.cs.unc.edu/cvs/proj/litmus/repo/unit-trace.git</codeblock> | 18 | <codeblock>git clone ssh://cvs.cs.unc.edu/cvs/proj/litmus/repo/unit-trace.git</codeblock> |
43 | 19 | ||
44 | ## Installing Unit-Trace ## | 20 | ## Installing Unit-Trace ## |
45 | Unit-Trace is based on Python 2.6, so make sure that is available on your system. | 21 | Unit-Trace is based on Python 2.6, so make sure that is available on your system. |
46 | 22 | ||
47 | Unit-Trace can be installed manually by copying the `unit-trace` script and `unit_trace` Python module, as described previously. | 23 | Unit_Trace consists of a Python module called `unit_trace` (encapsulated in the `unit_trace` directory) and a font-end script called `unit-trace`. |
48 | Alternatively, you can use `sudo install.py` to (re)install Unit-Trace. | 24 | |
25 | You can use `install.py` to install unit-trace, or install manually by copying the `unit-trace` script and the `unit_trace` directory | ||
26 | to `~/bin`. | ||
27 | |||
28 | Make sure `~/bin` is on your `PATH`. | ||
49 | 29 | ||
50 | ## Using Unit-Trace ## | 30 | ## Using Unit-Trace ## |
51 | Type `unit-trace` (without options) to view usage information. | 31 | Command line usage:<br> |
52 | 32 | <codeblock>unit-trace <one or more trace files> [flags]</codeblock>. | |
53 | In summary, trace files must be specified. | 33 | |
54 | Flags are used to enable any desired submodules. | 34 | Each flag turns on or off a unit-trace submodule. The available submodules are |
55 | Some flags have accompanying parameter(s) that are passed to the submodule. | 35 | given below. |
56 | The order in which submodules process records is pre-determined by the `unit-trace` script, | 36 | |
57 | so the user can specify flags on the command line in any order. | 37 | You can specify module flags in any order. |
58 | 38 | ||
59 | ## Example/Use Case ## | 39 | For a quick usage reference (including a list of modules), type `unit-trace` on the command line, without any arguments. |
60 | Suppose that Alice wants to perform G-EDF testing on the LITMUS<sup>RT</sup> traces included in the sample_traces/ folder. | 40 | |
61 | 41 | ### Example Use Case ### | |
62 | The LITMUS<sup>RT</sup> tracing mechanism outputs superfluous events at the beginning of the trace that will not appear "correct" for | 42 | Let's assume you're in a directory with a bunch of trace files with |
63 | G-EDF testing (for example, multiple job releases that never complete, indicating the initialization of a task). | 43 | the extension `.bin`. |
64 | Alice uses the following command to print out (-o) the first 50 records (-m 50), looking for the end of the bogus records: | 44 | (Each trace file is assumed to be the trace of a single CPU, and all trace files in the directory are from the same experimental run.) |
65 | <codeblock>unit-trace -m 50 -o *.bin</codeblock>. | 45 | |
66 | 46 | Suppose you want to get a list of the 10 longest priority inversions in a LITMUS<sup>RT</sup>trace. | |
67 | Seeing that she hasn't yet reached useful records, she uses the following command to print out (-o) 50 records (-m 50), skipping the | 47 | Use the following command:<br> |
68 | first 50 (-s 50). | 48 | <codeblock>unit-trace *.bin -c -g -i 10</codeblock>. |
69 | <codeblock>unit-trace -m 50 -s 50 -o *.bin</codeblock>. | 49 | |
70 | She is able to see that meaningful releases begin at time `37917282934190`. | 50 | Now, suppose you want to visualize one of those priority inversions. |
71 | 51 | Given in the output for each one are the event IDs at the beginning and end of the priority inversion. | |
72 | She now commences G-EDF testing (-g), starting at the time of interest (-e <earliest time>). | 52 | Use the following command:<br> |
73 | Because of the lengthy output to be expected, she redirects to standard out. | 53 | <codeblock>unit-trace *.bin -e <the first event ID> -l <the second event ID> -v</codeblock>. |
74 | She also uses the -c option to clean up additional records that are known to be erroneous, and | 54 | |
75 | will break the G-EDF tester. | 55 | Note that if the visualizer stops at the second specified event (which it will), it will not be able to render anything that happens after that. |
76 | <codeblock>unit-trace -c -e 37917282934190 -g -o *.bin > output</codeblock>. | 56 | Since you're probably interested in what happened after the priority inversion ended (for at least a little while), you should probably specify |
77 | 57 | a slightly later second event ID (e.g. 100 greater than the actual ending event ID). | |
78 | OK, everything worked. Alice can now grep through the output file and see priority inversions. | 58 | |
79 | She sees a particularly long priority inversion, and decides to generate a visualization (-v) of part of the schedule. | 59 | Now, suppose you want to see specific textual output for all events. (You could also specify a range if you wanted to.)<br> |
80 | <codeblock>unit-trace -c -e 37918340000000 -l 37919000000000 -v *.bin</codeblock>. | 60 | <codeblock>unit-trace *.bin -o > output</codeblock> |
81 | (NOTE: Currently, this still shows the entire schedule, which likely won't be feasible for larger traces and is a bug.) | 61 | |
82 | 62 | This example provides a basic overview of what you can do with Unit-Trace. Detailed information about all available submodules is provided in | |
83 | ## Submodules ## | 63 | the next section. |
64 | |||
65 | ## List of Submodules ## | ||
66 | |||
67 | There are five basic kinds of submodules. | ||
68 | |||
69 | - Input submodules, which read trace files | ||
70 | - Filter submodules, which filter out event records | ||
71 | - Test submodules, which perform some kind of test | ||
72 | - Output modules, which display the results | ||
73 | - Miscellaneous | ||
74 | |||
75 | All submodules are listed and summarized in the tables below. | ||
76 | Some submodules have further documentation, appearing later in this document. | ||
77 | |||
84 | ### Input Submodules ### | 78 | ### Input Submodules ### |
85 | <table border=1> | 79 | <table border=1> |
86 | <tr><td>Name</td><td>Flag</td><td>Options</td><td>Description</td></tr> | 80 | <tr><td>Name</td><td>Flag</td><td>Parameters</td><td>Description</td></tr> |
87 | <tr><td>trace_parser</td><td>(on by default)</td><td>(None)</td><td>Parses LITMUS<sup>RT</sup> traces</td></tr> | 81 | <tr><td>trace_parser</td><td>(on by default)</td><td>(None)</td><td>Parses LITMUS<sup>RT</sup> traces</td></tr> |
88 | </table> | 82 | </table> |
89 | ### Intermediate Submodules ### | 83 | ### Filter Submodules ### |
90 | <table border=1> | 84 | <table border=1> |
91 | <tr><td>Name</td><td>Flag</td><td>Options</td><td>Description</td></tr> | 85 | <tr><td>Name</td><td>Flag</td><td>Parameters</td><td>Description</td></tr> |
92 | <tr><td>earliest</td><td>-e</td><td>time</td><td>Filters out records before the given time</td></tr> | 86 | <tr><td>earliest</td><td>-e</td><td>time</td><td>Filters out records before the given event ID. (Event IDs are assigned in order of event record timestamp, and are displayed by the `stdio_printer` submodule.)</td></tr> |
93 | <tr><td>latest</td><td>-l</td><td>time</td><td>Filters out records after the given time</td></tr> | 87 | <tr><td>latest</td><td>-l</td><td>time</td><td>Filters out records after the given event ID.</td></tr> |
94 | <tr><td>skipper</td><td>-s</td><td>number n</td><td>Skips the first n records</td></tr> | 88 | <tr><td>skipper</td><td>-s</td><td>number n</td><td>Skips the first n records</td></tr> |
95 | <tr><td>maxer</td><td>-m</td><td>number n</td><td>Allows at most n records to be parsed</td></tr> | 89 | <tr><td>maxer</td><td>-m</td><td>number n</td><td>Allows at most n records to be parsed</td></tr> |
96 | <tr><td>sanitizer</td><td>-c</td><td>(None)</td><td>Cleans up LITMUS<sup>RT</sup> traces for G-EDF testing.</td></tr> | 90 | <tr><td>sanitizer</td><td>-c</td><td>(None)</td><td>Modifies LITMUS<sup>RT</sup> traces. To be used in conjunction with the G-EDF tester. To summarize, LITMUS<sup>RT</sup> traces have some bogus records that need to be removed or altered in order for a (potentially) valid schedule to be represented.</td></tr> |
97 | <tr><td>progress</td><td>-p</td><td>(None)</td><td>Outputs progress info (e.g number of records parsed so far, total time to process trace) to std error.</td></tr> | 91 | </table> |
98 | <tr><td>stats</td><td>-i</td><td>(None)</td><td>Outputs statistics about G-EDF inversions. To be deprecated (incorporated into G-EDF tester).</td></tr> | 92 | ### Test Submodules ### |
93 | <table border=1> | ||
94 | <tr><td>Name</td><td>Flag</td><td>Options</td><td>Description</td></tr> | ||
99 | <tr><td>gedf_test</td><td>-g</td><td>(None)</td><td>Performs G-EDF testing.</td></tr> | 95 | <tr><td>gedf_test</td><td>-g</td><td>(None)</td><td>Performs G-EDF testing.</td></tr> |
100 | </table> | 96 | </table> |
101 | ### Output Submodules ### | 97 | ### Output Submodules ### |
102 | <table border=1> | 98 | <table border=1> |
103 | <tr><td>Name</td><td>Flag</td><td>Options</td><td>Description</td></tr> | 99 | <tr><td>Name</td><td>Flag</td><td>Options</td><td>Description</td></tr> |
104 | <tr><td>stdout_printer</td><td>-o</td><td>(None)</td><td>Prints records to standard out</td></tr> | 100 | <tr><td>stdout_printer</td><td>-o</td><td>(None)</td><td>Prints records to standard out. You should probably redirect the output to a file when you use this.</td></tr> |
105 | <tr><td>visualizer</td><td>-v</td><td>(None)</td><td>Visualizes records</td></tr> | 101 | <tr><td>visualizer</td><td>-v</td><td>(None)</td><td>Visualizes records. You should probably use filters in conjunction with this submodule. Otherwise, it'll take forever to render, and do you _really_ want to visualize the _entire_ trace, anyway?</td></tr> |
102 | <tr><td>gedf_inversion_stat_printer</td><td>-i</td><td>number n</td><td>Outputs statistics about G-EDF inversions, and the n longest inversions. (You can specify n as 0 if you want.)</td></tr> | ||
106 | </table> | 103 | </table> |
104 | ### Miscellaneous Submodules ### | ||
105 | <table border=1> | ||
106 | <tr><td>Name</td><td>Flag</td><td>Options</td><td>Description</td></tr> | ||
107 | <tr><td>progress</td><td>-p</td><td>(None)</td><td>Outputs progress info (e.g number of records parsed so far, total time to process trace) to std error.</td></tr> | ||
108 | </table> | ||
109 | |||
110 | ## Specific Submodule Documentation ## | ||
111 | |||
112 | Here, documentation is provided for submodules for which relevant information is not considered to be self-evident. | ||
113 | |||
114 | (So far, it hasn't been necessary to add anything here, but once questions arise, it will become clear which submodules need to be documented more fully.) | ||
107 | 115 | ||
108 | ## Development ## | 116 | ## Development ## |
109 | TODO: Information on how to contribute will be documented thoroughly here. | 117 | Please send patches to [Mac Mollison][mac] or, if you are in the `litmus` group at UNC, just work with the git repo directly. |
118 | |||
119 | The following "rules" are currently in place: | ||
120 | |||
121 | - Please follow PEP 8 style guidelines when possible. | ||
122 | - Update the documentation when you do something that makes it obsolete or incomplete | ||
123 | - Don't break the overall architecture (described below) | ||
124 | |||
125 | ### Architecture ### | ||
126 | If you are interested in contributing to Unit-Trace, you probably ought to know a bit about its overall architecture. | ||
127 | |||
128 | Generally speaking, each Unit-Trace submodules is a Python generator. It accepts a Python iterator object as input and returns a Python iterator | ||
129 | object as output. (You may want to look up the relevant Python terminology.) | ||
130 | |||
131 | The exceptions are input submodules, which do not take any input other than a list of trace files, and the output submodules, which do not return | ||
132 | iterator objects. | ||
133 | |||
134 | The `unit-trace` script connects together the desired modules (i.e. those specified on the command line) using Python iterators. | ||
135 | |||
136 | This architecture provides two advantages. | ||
137 | First, because Python iterators are evaluated lazily, it is not necessary to read an entire trace file into memory in order to run `unit-trace` on it. | ||
138 | Second, it provides an easy-to-understand programming model. | ||
110 | 139 | ||
111 | ## Documentation ## | 140 | ## Documentation ## |
112 | The source code for this page is included in the `doc` folder that comes with Unit-Trace. | 141 | The source code for this page is included in the `doc` folder that comes with Unit-Trace. |
@@ -130,3 +159,4 @@ We hope to have additional contributors in the future. | |||
130 | [ospert_paper]: http://www.cs.unc.edu/%7Eanderson/papers/ospert09.pdf | 159 | [ospert_paper]: http://www.cs.unc.edu/%7Eanderson/papers/ospert09.pdf |
131 | [ospert]: http://www.artist-embedded.org/artist/Overview,1750.html | 160 | [ospert]: http://www.artist-embedded.org/artist/Overview,1750.html |
132 | [markdown]: http://daringfireball.net/projects/markdown/ | 161 | [markdown]: http://daringfireball.net/projects/markdown/ |
162 | [mac]: mailto:mollison@cs.unc.edu | ||