• Home
  • Raw
  • Download

Lines Matching full:n

7     "# Test environment API - TestEnv\n",
8 "\n",
9 "The test environment is primarily defined by the target configuration (see **conf** below).\n",
10 "\n",
11 …re setups are needed on the hardware target, and a location for the results of the experiments.\n",
12 "\n",
13 "Parameters:\n",
14 " - target configuration\n",
15 …figuration - more information on this can be found in **examples/utils/executor_example.ipynb**\n",
16 " - wipe - if to clean up all previous content from the results folder\n",
28 "# One initial cell for imports\n",
29 "import json\n",
30 "import time\n",
31 "import os\n",
46 "2016-12-12 11:51:14,376 INFO : root : Using LISA logging configuration:\n",
47 "2016-12-12 11:51:14,376 INFO : root : /home/vagrant/lisa/logging.conf\n"
52 "from conf import LisaLogging\n",
53 "LisaLogging.setup()\n",
54 "# For debug information use:\n",
69 "**Target configuration**:\n",
70 "\n",
71 " - **platform** - the currently supported boards are:\n",
72 " - linux - accessed via SSH connection\n",
73 " - android - accessed via ADB connection\n",
74 " - host - ran on local host\n",
75 " \n",
76 " - **board** - the currently supported boards are:\n",
77 " - juno - target is a JUNO board\n",
78 " - tc2 - target is a TC2 board\n",
79 " - oak - target is MT8173 platform model\n",
80 " - pixel - target is a Pixel device\n",
81 " - hikey - target is a Hikey development platform\n",
82 " - nexus5x - target is a Nexus 5X device\n",
83 " \n",
84 " - **host** - target IP or MAC address\n",
85 " \n",
86 " - **device** - target Android device ID\n",
87 " \n",
88 " - **port** - port for Android connection - default port is 5555\n",
89 " \n",
90 " - **ANDROID_HOME** - path to android-sdk-linux\n",
91 " \n",
92 " - **username**\n",
93 " \n",
94 " - **password**\n",
95 " \n",
96 " - **keyfile** - you can either specify a password or a keyfile\n",
97 " \n",
98 …- **rtapp-calib** - these values are not supposed to be specified at the first run on a target.\n",
99 … After the first run, it's best to fill this array with values reported in the log messges for\n",
100 " your specific target, for these not to be obtained again.\n",
101 " \n",
102 " - **tftp** - tftp server from where the target gets kernel/dtb images at each boot\n",
103 " \n",
104 " - **modules** - devlib modules to be enabled\n",
105 " \n",
106 " - **exclude_modules** - devlib modules to be disabled\n",
107 " \n",
108 " - **tools** - binary tools (available under ./tools/$ARCH/) to install by default\n",
109 " \n",
110 " - **ping_time** - wait time before trying to access the target after reboot\n",
111 " \n",
112 " - **reboot_time** - maximum time to wait after rebooting the target\n",
113 " \n",
114 " - **__features__** - list of test environment features to enable\n",
115 " - no-kernel - do not deploy kernel/dtb images\n",
116 " - no-reboot - do not force reboot the target at each configuration change\n",
117 " - debug - enable debugging messages\n",
118 " \n",
119 " - **ftrace** - ftrace configuration\n",
120 " - events\n",
121 " - functions\n",
122 " - buffsize\n",
123 " \n",
124 " - **results_dir** - location of results of the experiments\n"
135 "# Setup a target configuration\n",
136 "conf = {\n",
137 "\n",
138 " # Platform\n",
139 " \"platform\" : \"linux\",\n",
140 " # Board\n",
141 " \"board\" : \"juno\",\n",
142 "\n",
143 " # Login credentials\n",
144 " \"host\" : \"192.168.0.1\",\n",
145 " \"username\" : \"root\",\n",
146 " # You can specify either a password or keyfile\n",
147 " \"password\" : \"juno\",\n",
148 " # \"keyfile\" : \"/complete/path/of/your/keyfile\",\n",
149 "\n",
150 " # Tools to deploy\n",
151 " \"tools\" : [ \"rt-app\", \"taskset\" ],\n",
152 "\n",
153 " \"tftp\" : {\n",
154 " \"folder\" : \"/var/lib/tftpboot/\",\n",
155 " \"kernel\" : \"Image\",\n",
156 " \"dtb\" : \"juno.dtb\"\n",
157 " },\n",
158 "\n",
159 " #\"ping_time\" : \"15\",\n",
160 " #\"reboot_time\" : \"180\",\n",
161 "\n",
162 " # RTApp calibration values (comment to let LISA do a calibration run)\n",
163 " \"rtapp-calib\" : {\n",
164 " \"0\": 358, \"1\": 138, \"2\": 138, \"3\": 357, \"4\": 359, \"5\": 355\n",
165 " },\n",
166 "\n",
167 " # FTrace configuration\n",
168 " \"ftrace\" : {\n",
169 " \"events\" : [\n",
170 " \"cpu_idle\",\n",
171 " \"sched_switch\",\n",
172 " ],\n",
173 " \"buffsize\" : 10240,\n",
174 " },\n",
175 " \n",
176 " # Where results are collected\n",
177 " \"results_dir\" : \"TestEnvExample\",\n",
178 "\n",
179 " #\"__features__\" : \"no-kernel no-reboot\"\n",
199 "from env import TestEnv\n",
200 "\n",
201 "# Initialize a test environment using the provided configuration\n",
209 "## Attributes\n",
210 "\n",
211 … "The initialisation of the test environment pre-initialises some useful environment variables.\n",
212 "\n",
227 "{\n",
228 " \"username\": \"root\", \n",
229 " \"ftrace\": {\n",
230 " \"buffsize\": 10240, \n",
231 " \"events\": [\n",
232 " \"cpu_idle\", \n",
233 " \"sched_switch\"\n",
234 " ]\n",
235 " }, \n",
236 " \"rtapp-calib\": {\n",
237 " \"1\": 138, \n",
238 " \"0\": 358, \n",
239 " \"3\": 357, \n",
240 " \"2\": 138, \n",
241 " \"5\": 355, \n",
242 " \"4\": 359\n",
243 " }, \n",
244 " \"host\": \"192.168.0.1\", \n",
245 " \"password\": \"juno\", \n",
246 " \"tools\": [\n",
247 " \"rt-app\", \n",
248 " \"taskset\", \n",
249 " \"trace-cmd\", \n",
250 " \"taskset\", \n",
251 " \"trace-cmd\", \n",
252 " \"perf\", \n",
253 " \"cgroup_run_into.sh\"\n",
254 " ], \n",
255 " \"results_dir\": \"TestEnvExample\", \n",
256 " \"platform\": \"linux\", \n",
257 " \"board\": \"juno\", \n",
258 " \"__features__\": [], \n",
259 " \"tftp\": {\n",
260 " \"kernel\": \"Image\", \n",
261 " \"folder\": \"/var/lib/tftpboot/\", \n",
262 " \"dtb\": \"juno.dtb\"\n",
263 " }\n",
264 "}\n"
269 "# The complete configuration of the target we have configured\n",
284 "None\n",
285 "None\n"
290 "# Last configured kernel and DTB image\n",
291 "print te.kernel\n",
306 "192.168.0.1\n",
307 "None\n"
312 "# The IP and MAC address of the target\n",
313 "print te.ip\n",
328 "{\n",
329 " \"nrg_model\": {\n",
330 " \"big\": {\n",
331 " \"cluster\": {\n",
332 " \"nrg_max\": 64\n",
333 " }, \n",
334 " \"cpu\": {\n",
335 " \"cap_max\": 1024, \n",
336 " \"nrg_max\": 616\n",
337 " }\n",
338 " }, \n",
339 " \"little\": {\n",
340 " \"cluster\": {\n",
341 " \"nrg_max\": 57\n",
342 " }, \n",
343 " \"cpu\": {\n",
344 " \"cap_max\": 447, \n",
345 " \"nrg_max\": 93\n",
346 " }\n",
347 " }\n",
348 " }, \n",
349 " \"clusters\": {\n",
350 " \"big\": [\n",
351 " 1, \n",
352 " 2\n",
353 " ], \n",
354 " \"little\": [\n",
355 " 0, \n",
356 " 3, \n",
357 " 4, \n",
358 " 5\n",
359 " ]\n",
360 " }, \n",
361 " \"cpus_count\": 6, \n",
362 " \"freqs\": {\n",
363 " \"big\": [\n",
364 " 450000, \n",
365 " 625000, \n",
366 " 800000, \n",
367 " 950000, \n",
368 " 1100000\n",
369 " ], \n",
370 " \"little\": [\n",
371 " 450000, \n",
372 " 575000, \n",
373 " 700000, \n",
374 " 775000, \n",
375 " 850000\n",
376 " ]\n",
377 " }, \n",
378 " \"topology\": [\n",
379 " [\n",
380 " 0, \n",
381 " 3, \n",
382 " 4, \n",
383 " 5\n",
384 " ], \n",
385 " [\n",
386 " 1, \n",
387 " 2\n",
388 " ]\n",
389 " ]\n",
390 "}\n"
395 "# A full platform descriptor\n",
418 "# This is a pre-created folder to host the tests results generated using this\n",
419 "# test environment. Notice that the suite could add additional information\n",
420 "# in this folder, like for example a copy of the target configuration\n",
421 "# and other target specific collected information.\n",
444 "# The working directory on the target\n",
458 "cluster [[0, 3, 4, 5], [1, 2]]\n",
468 "# The target topology, which can be used to build BART assertions\n",
476 "## Functions\n",
477 "\n",
478 … methods are also exposed to test developers which could be used to ease the creation of tests.\n",
479 "\n",
503 "# Calibrate RT-App (if required) and get the most updated calibration value\n",
517 "({'clusters': {'big': [1, 2], 'little': [0, 3, 4, 5]},\n",
518 " 'cpus_count': 6,\n",
519 " 'freqs': {'big': [450000, 625000, 800000, 950000, 1100000],\n",
520 " 'little': [450000, 575000, 700000, 775000, 850000]},\n",
521 " 'nrg_model': {u'big': {u'cluster': {u'nrg_max': 64},\n",
522 " u'cpu': {u'cap_max': 1024, u'nrg_max': 616}},\n",
523 " u'little': {u'cluster': {u'nrg_max': 57},\n",
524 " u'cpu': {u'cap_max': 447, u'nrg_max': 93}}},\n",
525 " 'topology': [[0, 3, 4, 5], [1, 2]]},\n",
535 "# Generate a JSON file with the complete platform description\n",
551 …-12 11:56:15,281 INFO : TestEnv : Target (00:02:f7:00:5d:d7) at IP address: 192.168.0.1\n",
552 …1:56:16,087 INFO : TestEnv : Waiting up to 360[s] for target [192.168.0.1] to reboot...\n",
553 …-12-12 11:57:21,143 INFO : TestEnv : Devlib modules to load: ['bl', 'hwmon', 'cpufreq']\n",
554 "2016-12-12 11:57:21,144 INFO : TestEnv : Connecting linux target:\n",
555 "2016-12-12 11:57:21,145 INFO : TestEnv : username : root\n",
556 "2016-12-12 11:57:21,146 INFO : TestEnv : host : 192.168.0.1\n",
557 "2016-12-12 11:57:21,146 INFO : TestEnv : password : juno\n",
558 "2016-12-12 11:57:21,147 INFO : TestEnv : Connection settings:\n",
559 …147 INFO : TestEnv : {'username': 'root', 'host': '192.168.0.1', 'password': 'juno'}\n",
560 "2016-12-12 11:57:37,176 INFO : TestEnv : Initializing target workdir:\n",
561 "2016-12-12 11:57:37,177 INFO : TestEnv : /root/devlib-target\n",
562 "2016-12-12 11:57:43,908 INFO : TestEnv : Topology:\n",
563 "2016-12-12 11:57:43,908 INFO : TestEnv : [[0, 3, 4, 5], [1, 2]]\n",
564 "2016-12-12 11:57:45,155 INFO : TestEnv : Loading default EM:\n",
565 …2-12 11:57:45,156 INFO : TestEnv : /home/vagrant/lisa/libs/utils/platforms/juno.json\n",
566 "2016-12-12 11:57:48,681 INFO : TestEnv : Enabled tracepoints:\n",
567 "2016-12-12 11:57:48,684 INFO : TestEnv : cpu_idle\n",
568 "2016-12-12 11:57:48,685 INFO : TestEnv : sched_switch\n",
569 …-12-12 11:57:48,688 INFO : EnergyMeter : Scanning for HWMON channels, may take some time...\n",
570 "2016-12-12 11:57:48,691 INFO : EnergyMeter : Channels selected for energy sampling:\n",
571 "2016-12-12 11:57:48,691 INFO : EnergyMeter : BOARDBIG_energy\n",
572 "2016-12-12 11:57:48,692 INFO : EnergyMeter : BOARDLITTLE_energy\n"
577 "# Force a reboot of the target (and wait specified [s] before reconnect)\n",
578 "# Keep in mind that a reboot can be disabled from __features__ in the target configuration\n",
593 "06:03:00 INFO : HostResolver - Target (00:02:F7:00:5A:5B) at IP address: 192.168.0.1\n"
608 "# Resolve a MAC address into an IP address\n",
623 "06:03:00 INFO : TFTP - Deploy /etc/group into /var/lib/tftpboot/group\n"
628 "# Copy the specified file into the TFTP server folder defined by configuration\n",
636 "\n",
637 "## Attributes: target\n",
638 "### Access to the devlib API\n",
639 "\n",
662 "# Run a command on the target\n",
663 "te.target.execute(\"echo -n 'Hello Test Environment'\", as_root=False)"
685 "# Spawn a command in background on the target\n",
700 "ABI : arm64\n",
701 "big Core Family : A57\n",
702 "LITTLE Core Family : A53\n",
703 "CPU's Clusters IDs : [0, 1, 1, 0, 0, 0]\n",
704 "CPUs type : ['A53', 'A57', 'A57', 'A53', 'A53', 'A53']\n"
709 "# Acces to many target specific information\n",
710 "print \"ABI : \", te.target.abi\n",
711 "print \"big Core Family : \", te.target.big_core\n",
712 "print \"LITTLE Core Family : \", te.target.little_core\n",
713 "print \"CPU's Clusters IDs : \", te.target.core_clusters\n",
728 "big CPUs IDs : [1, 2]\n",
729 "LITTLE CPUs IDs : [0, 3, 4, 5]\n",
730 "big CPUs freqs : 450000\n",
731 "big CPUs governor : interactive\n"
736 "# Access to big.LITTLE specific information\n",
737 "print \"big CPUs IDs : \", te.target.bl.bigs\n",
738 "print \"LITTLE CPUs IDs : \", te.target.bl.littles\n",
739 "print \"big CPUs freqs : {}\".format(te.target.bl.get_bigs_frequency())\n",
747 "## Attributes: emeter (energy meter)\n",
748 "\n",
764 "First read: {\n",
765 " \"BOARDBIG\": {\n",
766 " \"total\": 0.03712299999999935, \n",
767 " \"last\": 5.61159, \n",
768 " \"delta\": 0.019406000000000034\n",
769 " }, \n",
770 " \"BOARDLITTLE\": {\n",
771 " \"total\": 0.017602000000000118, \n",
772 " \"last\": 4.954883, \n",
773 " \"delta\": 0.008766999999999747\n",
774 " }\n",
775 "}\n",
776 "Second read: {\n",
777 " \"BOARDBIG\": {\n",
778 " \"total\": 0.11209199999999964, \n",
779 " \"last\": 5.686559, \n",
780 " \"delta\": 0.018203999999999887\n",
781 " }, \n",
782 " \"BOARDLITTLE\": {\n",
783 " \"total\": 0.06513600000000075, \n",
784 " \"last\": 5.002417, \n",
785 " \"delta\": 0.009789000000000492\n",
786 " }\n",
787 "}\n"
792 "# Reset and sample energy counters\n",
793 "te.emeter.reset()\n",
794 "nrg = te.emeter.sample()\n",
795 "nrg = json.dumps(te.emeter.sample(), indent=4)\n",
796 "print \"First read: \", nrg\n",
797 "time.sleep(2)\n",
798 "nrg = te.emeter.sample()\n",
799 "nrg = json.dumps(te.emeter.sample(), indent=4)\n",
807 "## Attribute: ftrace\n",
808 "\n",
823 "2016-12-12 11:58:44,190 INFO : TestEnv : Enabled tracepoints:\n",
824 "2016-12-12 11:58:44,192 INFO : TestEnv : cpu_idle\n",
825 "2016-12-12 11:58:44,193 INFO : TestEnv : cpu_capacity\n",
826 "2016-12-12 11:58:44,194 INFO : TestEnv : cpu_frequency\n",
827 "2016-12-12 11:58:44,194 INFO : TestEnv : sched_switch\n"
832 "# Configure a specific set of events to trace\n",
833 "te.ftrace_conf(\n",
834 … \n",
835 … \n",
836 … \n",
837 " \"cpu_capacity\",\n",
838 " \"cpu_frequency\",\n",
839 " \"sched_switch\",\n",
840 … \n",
841 … \n",
842 " }\n",
854 "# Start/Stop a FTrace session\n",
855 "te.ftrace.start()\n",
856 "te.target.execute(\"uname -a\")\n",
868 "# Collect and visualize the trace\n",
869 "trace_file = os.path.join(te.res_dir, 'trace.dat')\n",
870 "te.ftrace.get_trace(trace_file)\n",
871 "\n",
872 "# There might be a different display value on your machine\n",
873 "# Check by issuing \"echo $DISPLAY\" in the LISA VM\n",