blob: c11e4a0d348fc3aadb6ab2c5f1f65eb698c02950 [file] [log] [blame]
Patrick Bellasiaa605072016-02-05 15:39:30 +00001{
2 "cells": [
3 {
4 "cell_type": "code",
5 "execution_count": 1,
6 "metadata": {
7 "collapsed": false
8 },
9 "outputs": [],
10 "source": [
11 "import logging\n",
12 "reload(logging)\n",
13 "log_fmt = '%(asctime)-9s %(levelname)-8s: %(message)s'\n",
14 "logging.basicConfig(format=log_fmt)\n",
15 "\n",
16 "# Change to info once the notebook runs ok\n",
17 "#logging.getLogger().setLevel(logging.DEBUG)"
18 ]
19 },
20 {
21 "cell_type": "code",
22 "execution_count": 2,
23 "metadata": {
24 "collapsed": false
25 },
26 "outputs": [
27 {
28 "name": "stdout",
29 "output_type": "stream",
30 "text": [
31 "Populating the interactive namespace from numpy and matplotlib\n"
32 ]
33 }
34 ],
35 "source": [
36 "%pylab inline\n",
37 "\n",
38 "import datetime\n",
39 "import devlib\n",
40 "import os\n",
41 "import json\n",
42 "import pandas as pd\n",
43 "import re\n",
44 "import subprocess\n",
45 "import trappy\n",
46 "from trappy.plotter.Utils import get_trace_event_data\n",
47 "\n",
48 "import matplotlib.gridspec as gridspec\n",
49 "import matplotlib.pyplot as plt\n",
50 "\n",
51 "# Support to access the remote target\n",
Patrick Bellasib063ae62016-02-25 10:27:58 +000052 "#import devlib\n",
53 "#from env import TestEnv\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +000054 "\n",
55 "from executor import Executor"
56 ]
57 },
58 {
59 "cell_type": "markdown",
60 "metadata": {},
61 "source": [
62 "# Target Configuration"
63 ]
64 },
65 {
66 "cell_type": "code",
67 "execution_count": 3,
68 "metadata": {
69 "collapsed": false
70 },
71 "outputs": [],
72 "source": [
73 "# Setup a target configuration\n",
74 "my_target_conf = {\n",
75 " \n",
76 " # Target platform and board\n",
77 " \"platform\" : 'linux',\n",
78 " \"board\" : 'aboard',\n",
79 " \n",
80 " # Target board IP/MAC address\n",
81 " \"host\" : '192.168.0.1',\n",
82 " \n",
83 " # Login credentials\n",
84 " \"username\" : 'root',\n",
85 " \"password\" : 'test0000',\n",
86 "\n",
87 "}"
88 ]
89 },
90 {
91 "cell_type": "markdown",
92 "metadata": {},
93 "source": [
94 "# Tests Configuration"
95 ]
96 },
97 {
98 "cell_type": "code",
99 "execution_count": 4,
100 "metadata": {
101 "collapsed": false,
102 "scrolled": false
103 },
104 "outputs": [],
105 "source": [
106 "my_tests_conf = {\n",
107 "\n",
Patrick Bellasib063ae62016-02-25 10:27:58 +0000108 " # Folder where all the results will be collected\n",
109 " \"results_dir\" : \"ExecutorExample\",\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000110 "\n",
111 " # Platform configurations to test\n",
112 " \"confs\" : [\n",
113 " {\n",
114 " \"tag\" : \"base\",\n",
Patrick Bellasib063ae62016-02-25 10:27:58 +0000115 " \"flags\" : \"ftrace\", # Enable FTrace events\n",
116 " \"sched_features\" : \"NO_ENERGY_AWARE\", # Disable EAS\n",
117 " \"cpufreq\" : { # Use PERFORMANCE CpuFreq\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000118 " \"governor\" : \"performance\",\n",
119 " },\n",
120 " },\n",
121 " {\n",
122 " \"tag\" : \"eas\",\n",
Patrick Bellasib063ae62016-02-25 10:27:58 +0000123 " \"flags\" : \"ftrace\", # Enable FTrace events\n",
124 " \"sched_features\" : \"ENERGY_AWARE\", # Enable EAS\n",
125 " \"cpufreq\" : { # Use PERFORMANCE CpuFreq\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000126 " \"governor\" : \"performance\",\n",
127 " },\n",
128 " },\n",
129 " ],\n",
130 " \n",
131 " # Workloads to run (on each platform configuration)\n",
132 " \"wloads\" : {\n",
Patrick Bellasib063ae62016-02-25 10:27:58 +0000133 " # Run hackbench with 1 group using pipes\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000134 " \"perf\" : {\n",
135 " \"type\" : \"perf_bench\",\n",
136 " \"conf\" : {\n",
137 " \"class\" : \"messaging\",\n",
138 " \"params\" : {\n",
Patrick Bellasib063ae62016-02-25 10:27:58 +0000139 " \"group\" : 1,\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000140 " \"loop\" : 10,\n",
141 " \"pipe\" : True,\n",
142 " \"thread\": True,\n",
143 " }\n",
144 " }\n",
145 " },\n",
Patrick Bellasib063ae62016-02-25 10:27:58 +0000146 " # Run a 20% duty-cycle periodic task\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000147 " \"rta\" : {\n",
148 " \"type\" : \"rt-app\",\n",
149 " \"loadref\" : \"big\",\n",
150 " \"conf\" : {\n",
151 " \"class\" : \"profile\",\n",
152 " \"params\" : {\n",
153 " \"p20\" : {\n",
154 " \"kind\" : \"periodic\",\n",
155 " \"params\" : {\n",
156 " \"duty_cycle_pct\" : 20,\n",
157 " },\n",
158 " },\n",
159 " },\n",
160 " },\n",
161 " },\n",
162 " },\n",
163 " \n",
164 " # Number of iterations for each workload\n",
165 " \"iterations\" : 1,\n",
166 " \n",
Patrick Bellasib063ae62016-02-25 10:27:58 +0000167 " # FTrace events to collect for all the tests configuration which have\n",
168 " # the \"ftrace\" flag enabled\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000169 " \"ftrace\" : {\n",
170 " \"events\" : [\n",
171 " \"sched_switch\",\n",
172 " \"sched_wakeup\",\n",
173 " \"sched_wakeup_new\",\n",
174 " \"cpu_frequency\",\n",
175 " ],\n",
176 " \"buffsize\" : 80 * 1024,\n",
177 " },\n",
178 " \n",
179 " # Tools required by the experiments\n",
180 " \"tools\" : [ 'trace-cmd', 'perf' ],\n",
181 " \n",
182 " # Modules required by these experiments\n",
183 " \"modules\" : [ 'bl', 'cpufreq' ],\n",
184 "\n",
185 "}"
186 ]
187 },
188 {
189 "cell_type": "markdown",
190 "metadata": {},
191 "source": [
192 "# Tests execution"
193 ]
194 },
195 {
196 "cell_type": "code",
197 "execution_count": 5,
198 "metadata": {
199 "collapsed": false
200 },
201 "outputs": [
202 {
203 "name": "stderr",
204 "output_type": "stream",
205 "text": [
Patrick Bellasib063ae62016-02-25 10:27:58 +0000206 "10:22:10 INFO : Target - Loading custom (inline) test configuration\n",
207 "10:22:10 INFO : Target - Using base path: /home/derkling/Code/lisa\n",
208 "10:22:10 INFO : Target - Loading custom (inline) target configuration\n",
209 "10:22:10 INFO : Target - Loading custom (inline) test configuration\n",
210 "10:22:10 INFO : Target - Devlib modules to load: ['bl', 'cpufreq']\n",
211 "10:22:10 INFO : Target - Connecting linux target:\n",
212 "10:22:10 INFO : Target - username : root\n",
213 "10:22:10 INFO : Target - host : 192.168.0.1\n",
214 "10:22:10 INFO : Target - password : test0000\n",
215 "10:22:15 INFO : Target - Initializing target workdir:\n",
216 "10:22:15 INFO : Target - /root/devlib-target\n",
217 "10:22:21 INFO : Target - Topology:\n",
218 "10:22:21 INFO : Target - [[0, 3, 4, 5], [1, 2]]\n",
219 "10:22:25 INFO : FTrace - Enabled tracepoints:\n",
220 "10:22:25 INFO : FTrace - sched_switch\n",
221 "10:22:25 INFO : FTrace - sched_wakeup\n",
222 "10:22:25 INFO : FTrace - sched_wakeup_new\n",
223 "10:22:25 INFO : FTrace - cpu_frequency\n",
224 "10:22:25 INFO : TestEnv - Set results folder to:\n",
225 "10:22:25 INFO : TestEnv - /home/derkling/Code/lisa/results/ExecutorExample\n",
226 "10:22:25 INFO : TestEnv - Experiment results available also in:\n",
227 "10:22:25 INFO : TestEnv - /home/derkling/Code/lisa/results_latest\n",
228 "10:22:25 INFO : \n",
229 "10:22:25 INFO : ################################################################################\n",
230 "10:22:25 INFO : Executor - Experiments configuration\n",
231 "10:22:25 INFO : ################################################################################\n",
232 "10:22:25 INFO : Executor - Configured to run:\n",
233 "10:22:25 INFO : Executor - 2 targt configurations:\n",
234 "10:22:25 INFO : Executor - base, eas\n",
235 "10:22:25 INFO : Executor - 2 workloads (1 iterations each)\n",
236 "10:22:25 INFO : Executor - rta, perf\n",
237 "10:22:25 INFO : Executor - Total: 4 experiments\n",
238 "10:22:25 INFO : Executor - Results will be collected under:\n",
239 "10:22:25 INFO : Executor - /home/derkling/Code/lisa/results/ExecutorExample\n"
Patrick Bellasiaa605072016-02-05 15:39:30 +0000240 ]
241 }
242 ],
243 "source": [
244 "executor = Executor(my_target_conf, my_tests_conf)"
245 ]
246 },
247 {
248 "cell_type": "code",
249 "execution_count": 6,
250 "metadata": {
251 "collapsed": false
252 },
253 "outputs": [
254 {
255 "name": "stderr",
256 "output_type": "stream",
257 "text": [
Patrick Bellasib063ae62016-02-25 10:27:58 +0000258 "10:22:25 INFO : \n",
259 "10:22:25 INFO : ################################################################################\n",
260 "10:22:25 INFO : Executor - Experiments execution\n",
261 "10:22:25 INFO : ################################################################################\n",
262 "10:22:25 INFO : \n",
263 "10:22:25 INFO : ================================================================================\n",
264 "10:22:25 INFO : TargetConfig - configuring target for [base] experiments\n",
265 "10:22:27 INFO : SchedFeatures - Set scheduler feature: NO_ENERGY_AWARE\n",
266 "10:22:27 INFO : CPUFreq - Configuring all CPUs to use [performance] governor\n",
267 "10:22:27 INFO : WlGen - Setup new workload rta\n",
268 "10:22:27 INFO : RTApp - Workload duration defined by longest task\n",
269 "10:22:27 INFO : RTApp - Default policy: SCHED_OTHER\n",
270 "10:22:27 INFO : RTApp - ------------------------\n",
271 "10:22:27 INFO : RTApp - task [task_p20], sched: using default policy\n",
272 "10:22:27 INFO : RTApp - | calibration CPU: 1\n",
273 "10:22:27 INFO : RTApp - | loops count: 1\n",
274 "10:22:27 INFO : RTApp - + phase_000001: duration 1.000000 [s] (10 loops)\n",
275 "10:22:27 INFO : RTApp - | period 100000 [us], duty_cycle 20 %\n",
276 "10:22:27 INFO : RTApp - | run_time 20000 [us], sleep_time 80000 [us]\n",
277 "10:22:28 INFO : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
278 "10:22:28 INFO : Executor - Experiment 1/4, [base:rta] 1/1\n",
279 "10:22:28 WARNING : Executor - FTrace events collection enabled\n",
280 "10:22:34 INFO : WlGen - Workload execution START:\n",
281 "10:22:34 INFO : WlGen - /root/devlib-target/bin/rt-app /root/devlib-target/run_dir/rta_00.json\n",
282 "10:22:43 INFO : Executor - Collected FTrace binary trace:\n",
283 "10:22:43 INFO : Executor - <res_dir>/rtapp:base:rta/1/trace.dat\n",
284 "10:22:43 INFO : Executor - Collected FTrace function profiling:\n",
285 "10:22:43 INFO : Executor - <res_dir>/rtapp:base:rta/1/trace_stat.json\n",
286 "10:22:43 INFO : WlGen - Setup new workload perf\n",
287 "10:22:43 INFO : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
288 "10:22:43 INFO : Executor - Experiment 2/4, [base:perf] 1/1\n",
289 "10:22:43 WARNING : Executor - FTrace events collection enabled\n",
290 "10:22:49 INFO : WlGen - Workload execution START:\n",
291 "10:22:49 INFO : WlGen - /root/devlib-target/bin/perf bench sched messaging --pipe --thread --group 1 --loop 10\n",
292 "10:22:50 INFO : PerfBench - Completion time: 0.088000, Performance 11.363636\n",
293 "10:22:57 INFO : Executor - Collected FTrace binary trace:\n",
294 "10:22:57 INFO : Executor - <res_dir>/perf_bench_messaging:base:perf/1/trace.dat\n",
295 "10:22:57 INFO : Executor - Collected FTrace function profiling:\n",
296 "10:22:57 INFO : Executor - <res_dir>/perf_bench_messaging:base:perf/1/trace_stat.json\n",
297 "10:22:57 INFO : \n",
298 "10:22:57 INFO : ================================================================================\n",
299 "10:22:57 INFO : TargetConfig - configuring target for [eas] experiments\n",
300 "10:22:59 INFO : SchedFeatures - Set scheduler feature: ENERGY_AWARE\n",
301 "10:22:59 INFO : CPUFreq - Configuring all CPUs to use [performance] governor\n",
302 "10:22:59 INFO : WlGen - Setup new workload rta\n",
303 "10:22:59 INFO : RTApp - Workload duration defined by longest task\n",
304 "10:22:59 INFO : RTApp - Default policy: SCHED_OTHER\n",
305 "10:22:59 INFO : RTApp - ------------------------\n",
306 "10:22:59 INFO : RTApp - task [task_p20], sched: using default policy\n",
307 "10:22:59 INFO : RTApp - | calibration CPU: 1\n",
308 "10:22:59 INFO : RTApp - | loops count: 1\n",
309 "10:22:59 INFO : RTApp - + phase_000001: duration 1.000000 [s] (10 loops)\n",
310 "10:22:59 INFO : RTApp - | period 100000 [us], duty_cycle 20 %\n",
311 "10:22:59 INFO : RTApp - | run_time 20000 [us], sleep_time 80000 [us]\n",
312 "10:23:00 INFO : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
313 "10:23:00 INFO : Executor - Experiment 3/4, [eas:rta] 1/1\n",
314 "10:23:00 WARNING : Executor - FTrace events collection enabled\n",
315 "10:23:06 INFO : WlGen - Workload execution START:\n",
316 "10:23:06 INFO : WlGen - /root/devlib-target/bin/rt-app /root/devlib-target/run_dir/rta_00.json\n",
317 "10:23:16 INFO : Executor - Collected FTrace binary trace:\n",
318 "10:23:16 INFO : Executor - <res_dir>/rtapp:eas:rta/1/trace.dat\n",
319 "10:23:16 INFO : Executor - Collected FTrace function profiling:\n",
320 "10:23:16 INFO : Executor - <res_dir>/rtapp:eas:rta/1/trace_stat.json\n",
321 "10:23:16 INFO : WlGen - Setup new workload perf\n",
322 "10:23:17 INFO : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
323 "10:23:17 INFO : Executor - Experiment 4/4, [eas:perf] 1/1\n",
324 "10:23:17 WARNING : Executor - FTrace events collection enabled\n",
325 "10:23:22 INFO : WlGen - Workload execution START:\n",
326 "10:23:22 INFO : WlGen - /root/devlib-target/bin/perf bench sched messaging --pipe --thread --group 1 --loop 10\n",
327 "10:23:23 INFO : PerfBench - Completion time: 0.119000, Performance 8.403361\n",
328 "10:23:31 INFO : Executor - Collected FTrace binary trace:\n",
329 "10:23:31 INFO : Executor - <res_dir>/perf_bench_messaging:eas:perf/1/trace.dat\n",
330 "10:23:31 INFO : Executor - Collected FTrace function profiling:\n",
331 "10:23:31 INFO : Executor - <res_dir>/perf_bench_messaging:eas:perf/1/trace_stat.json\n",
332 "10:23:31 INFO : \n",
333 "10:23:31 INFO : ################################################################################\n",
334 "10:23:31 INFO : Executor - Experiments execution completed\n",
335 "10:23:31 INFO : ################################################################################\n",
336 "10:23:31 INFO : Executor - Results available in:\n",
337 "10:23:31 INFO : Executor - /home/derkling/Code/lisa/results/ExecutorExample\n"
Patrick Bellasiaa605072016-02-05 15:39:30 +0000338 ]
339 }
340 ],
341 "source": [
342 "executor.run()"
343 ]
344 },
345 {
346 "cell_type": "code",
347 "execution_count": 7,
348 "metadata": {
349 "collapsed": false
350 },
351 "outputs": [
352 {
353 "name": "stdout",
354 "output_type": "stream",
355 "text": [
Patrick Bellasib063ae62016-02-25 10:27:58 +0000356 "\u001b[01;34m/home/derkling/Code/lisa/results/ExecutorExample\u001b[00m\r\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000357 "├── \u001b[01;34mperf_bench_messaging:base:perf\u001b[00m\r\n",
358 "│   ├── \u001b[01;34m1\u001b[00m\r\n",
359 "│   │   ├── output.log\r\n",
360 "│   │   ├── performance.json\r\n",
361 "│   │   └── trace.dat\r\n",
362 "│   ├── kernel.config\r\n",
363 "│   ├── kernel.version\r\n",
364 "│   └── platform.json\r\n",
365 "├── \u001b[01;34mperf_bench_messaging:eas:perf\u001b[00m\r\n",
366 "│   ├── \u001b[01;34m1\u001b[00m\r\n",
367 "│   │   ├── output.log\r\n",
368 "│   │   ├── performance.json\r\n",
369 "│   │   └── trace.dat\r\n",
370 "│   ├── kernel.config\r\n",
371 "│   ├── kernel.version\r\n",
372 "│   └── platform.json\r\n",
373 "├── \u001b[01;34mrtapp:base:rta\u001b[00m\r\n",
374 "│   ├── \u001b[01;34m1\u001b[00m\r\n",
375 "│   │   ├── output.log\r\n",
376 "│   │   ├── rta_00.json\r\n",
377 "│   │   ├── rt-app-task_p20-0.log\r\n",
378 "│   │   └── trace.dat\r\n",
379 "│   ├── kernel.config\r\n",
380 "│   ├── kernel.version\r\n",
381 "│   └── platform.json\r\n",
Patrick Bellasib063ae62016-02-25 10:27:58 +0000382 "└── \u001b[01;34mrtapp:eas:rta\u001b[00m\r\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000383 " ├── \u001b[01;34m1\u001b[00m\r\n",
384 " │   ├── output.log\r\n",
Patrick Bellasib063ae62016-02-25 10:27:58 +0000385 " │   ├── rta_00.json\r\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000386 " │   ├── rt-app-task_p20-0.log\r\n",
Patrick Bellasiaa605072016-02-05 15:39:30 +0000387 " │   └── trace.dat\r\n",
388 " ├── kernel.config\r\n",
389 " ├── kernel.version\r\n",
390 " └── platform.json\r\n",
391 "\r\n",
Patrick Bellasib063ae62016-02-25 10:27:58 +0000392 "8 directories, 26 files\r\n"
Patrick Bellasiaa605072016-02-05 15:39:30 +0000393 ]
394 }
395 ],
396 "source": [
397 "!tree {executor.te.res_dir}"
398 ]
399 }
400 ],
401 "metadata": {
402 "kernelspec": {
403 "display_name": "Python 2",
404 "language": "python",
405 "name": "python2"
406 },
407 "language_info": {
408 "codemirror_mode": {
409 "name": "ipython",
410 "version": 2
411 },
412 "file_extension": ".py",
413 "mimetype": "text/x-python",
414 "name": "python",
415 "nbconvert_exporter": "python",
416 "pygments_lexer": "ipython2",
417 "version": "2.7.9"
418 }
419 },
420 "nbformat": 4,
421 "nbformat_minor": 0
422}