aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-03-19 15:06:36 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2013-03-19 15:06:36 -0400
commit4f97e3e478b4b248d993bce56c1c6bb737decbbe (patch)
treed3c205786e6b302fe8125b928073ac15cc6183c3
parent36a56e31db846706cb2cbcb61d5783e7af11391a (diff)
Added README.
-rw-r--r--README507
1 files changed, 507 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..e1a0815
--- /dev/null
+++ b/README
@@ -0,0 +1,507 @@
1I. INTRODUCTION
2These scripts provide a common way for creating, running, parsing, and
3plotting experiments under LITMUS^RT. They are designed with the
4following principles in mind:
5
61. Little or no configuration: all scripts use certain parameters to
7configure behavior. However, if the user does not give these
8parameters, the scripts will examine the properties of the user's
9system to pick a suitable default. Requiring user input is a last
10resort.
11
122. Interruptability: the scripts save their work as they evaluate
13multiple directories. When the scripts are interrupted, or if new data
14is added to those directories, the scripts can be re-run and they will
15resume where they left off. This vastly decreases turnaround time for
16testing new features.
17
183. Maximum Safety: where possible, scripts save metadata in their output
19directories about the data contained. This metadata can be used by
20the other scripts to safely use the data later.
21
224. Independence / legacy support: none of these scripts assume their
23input was generated by another of these scripts. Three are designed to
24recognize generic input formats inspired by past LITMUS^RT
25experimental setups. (The exception to this is gen_exps.py, which
26has only user intput and creates output only for run_exps.py)
27
285. Save everything: all output and parameters (even from subprocesses)
29is saved for debugging / reproducability. This data is saved in tmp/
30directories while scripts are running in case scripts fail.
31
32These scripts require that the following repos are in the user's PATH:
331. liblitmus - for real-time executable simulation and task set release
342. feather-trace-tools - for recording and parsing overheads and
35 scheduling events
36
37Optionally, additional features will be enabled if these repos are
38present in the PATH:
391. rt-kernelshark - to record ftrace events for kernelshark visualization
402. sched_trace - to output a file containing scheduling events as
41strings
42
43Each of these scripts is designed to operate independently of the
44others. For example, the parse_exps.py will find any feather trace
45files resembling ft-xyz.bin or xyz.ft and print out overhead
46statistics for the records inside. However, the scripts provide the
47most features (especially safety) when their results are chained
48together, like so:
49
50gen_exps.py --> [exps/*] --> run_exps.py --> [run-data/*] --.
51.------------------------------------------------------------'
52'--> parse_exps.py --> [parse-data/*] --> plot_exps.py --> [plot-data/*.pdf]
53
540. Create experiments with gen_exps.py or some other script.
551. Run experiments using run_exps.py, generating binary files in run-data/.
562. Parse binary data in run-data using parse_exps.py, generating csv
57 files in parse-data/.
583. Plot parse-data using plot_exps.py, generating pdfs in plot-data.
59
60Each of these scripts will be described. The run_exps.py script is
61first because gen_exps.py creates schedule files which depend on run_exps.py.
62
63
64II. RUN_EXPS
65Usage: run_exps.py [OPTIONS] [SCHED_FILE]... [SCHED_DIR]...
66 where a SCHED_DIR resembles:
67 SCHED_DIR/
68 SCHED_FILE
69 PARAM_FILE
70
71Output: OUT_DIR/[files] or OUT_DIR/SCHED_DIR/[files] or
72 OUT_DIR/SCHED_FILE/[files] depending on input
73 If all features are enabled, these files are:
74 OUT_DIR/[.*/]
75 trace.slog # LITMUS logging
76 st-[1..m].bin # sched_trace data
77 ft.bin # feather-trace overhead data
78 trace.dat # ftrace data for kernelshark
79 params.py # Schedule parameters
80 exec-out.txt # Standard out from schedule processes
81 exec-err.txt # Standard err '''
82
83Defaults: SCHED_FILE = sched.py, PARAM_FILE = params.py,
84 DURATION = 30, OUT_DIR = run-data/
85
86The run_exps.py script reads schedule files and executes real-time
87task systems, recording all overhead, logging, and trace data which is
88enabled in the system. For example, if trace logging is enabled,
89rt-kernelshark is found in the path, but feather-trace is disabled
90(the devices are not present), only trace-logs and kernelshark logs
91will be recorded.
92
93When run_exps.py is running a schedule file, temporary data is saved
94in a 'tmp' directory in the same directory as the schedule file. When
95execution completes, this data is moved into a directory under the
96run_exps.py output directory (default: 'run-data/', can be changed with
97the -o option). When multiple schedules are run, each schedule's data
98is saved in a unique directory under the output directory.
99
100If a schedule has been run and it's data is in the output directory,
101run_exps.py will not re-run the schedule unless the -f option is
102specified. This is useful if your system crashes midway through a set
103of experiments.
104
105Schedule files have one of the following two formats:
106
107a) simple format
108 path/to/proc{proc_value}
109 ...
110 path/to/proc{proc_value}
111 [real_time_task: default rtspin] task_arguments...
112 ...
113 [real_time_task] task_arguments...
114
115b) python format
116 {'proc':[
117 ('path/to/proc','proc_value'),
118 ...,
119 ('path/to/proc','proc_value')
120 ],
121 'spin':[
122 ('real_time_task', 'task_arguments'),
123 ...
124 ('real_time_task', 'task_arguments')
125 ]
126 }
127
128The following creates a simple 3-task system with utilization 2.0,
129which is then run under the GSN-EDF plugin:
130
131$ echo "10 20
13230 40
13360 90" > test.sched
134$ run_exps.py -s GSN-EDF test.sched
135
136The following will write a release master using
137/proc/litmus/release_master:
138
139$ echo "release_master{2}
14010 20" > test.sched && run_exps.py -s GSN-EDF test.sched
141
142A longer form can be used for proc entries not in /proc/litmus:
143
144$ echo "/proc/sys/something{hello}"
14510 20" > test.sched
146
147You can specify your own spin programs to run as well instead of
148rtspin by putting their name at the beginning of the line.
149
150$ echo "colorspin -f color1.csv 10 20" > test.sched
151
152This example also shows how you can reference files in the same
153directory as the schedule file on the command line.
154
155You can specify parameters for an experiment in a file instead of on
156the command line using params.py (the -p option lets you choose the
157name of this file if params.py is not for you):
158
159$ echo "{'scheduler':'GSN-EDF', 'duration':10}" > params.py
160$ run_exps.py test.sched
161
162You can also run multiple experiments with a single command, provided
163a directory with a schedule file exists for each. By default, the
164program will look for sched.py for the schedule file and params.py for
165the parameter file, but this behavior can be changed using the -p and
166-c options.
167
168You can include non-relevant parameters which run_exps.py does not
169understand in params.py. These parameters will be saved with the data
170output by run_exps.py. This is useful for tracking variations in
171system parameters versus experimental results.
172
173In the following example, multiple experiments are demonstrated and an
174extra parameter 'test-param' is included:
175
176$ mkdir test1
177# The duration will default to 30 and need not be specified
178$ echo "{'scheduler':'C-EDF', 'test-param':1} > test1/params.py
179$ echo "10 20" > test1/sched.py
180$ cp -r test1 test2
181$ echo "{'scheduler':'GSN-EDF', 'test-param':2}"> test2/params.py
182$ run_exps.py test*
183
184Finally, you can specify system properties in params.py which the
185environment must match for the experiment to run. These are useful if
186you have a large batch of experiments which must be run under
187different kernels. The first property is a regular expression for the
188uname of the system:
189
190$ uname -r
1913.0.0-litmus
192$ cp params.py old_params.py
193$ echo "{'uname': r'.*linux.*'}" >> params.py
194# run_exps.py will now complain of an invalid environment for this
195experiment
196$ cp old_params.py params.py
197$ echo "{'uname': r'.*litmus.*'}" >> params.py
198# run_exps.py will now succeed
199
200The second property are kernel configuration options. These assume the
201configuration is stored at /boot/config-`uname -r`. You can specify
202these like so:
203
204$ echo "{'config-options':{
205'RELEASE_MASTER' : 'y',
206'ARM' : 'y'}}" >> params.py
207# Only executes on ARM systems with the release master enabled
208
209
210III. GEN_EXPS
211Usage: gen_exps.py [options] [files...] [generators...] [param=val[,val]...]
212Output: exps/EXP_DIRS which each contain sched.py and params.py
213Defaults: generators = G-EDF P-EDF C-EDF
214
215The gen_exps.py script uses 'generators', one for each LITMUS
216scheduler supported, which each have different properties which can be
217varied to generate different types of schedules. Each of these
218properties has a default value which can be modified on the command
219line for quick and easy experiment generation.
220
221This script as written should be used to create debugging task sets,
222but not for creating task sets for experiments shown in papers. That
223is because the safety features of run_exps.py described above (uname,