• Home
  • Raw
  • Download

Lines Matching +full:- +full:n

14 …ollected as a dictionary as well as trace events if you specify so in the target configuration.\n",
15 "\n",
16 …ing python script and convert it to the language in which the benchmark is written accordingly:\n",
17 "\n",
18 "```python\n",
19 "import socket\n",
20 "sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n",
21 "sock.sendto(\"POWER\", (<TARGET_IP>, 1234))\n",
22 "sock.close()\n",
23 "```\n",
24 "\n",
25 …right before the instruction that starts the execution of the actual workload in the benchmark.\n",
26 "\n",
27 "\n",
28 "In case of Acquarium, you should put this in\n",
29 "\n",
30 "```shell\n",
31 …otest/files/client/site_tests/graphics_WebGLAquarium/graphics_WebGLAcquarium.py:run_fish_test()\n",
32 "```\n",
33 "\n",
45 "import logging\n",
46 "from conf import LisaLogging\n",
58 "import getpass\n",
59 "from subprocess import Popen, PIPE\n",
60 "\n",
61 "import os\n",
62 "import pandas as pd\n",
63 "import scipy.integrate as integrate\n",
64 "import re\n",
65 "import json\n",
66 "\n",
67 "# Support to access the remote target\n",
68 "import devlib\n",
69 "from env import TestEnv\n",
70 "\n",
71 "import trappy\n",
72 "\n",
73 "import socket\n",
74 "\n",
75 "from time import sleep\n",
76 "\n",
95 "# Define your path to the ChromeOS installation folder\n",
107 "# Setup a target configuration\n",
108 "my_conf = {\n",
109 " \n",
110 " # Target platform and board\n",
111 " \"platform\" : 'linux',\n",
112 " \n",
113 " # Target board IP/MAC address\n",
114 " \"host\" : '192.168.0.1',\n",
115 " \n",
116 " # Login credentials\n",
117 " \"username\" : 'root',\n",
118 " \"password\" : 'test0000',\n",
119 " \n",
120 " # Tools required by the experiments\n",
121 " \"tools\" : [ 'trace-cmd' ], \n",
122 " \n",
123 " # FTrace events to collect for all the tests configuration which have\n",
124 " # the \"ftrace\" flag enabled\n",
125 " \"ftrace\" : {\n",
126 " \"events\" : [\n",
127 " \"cpu_frequency\",\n",
128 " \"cpu_idle\",\n",
129 " \"sched_switch\"\n",
130 " ],\n",
131 " \"buffsize\" : 10 * 1024,\n",
132 " },\n",
148 "2016-04-27 11:06:35,781 INFO : Target - Using base path: /home/pippo/work/lisa\n",
149 …"2016-04-27 11:06:35,782 INFO : Target - Loading custom (inline) target configuration\n
150-04-27 11:06:35,782 DEBUG : Target - Target configuration {'username': 'root', 'ftrace':…
151 … "2016-04-27 11:06:35,783 INFO : Target - Devlib modules to load: ['bl', 'cpufreq']\n",
152 "2016-04-27 11:06:35,783 INFO : Target - Connecting linux target:\n",
153 "2016-04-27 11:06:35,784 INFO : Target - username : root\n",
154 "2016-04-27 11:06:35,785 INFO : Target - host : 192.168.0.1\n",
155 "2016-04-27 11:06:35,785 INFO : Target - password : test0000\n",
156 "2016-04-27 11:06:35,786 DEBUG : Target - Setup LINUX target...\n",
157 "2016-04-27 11:06:35,795 DEBUG : Logging in root@192.168.0.1\n",
158 "2016-04-27 11:06:37,318 DEBUG : id\n",
159 …"2016-04-27 11:06:37,727 DEBUG : if [ -e '/root/devlib-target/bin' ]; then echo 1; else echo 0; …
160 "2016-04-27 11:06:38,133 DEBUG : ls -1 /root/devlib-target/bin\n",
161 "2016-04-27 11:06:38,541 DEBUG : cat /proc/cpuinfo\n",
162 "2016-04-27 11:06:38,851 DEBUG : Installing module bl\n",
163 "2016-04-27 11:06:38,952 DEBUG : /root/devlib-target/bin/busybox uname -m\n",
164 …"2016-04-27 11:06:39,359 DEBUG : if [ -e '/sys/devices/system/cpu/cpufreq' ]; then echo 1; else …
165 "2016-04-27 11:06:39,665 DEBUG : Installing module cpufreq\n",
166 "2016-04-27 11:06:39,666 DEBUG : Target - Checking target connection...\n",
167 "2016-04-27 11:06:39,666 DEBUG : Target - Target info:\n",
168 "2016-04-27 11:06:39,667 DEBUG : Target - ABI: arm64\n",
169 …"2016-04-27 11:06:39,668 DEBUG : Target - CPUs: CpuInfo(['A53', 'A53', 'A72', 'A72'…
170 "2016-04-27 11:06:39,668 DEBUG : Target - Clusters: [0, 0, 1, 1]\n",
171 "2016-04-27 11:06:39,770 DEBUG : sudo -- sh -c 'mount -o remount,rw /'\n",
172 "2016-04-27 11:06:40,574 INFO : Target - Initializing target workdir:\n",
173 "2016-04-27 11:06:40,575 INFO : Target - /root/devlib-target\n",
174 "2016-04-27 11:06:40,676 DEBUG : mkdir -p /root/devlib-target\n",
175 "2016-04-27 11:06:41,085 DEBUG : mkdir -p /root/devlib-target/bin\n",
176-04-27 11:06:41,393 DEBUG : /usr/bin/scp -r /home/pippo/work/lisa/libs/devlib/devlib/bin/arm64…
177 "2016-04-27 11:06:41,804 DEBUG : chmod a+x /root/devlib-target/bin/busybox\n",
178-04-27 11:06:42,112 DEBUG : /usr/bin/scp -r /home/pippo/work/lisa/libs/devlib/devlib/bin/scrip…
179 "2016-04-27 11:06:42,360 DEBUG : chmod a+x /root/devlib-target/bin/shutils\n",
180 …2016-04-27 11:06:42,668 DEBUG : /usr/bin/scp -r /home/pippo/work/lisa/tools/arm64/trace-cmd ro…
181 "2016-04-27 11:06:42,976 DEBUG : chmod a+x /root/devlib-target/bin/trace-cmd\n",
182 "2016-04-27 11:06:43,285 DEBUG : Target - Check for module [bl]...\n",
183 "2016-04-27 11:06:43,286 DEBUG : Target - Check for module [cpufreq]...\n",
184 "2016-04-27 11:06:43,287 INFO : Target - Topology:\n",
185 "2016-04-27 11:06:43,287 INFO : Target - [[0, 1], [2, 3]]\n",
186 …"2016-04-27 11:06:43,389 DEBUG : sudo -- sh -c 'cat '\\''/sys/devices/system/cpu/online'\\'''\n",
187 …"2016-04-27 11:06:44,293 DEBUG : cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_freq…
188 …"2016-04-27 11:06:44,702 DEBUG : sudo -- sh -c 'cat '\\''/sys/devices/system/cpu/online'\\'''\n",
189 …"2016-04-27 11:06:45,606 DEBUG : cat /sys/devices/system/cpu/cpu2/cpufreq/scaling_available_freq…
190 …"2016-04-27 11:06:45,914 DEBUG : Platform - Trying to load default EM from /home/pippo/wor…
191 "2016-04-27 11:06:45,915 DEBUG : Platform - Platform descriptor initialized\n",
192 …, 702000, 1001000, 1105000, 1209000, 1300000, 1508000, 1703000]}, 'topology': [[0, 1], [2, 3]]}\n",
193-04-27 11:06:45,932 DEBUG : /usr/bin/scp -r /home/pippo/work/lisa/libs/devlib/devlib/bin/arm64…
194 "2016-04-27 11:06:46,296 DEBUG : chmod a+x /root/devlib-target/bin/trace-cmd\n",
195 "2016-04-27 11:06:46,704 DEBUG : cat /sys/kernel/debug/tracing/available_events\n",
196 "2016-04-27 11:06:47,036 INFO : FTrace - Enabled tracepoints:\n",
197 "2016-04-27 11:06:47,037 INFO : FTrace - cpu_frequency\n",
198 "2016-04-27 11:06:47,038 INFO : FTrace - cpu_idle\n",
199 "2016-04-27 11:06:47,038 INFO : FTrace - sched_switch\n",
200 "2016-04-27 11:06:47,039 DEBUG : No RT-App workloads, skipping calibration\n",
201 "2016-04-27 11:06:47,040 INFO : TestEnv - Set results folder to:\n",
202 …"2016-04-27 11:06:47,040 INFO : TestEnv - /home/pippo/work/lisa/results/20160427_1106…
203 "2016-04-27 11:06:47,040 INFO : TestEnv - Experiment results available also in:\n",
204 "2016-04-27 11:06:47,041 INFO : TestEnv - /home/pippo/work/lisa/results_latest\n"
209 "# Initialize a test environment using:\n",
210 "# the provided target configuration (my_conf)\n",
211 "te = TestEnv(my_conf)\n",
223 "def get_host_ip():\n",
224 " \"\"\"Returns the IP of the local host\"\"\"\n",
225 " ifs = ni.interfaces()\n",
226 " for interface in ifs:\n",
227 " if interface == 'lo':\n",
228 " continue\n",
229 "\n",
230 " addresses = ni.ifaddresses(interface)\n",
231 " if addresses.has_key(socket.AF_INET):\n",
232 " return addresses[socket.AF_INET][0]['addr']\n",
233 "\n",
252 "CROS_SDK_BIN_PATH = CROS_BASE + \"/chromium/tools/depot_tools/cros_sdk\"\n",
253 "username = !id -un\n",
261 "# Test-specific Parser Functions"
272 "def parse_graphics_WebGLAquarium(results_dir):\n",
273 " results_file = os.path.join(\n",
274 " CROS_PATH,\n",
275 " os.path.basename(results_dir),\n",
276 " 'results-1-graphics_WebGLAquarium/graphics_WebGLAquarium/results/keyval'\n",
277 " )\n",
278 " \n",
279 " data = {}\n",
280 " with open(results_file) as data_file:\n",
281 " for line in data_file:\n",
282 " if line.strip():\n",
283 " key, val = line.split('=')\n",
284 " data[key] = float(val)\n",
285 " \n",
297 "parse_results = {\n",
298 " # Acquarium\n",
299 " 'graphics_WebGLAquarium' : parse_graphics_WebGLAquarium\n",
321 "def CrosSdkSession(password):\n",
322 " \"\"\"\n",
323 " Create cros_sdk session. The user will be asked to type his password.\n",
324 " \n",
325 " :param password: host machine password\n",
326 " :type password: str\n",
327 " \"\"\"\n",
328 " cros_sdk_session = Popen(['sudo -Sk {}'.format(CROS_SDK_BIN_PATH)],\n",
329 " bufsize=1,\n",
330 " stdin=PIPE,\n",
331 " stdout=PIPE,\n",
332 " stderr=PIPE,\n",
333 " cwd=CROS_PATH,\n",
334 " shell=True)\n",
335 " cros_sdk_session.stdin.write(password)\n",
336 " cros_sdk_session.stdin.write('\\n')\n",
337 " return cros_sdk_session\n",
338 "\n",
339 "def test_that(password, te, test, pwr_time_s, get_token=False):\n",
340 " \"\"\"\n",
341 " Run a specific test using the test_that command.\n",
342 " \n",
343 " :param password: host machine password\n",
344 " :type password: str\n",
345 " \n",
346 " :param te: Test Environment object\n",
347 " :type te: env.TestEnv\n",
348 " \n",
349 " :param test: name of the test to be run\n",
350 " :type test: str\n",
351 " \n",
352 " :param pwr_time_s: power measurement duration in seconds\n",
353 " :type pwr_time_s: int\n",
354 " \n",
355 " :param get_token: if True wait for token before collecting traces\n",
356 " :type get_token: bool\n",
357 " \"\"\"\n",
358 " \n",
359 " results_dir = \"~/results-dir\"\n",
360 " pwr_file = \"~/power.txt\"\n",
361 " \n",
362 " test_cmd = 'test_that -b oak {} --results_dir {} {}\\n'.format(te.ip,\n",
363 " results_dir,\n",
364 " test)\n",
365 " pwr_cmd = 'dut-control -t {} -y dvfs1_mw dvfs2_mw > {}\\n'.format(pwr_time_s,\n",
366 " pwr_file)\n",
367 " \n",
368 " # Create cros_sdk session\n",
369 " cros_sdk_session = CrosSdkSession(password)\n",
370 " \n",
371 " logging.info('#### Start %s execution', test)\n",
372 " cros_sdk_session.stdin.write(test_cmd)\n",
373 " \n",
374 " if get_token:\n",
375 " # Setup socket to get token from target\n",
376 " sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n",
377 " sock.bind((HOST_IP, 1234))\n",
378 " logging.debug(' Waiting for token...')\n",
379 " while True:\n",
380 " data, addr = sock.recvfrom(32)\n",
381 " if addr[0] == te.ip and data == \"POWER\":\n",
382 " break\n",
383 " sock.close() \n",
384 " logging.debug(' Token received....')\n",
385 " \n",
386 " logging.debug(' Start trace collection')\n",
387 " # Check if trace events need to be collected\n",
388 " if te.ftrace:\n",
389 " te.ftrace.start()\n",
390 " \n",
391 " sleep(5)\n",
392 " # Start measuring power\n",
393 " cros_sdk_session.stdin.write(pwr_cmd)\n",
394 " \n",
395 " # communicate will close the session when the command terminates\n",
396 " cros_sdk_session.communicate()\n",
397 " logging.info('#### Completed %s execution', test)\n",
398 " \n",
399 " if te.ftrace:\n",
400 " te.ftrace.stop()\n",
401 " te.ftrace.get_trace(os.path.join(te.res_dir, 'trace.dat'))\n",
402 " \n",
403 " # Parse results using test-specific parser\n",
404 " results = parse_results[test](results_dir)\n",
405 " \n",
406 " # Copy results to our Test Environment results directory\n",
407 " with open(os.path.join(te.res_dir, 'results.json'), 'w') as outfile:\n",
408 " json.dumps(results, outfile)\n",
409 " \n",
410 " return {\n",
411 " \"results\" : results,\n",
412 " \"pwr_file\" : pwr_file\n",
430 "········\n"
435 "# ask user for host password\n",
453 "2016-04-27 11:06:53,601 INFO : #### Start graphics_WebGLAquarium execution\n",
454 "2016-04-27 11:06:53,603 DEBUG : Waiting for token...\n",
455 "2016-04-27 11:07:23,040 DEBUG : Token received....\n",
456 "2016-04-27 11:07:23,041 DEBUG : Start trace collection\n",
457 …"2016-04-27 11:07:23,142 DEBUG : sudo -- sh -c 'echo 10240 > '\\''/sys/kernel/debug/tracing/buff…
458 …"2016-04-27 11:07:23,845 DEBUG : sudo -- sh -c 'cat '\\''/sys/kernel/debug/tracing/buffer_size_k…
459 "2016-04-27 11:07:24,750 DEBUG : sudo -- sh -c '/root/devlib-target/bin/trace-cmd reset'\n",
460 …"2016-04-27 11:07:26,170 DEBUG : sudo -- sh -c '/root/devlib-target/bin/trace-cmd start -e cpu_f…
461 …"2016-04-27 11:07:27,539 DEBUG : sudo -- sh -c 'echo TRACE_MARKER_START > '\\''/sys/kernel/debug…
462 "2016-04-27 11:07:28,141 DEBUG : Trace CPUFreq frequencies\n",
463 …"2016-04-27 11:07:28,242 DEBUG : sudo -- sh -c '/root/devlib-target/bin/shutils cpufreq_trace_al…
464 "2016-04-27 11:08:45,869 INFO : #### Completed graphics_WebGLAquarium execution\n",
465 "2016-04-27 11:08:45,870 DEBUG : Trace CPUFreq frequencies\n",
466 …"2016-04-27 11:08:45,971 DEBUG : sudo -- sh -c '/root/devlib-target/bin/shutils cpufreq_trace_al…
467 …"2016-04-27 11:08:46,875 DEBUG : sudo -- sh -c 'echo TRACE_MARKER_STOP > '\\''/sys/kernel/debug/…
468 "2016-04-27 11:08:47,578 DEBUG : sudo -- sh -c '/root/devlib-target/bin/trace-cmd stop'\n",
469 …"2016-04-27 11:08:48,482 DEBUG : sudo -- sh -c '/root/devlib-target/bin/trace-cmd extract -o /ro…
470-04-27 11:08:50,337 DEBUG : /usr/bin/scp -r root@192.168.0.1:/root/devlib-target/trace.dat /ho…
475 "# Run Acquarium and collect results\n",
476 "acquarium_res = test_that(password,\n",
477 " te,\n",
478 " 'graphics_WebGLAquarium',\n",
479 " 10,\n",
493 "<div>\n",
494 "<table border=\"1\" class=\"dataframe\">\n",
495 " <thead>\n",
496 " <tr style=\"text-align: right;\">\n",
497 " <th></th>\n",
498 " <th>Values</th>\n",
499 " </tr>\n",
500 " </thead>\n",
501 " <tbody>\n",
502 " <tr>\n",
503 " <th>avg_render_time_0050_fishes{perf}</th>\n",
504 " <td>0.007754</td>\n",
505 " </tr>\n",
506 " <tr>\n",
507 " <th>std_render_time_0050_fishes{perf}</th>\n",
508 " <td>0.003022</td>\n",
509 " </tr>\n",
510 " <tr>\n",
511 " <th>avg_render_time_1000_fishes{perf}</th>\n",
512 " <td>0.015975</td>\n",
513 " </tr>\n",
514 " <tr>\n",
515 " <th>meminfo_MemUsed{perf}</th>\n",
516 " <td>1052424.000000</td>\n",
517 " </tr>\n",
518 " <tr>\n",
519 " <th>std_interframe_time_1000_fishes{perf}</th>\n",
520 " <td>0.036034</td>\n",
521 " </tr>\n",
522 " <tr>\n",
523 " <th>avg_fps_1000_fishes{perf}</th>\n",
524 " <td>38.576854</td>\n",
525 " </tr>\n",
526 " <tr>\n",
527 " <th>std_interframe_time_0050_fishes{perf}</th>\n",
528 " <td>0.029933</td>\n",
529 " </tr>\n",
530 " <tr>\n",
531 " <th>std_render_time_1000_fishes{perf}</th>\n",
532 " <td>0.002286</td>\n",
533 " </tr>\n",
534 " <tr>\n",
535 " <th>meminfo_SwapUsed{perf}</th>\n",
536 " <td>0.000000</td>\n",
537 " </tr>\n",
538 " <tr>\n",
539 " <th>avg_interframe_time_1000_fishes{perf}</th>\n",
540 " <td>0.025922</td>\n",
541 " </tr>\n",
542 " <tr>\n",
543 " <th>avg_interframe_time_0050_fishes{perf}</th>\n",
544 " <td>0.017457</td>\n",
545 " </tr>\n",
546 " <tr>\n",
547 " <th>avg_fps_0050_fishes{perf}</th>\n",
548 " <td>57.282652</td>\n",
549 " </tr>\n",
550 " </tbody>\n",
551 "</table>\n",
555 " Values\n",
556 "avg_render_time_0050_fishes{perf} 0.007754\n",
557 "std_render_time_0050_fishes{perf} 0.003022\n",
558 "avg_render_time_1000_fishes{perf} 0.015975\n",
559 "meminfo_MemUsed{perf} 1052424.000000\n",
560 "std_interframe_time_1000_fishes{perf} 0.036034\n",
561 "avg_fps_1000_fishes{perf} 38.576854\n",
562 "std_interframe_time_0050_fishes{perf} 0.029933\n",
563 "std_render_time_1000_fishes{perf} 0.002286\n",
564 "meminfo_SwapUsed{perf} 0.000000\n",
565 "avg_interframe_time_1000_fishes{perf} 0.025922\n",
566 "avg_interframe_time_0050_fishes{perf} 0.017457\n",
576 "# Print Acquarium results\n",
577 "df = pd.DataFrame.from_dict(acquarium_res['results'], orient=\"index\")\n",
578 "df.columns = ['Values']\n",
597 "if te.ftrace:\n",
618 "<div>\n",
619 "<table border=\"1\" class=\"dataframe\">\n",
620 " <thead>\n",
621 " <tr style=\"text-align: right;\">\n",
622 " <th></th>\n",
623 " <th>Energy [mJ]</th>\n",
624 " </tr>\n",
625 " </thead>\n",
626 " <tbody>\n",
627 " <tr>\n",
628 " <th>Total</th>\n",
629 " <td>4573.172353</td>\n",
630 " </tr>\n",
631 " <tr>\n",
632 " <th>LITTLE Cluster</th>\n",
633 " <td>1574.512282</td>\n",
634 " </tr>\n",
635 " <tr>\n",
636 " <th>big Cluster</th>\n",
637 " <td>2998.660071</td>\n",
638 " </tr>\n",
639 " </tbody>\n",
640 "</table>\n",
644 " Energy [mJ]\n",
645 "Total 4573.172353\n",
646 "LITTLE Cluster 1574.512282\n",
656 "# Collect SERVO trace\n",
657 "servo_trace_file = os.path.join(CROS_PATH,\n",
658 " os.path.basename(acquarium_res['pwr_file']))\n",
659 "time = []\n",
660 "dvfs1_wm = []\n",
661 "dvfs2_wm = []\n",
662 "with open(servo_trace_file, 'r') as f:\n",
663 " for l in f:\n",
664 " if l.startswith(\"@@\"):\n",
665 " continue\n",
666 "\n",
667 " info = re.split(r'[ :]+', l)\n",
668 " if info[1] == \"dvfs1_mw\":\n",
669 " time.append(float(info[0]))\n",
670 " dvfs1_wm.append(float(info[2]))\n",
671 " else:\n",
672 " dvfs2_wm.append(float(info[2]))\n",
673 "\n",
674 "# Create dataframes for power data from SERVO board\n",
675 "big_pwr = pd.DataFrame(dvfs1_wm, index=time, columns=['Power'])\n",
676 "little_pwr = pd.DataFrame(dvfs2_wm, index=time, columns=['Power'])\n",
677 "\n",
678 "x = big_pwr.index.get_values()\n",
679 "y = big_pwr.Power.get_values()\n",
680 "bnrg = integrate.simps(y, x=x)\n",
681 "\n",
682 "x = little_pwr.index.get_values()\n",
683 "y = little_pwr.Power.get_values()\n",
684 "lnrg = integrate.simps(y, x=x)\n",
685 "results = {\n",
686 " 'big Cluster' : bnrg,\n",
687 " 'LITTLE Cluster' : lnrg,\n",
688 " 'Total' : bnrg + lnrg,\n",
689 "}\n",
690 "\n",
691 "df = pd.DataFrame.from_dict(results, orient=\"index\")\n",
692 "df.columns = ['Energy [mJ]']\n",
709 "mimetype": "text/x-python",