blob: bd5dc9893b139b314d588700bd054077ea35a918 [file] [log] [blame]
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import logging\n",
"reload(logging)\n",
"logging.basicConfig(\n",
" format='%(asctime)-9s %(levelname)-8s: %(message)s',\n",
" datefmt='%I:%M:%S')\n",
"\n",
"# Enable logging at INFO level\n",
"logging.getLogger().setLevel(logging.INFO)\n",
"# Uncomment the following lines to enabled CGroups verbose logging\n",
"#logging.getLogger('cgroups').setLevel(logging.DEBUG)\n",
"#logging.getLogger('cgroups.cpuset').setLevel(logging.DEBUG)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import json\n",
"import operator\n",
"\n",
"import devlib\n",
"import trappy\n",
"import bart\n",
"\n",
"from bart.sched.SchedMultiAssert import SchedMultiAssert\n",
"from wlgen import RTA, Periodic"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Global configuration"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Host side results folder\n",
"RESULTS_DIR = '/tmp/schedtest'\n",
"\n",
"# Taerget side temporary folder\n",
"TARGET_DIR = '/root/schedtest'\n",
"\n",
"# List of tools to install on the target system\n",
"TOOLS = [\"rt-app\", \"trace-cmd\", \"taskset\", \"cgroup_run_into.sh\"]\n",
"\n",
"# List of modules to enable\n",
"MODULES = ['cgroups', 'bl']"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Target connection"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06:38:54 INFO : Target - Using base path: /home/derkling/Code/lisa\n",
"06:38:54 INFO : Target - Loading custom (inline) target configuration\n",
"06:38:54 INFO : Target - Loading custom (inline) test configuration\n",
"06:38:54 INFO : Target - Devlib modules to load: ['bl', 'cpufreq', 'cgroups', 'hwmon']\n",
"06:38:54 INFO : Target - Connecting linux target:\n",
"06:38:54 INFO : Target - username : root\n",
"06:38:54 INFO : Target - host : 192.168.0.1\n",
"06:38:54 INFO : Target - password : \n",
"06:39:44 INFO : Target - Initializing target workdir:\n",
"06:39:44 INFO : Target - /root/devlib-target\n",
"06:39:53 INFO : Target - Topology:\n",
"06:39:53 INFO : Target - [[0, 3, 4, 5], [1, 2]]\n",
"06:39:55 INFO : Platform - Loading default EM:\n",
"06:39:55 INFO : Platform - /home/derkling/Code/lisa/libs/utils/platforms/juno.json\n",
"06:39:57 INFO : FTrace - Enabled tracepoints:\n",
"06:39:57 INFO : FTrace - sched_switch\n",
"06:39:57 INFO : EnergyMeter - Scanning for HWMON channels, may take some time...\n",
"06:39:57 INFO : EnergyMeter - Channels selected for energy sampling:\n",
"06:39:57 INFO : EnergyMeter - a57_energy\n",
"06:39:57 INFO : EnergyMeter - a53_energy\n",
"06:39:57 WARNING : Target - Using configuration provided RTApp calibration\n",
"06:39:57 INFO : Target - Using RT-App calibration values:\n",
"06:39:57 INFO : Target - {\"0\": 363, \"1\": 138, \"2\": 139, \"3\": 352, \"4\": 353, \"5\": 361}\n",
"06:39:57 INFO : TestEnv - Set results folder to:\n",
"06:39:57 INFO : TestEnv - /home/derkling/Code/lisa/results/20160225_183957\n",
"06:39:57 INFO : TestEnv - Experiment results available also in:\n",
"06:39:57 INFO : TestEnv - /home/derkling/Code/lisa/results_latest\n",
"06:39:57 INFO : Connected to arm64 target\n"
]
}
],
"source": [
"from env import TestEnv\n",
"\n",
"my_target_conf = {\n",
" \"platform\" : \"linux\",\n",
" \"board\" : \"juno\",\n",
" \"host\" : \"192.168.0.1\",\n",
" \"username\" : \"root\",\n",
" \"password\" : \"\",\n",
" \"rtapp-calib\" : {\n",
" '0': 363, '1': 138, '2': 139, '3': 352, '4': 353, '5': 361\n",
" },\n",
"}\n",
"\n",
"# Setup the required Test Environment supports\n",
"my_tests_conf = {\n",
" # list of additional devlib modules to install \n",
" \"modules\" : ['cgroups', 'bl', 'cpufreq'],\n",
" # list of additional binary tools to install\n",
" \"tools\" : ['rt-app', 'trace-cmd', 'cgroup_run_into.sh'],\n",
" \"ftrace\" : {\n",
" \"events\" : [\n",
" \"sched_switch\"\n",
" ],\n",
" \"buffsize\" : 10240\n",
" }\n",
"}\n",
"\n",
"te = TestEnv(target_conf=my_target_conf, test_conf=my_tests_conf)\n",
"target = te.target\n",
"\n",
"# Report target connection\n",
"logging.info('Connected to %s target', target.abi)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## List available Controllers"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06:39:57 INFO : CGroup - Available controllers:\n",
"06:39:57 INFO : CGroup - cpuset (hierarchy id: 1) has 2 cgroups\n",
"06:39:57 INFO : CGroup - cpu (hierarchy id: 2) has 2 cgroups\n",
"06:39:57 INFO : CGroup - schedtune (hierarchy id: 3) has 1 cgroups\n",
"06:39:57 INFO : CGroup - memory (hierarchy id: 4) has 1 cgroups\n",
"06:39:57 INFO : CGroup - devices (hierarchy id: 5) has 1 cgroups\n",
"06:39:57 INFO : CGroup - freezer (hierarchy id: 6) has 1 cgroups\n",
"06:39:57 INFO : CGroup - perf_event (hierarchy id: 7) has 1 cgroups\n",
"06:39:57 INFO : CGroup - hugetlb (hierarchy id: 8) has 1 cgroups\n",
"06:39:57 INFO : CGroup - pids (hierarchy id: 9) has 1 cgroups\n"
]
}
],
"source": [
"logging.info('%14s - Available controllers:', 'CGroup')\n",
"ssys = target.cgroups.list_subsystems()\n",
"for (n,h,g,e) in ssys:\n",
" logging.info('%14s - %10s (hierarchy id: %d) has %d cgroups',\n",
" 'CGroup', n, h, g)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example of CPUSET controller usage"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Get a reference to the CPUSet controller\n",
"cpuset = target.cgroups.controller('cpuset')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06:39:58 INFO : Existing CGropups:\n",
"06:39:58 INFO : /\n",
"06:39:58 INFO : /LITTLE\n"
]
}
],
"source": [
"# Get the list of current configured CGroups for that controller\n",
"cgroups = cpuset.list_all()\n",
"logging.info('Existing CGropups:')\n",
"for cg in cgroups:\n",
" logging.info(' %s', cg)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06:39:58 INFO : cpuset:/ cpus: 0-5\n",
"06:39:59 INFO : cpuset:/LITTLE cpus: 0,3-5\n"
]
}
],
"source": [
"# Dump the configuraiton of each controller\n",
"for cgname in cgroups:\n",
" cgroup = cpuset.cgroup(cgname)\n",
" attrs = cgroup.get()\n",
" cpus = attrs['cpus']\n",
" logging.info('%s:%-15s cpus: %s', cpuset.kind, cgroup.name, cpus)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Create a LITTLE partition\n",
"cpuset_littles = cpuset.cgroup('/LITTLE')"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"LITTLE:\n",
"{\n",
" \"cpu_exclusive\": \"0\", \n",
" \"memory_spread_page\": \"0\", \n",
" \"sched_load_balance\": \"1\", \n",
" \"cpus\": \"0,3-5\", \n",
" \"effective_mems\": \"0\", \n",
" \"mem_hardwall\": \"0\", \n",
" \"mem_exclusive\": \"0\", \n",
" \"memory_pressure\": \"0\", \n",
" \"effective_cpus\": \"0,3-5\", \n",
" \"mems\": \"0\", \n",
" \"sched_relax_domain_level\": \"-1\", \n",
" \"memory_migrate\": \"0\", \n",
" \"memory_spread_slab\": \"0\"\n",
"}\n"
]
}
],
"source": [
"# Check the attributes available for this control group\n",
"print \"LITTLE:\\n\", json.dumps(cpuset_littles.get(), indent=4)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"LITTLE:\n",
"{\n",
" \"cpu_exclusive\": \"0\", \n",
" \"memory_spread_page\": \"0\", \n",
" \"sched_load_balance\": \"1\", \n",
" \"cpus\": \"0,3-5\", \n",
" \"effective_mems\": \"0\", \n",
" \"mem_hardwall\": \"0\", \n",
" \"mem_exclusive\": \"0\", \n",
" \"memory_pressure\": \"0\", \n",
" \"effective_cpus\": \"0,3-5\", \n",
" \"mems\": \"0\", \n",
" \"sched_relax_domain_level\": \"-1\", \n",
" \"memory_migrate\": \"0\", \n",
" \"memory_spread_slab\": \"0\"\n",
"}\n"
]
}
],
"source": [
"# Tune CPUs and MEMs attributes\n",
"# they must be initialize for the group to be usable\n",
"cpuset_littles.set(cpus=target.bl.littles, mems=0)\n",
"print \"LITTLE:\\n\", json.dumps(cpuset_littles.get(), indent=4)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06:40:01 INFO : WlGen - Setup new workload simple\n",
"06:40:01 INFO : RTApp - Workload duration defined by longest task\n",
"06:40:01 INFO : RTApp - Default policy: SCHED_OTHER\n",
"06:40:01 INFO : RTApp - ------------------------\n",
"06:40:01 INFO : RTApp - task [task0], sched: using default policy\n",
"06:40:01 INFO : RTApp - | calibration CPU: 1\n",
"06:40:01 INFO : RTApp - | loops count: 1\n",
"06:40:01 INFO : RTApp - + phase_000001: duration 5.000000 [s] (50 loops)\n",
"06:40:01 INFO : RTApp - | period 100000 [us], duty_cycle 80 %\n",
"06:40:01 INFO : RTApp - | run_time 80000 [us], sleep_time 20000 [us]\n",
"06:40:01 INFO : RTApp - ------------------------\n",
"06:40:01 INFO : RTApp - task [task1], sched: using default policy\n",
"06:40:01 INFO : RTApp - | calibration CPU: 1\n",
"06:40:01 INFO : RTApp - | loops count: 1\n",
"06:40:01 INFO : RTApp - + phase_000001: duration 5.000000 [s] (50 loops)\n",
"06:40:01 INFO : RTApp - | period 100000 [us], duty_cycle 80 %\n",
"06:40:01 INFO : RTApp - | run_time 80000 [us], sleep_time 20000 [us]\n",
"06:40:01 INFO : RTApp - ------------------------\n",
"06:40:01 INFO : RTApp - task [task2], sched: using default policy\n",
"06:40:01 INFO : RTApp - | calibration CPU: 1\n",
"06:40:01 INFO : RTApp - | loops count: 1\n",
"06:40:01 INFO : RTApp - + phase_000001: duration 5.000000 [s] (50 loops)\n",
"06:40:01 INFO : RTApp - | period 100000 [us], duty_cycle 80 %\n",
"06:40:01 INFO : RTApp - | run_time 80000 [us], sleep_time 20000 [us]\n",
"06:40:01 INFO : RTApp - ------------------------\n",
"06:40:01 INFO : RTApp - task [task3], sched: using default policy\n",
"06:40:01 INFO : RTApp - | calibration CPU: 1\n",
"06:40:01 INFO : RTApp - | loops count: 1\n",
"06:40:01 INFO : RTApp - + phase_000001: duration 5.000000 [s] (50 loops)\n",
"06:40:01 INFO : RTApp - | period 100000 [us], duty_cycle 80 %\n",
"06:40:01 INFO : RTApp - | run_time 80000 [us], sleep_time 20000 [us]\n",
"06:40:01 INFO : RTApp - ------------------------\n",
"06:40:01 INFO : RTApp - task [task4], sched: using default policy\n",
"06:40:01 INFO : RTApp - | calibration CPU: 1\n",
"06:40:01 INFO : RTApp - | loops count: 1\n",
"06:40:01 INFO : RTApp - + phase_000001: duration 5.000000 [s] (50 loops)\n",
"06:40:01 INFO : RTApp - | period 100000 [us], duty_cycle 80 %\n",
"06:40:01 INFO : RTApp - | run_time 80000 [us], sleep_time 20000 [us]\n",
"06:40:01 INFO : RTApp - ------------------------\n",
"06:40:01 INFO : RTApp - task [task5], sched: using default policy\n",
"06:40:01 INFO : RTApp - | calibration CPU: 1\n",
"06:40:01 INFO : RTApp - | loops count: 1\n",
"06:40:01 INFO : RTApp - + phase_000001: duration 5.000000 [s] (50 loops)\n",
"06:40:01 INFO : RTApp - | period 100000 [us], duty_cycle 80 %\n",
"06:40:01 INFO : RTApp - | run_time 80000 [us], sleep_time 20000 [us]\n"
]
}
],
"source": [
"# Define a periodic big (80%) task\n",
"task = Periodic(\n",
" period_ms=100,\n",
" duty_cycle_pct=80,\n",
" duration_s=5).get()\n",
"\n",
"# Create one task per each CPU in the target\n",
"tasks={}\n",
"for tid in enumerate(target.core_names):\n",
" tasks['task{}'.format(tid[0])] = task\n",
"\n",
"# Configure RTA to run all these tasks\n",
"rtapp = RTA(target, 'simple', calibration=te.calibration())\n",
"rtapp.conf(kind='profile', params=tasks, run_dir=TARGET_DIR);"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06:40:05 INFO : WlGen - Workload execution START:\n",
"06:40:05 INFO : WlGen - /root/devlib-target/bin/cgroup_run_into.sh /LITTLE '/root/devlib-target/bin/rt-app /root/schedtest/simple_00.json'\n",
"06:42:13 INFO : WlGen - Pulling trace file into [/home/derkling/Code/lisa/results/20160225_183957/simple_00.dat]...\n"
]
}
],
"source": [
"# Test execution of all these tasks into the LITTLE cluster\n",
"trace = rtapp.run(ftrace=te.ftrace, cgroup=cpuset_littles.name, out_dir=te.res_dir)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
{
"data": {
"text/html": [
"<style>\n",
"/*\n",
"\n",
" * Copyright 2015-2016 ARM Limited\n",
"\n",
" *\n",
"\n",
" * Licensed under the Apache License, Version 2.0 (the \"License\");\n",
"\n",
" * you may not use this file except in compliance with the License.\n",
"\n",
" * You may obtain a copy of the License at\n",
"\n",
" *\n",
"\n",
" * http://www.apache.org/licenses/LICENSE-2.0\n",
"\n",
" *\n",
"\n",
" * Unless required by applicable law or agreed to in writing, software\n",
"\n",
" * distributed under the License is distributed on an \"AS IS\" BASIS,\n",
"\n",
" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
"\n",
" * See the License for the specific language governing permissions and\n",
"\n",
" * limitations under the License.\n",
"\n",
" */\n",
"\n",
"\n",
"\n",
".d3-tip {\n",
"\n",
" line-height: 1;\n",
"\n",
" padding: 12px;\n",
"\n",
" background: rgba(0, 0, 0, 0.6);\n",
"\n",
" color: #fff;\n",
"\n",
" border-radius: 2px;\n",
"\n",
" position: absolute !important;\n",
"\n",
" z-index: 99999;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".d3-tip:after {\n",
"\n",
" box-sizing: border-box;\n",
"\n",
" pointer-events: none;\n",
"\n",
" display: inline;\n",
"\n",
" font-size: 10px;\n",
"\n",
" width: 100%;\n",
"\n",
" line-height: 1;\n",
"\n",
" color: rgba(0, 0, 0, 0.6);\n",
"\n",
" content: \"\\25BC\";\n",
"\n",
" position: absolute !important;\n",
"\n",
" z-index: 99999;\n",
"\n",
" text-align: center;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".d3-tip.n:after {\n",
"\n",
" margin: -1px 0 0 0;\n",
"\n",
" top: 100%;\n",
"\n",
" left: 0;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".contextRect {\n",
"\n",
" fill: lightgray;\n",
"\n",
" fill-opacity: 0.5;\n",
"\n",
" stroke: black;\n",
"\n",
" stroke-width: 1;\n",
"\n",
" stroke-opacity: 1;\n",
"\n",
" pointer-events: none;\n",
"\n",
" shape-rendering: crispEdges;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".chart {\n",
"\n",
" shape-rendering: crispEdges;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".mini text {\n",
"\n",
" font: 9px sans-serif;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".main text {\n",
"\n",
" font: 12px sans-serif;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".axis line, .axis path {\n",
"\n",
" stroke: black;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".miniItem {\n",
"\n",
" stroke-width: 8;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".brush .extent {\n",
"\n",
"\n",
"\n",
" stroke: #000;\n",
"\n",
" fill-opacity: .125;\n",
"\n",
" shape-rendering: crispEdges;\n",
"\n",
"}\n",
"\n",
"</style>\n",
"<div id=\"fig_3a0017f427324250b414474e65e22dbb\" class=\"eventplot\">\n",
" <script>\n",
" var req = require.config( {\n",
"\n",
" paths: {\n",
"\n",
" \"EventPlot\": '/nbextensions/plotter_scripts/EventPlot/EventPlot',\n",
" \"d3-tip\": '/nbextensions/plotter_scripts/EventPlot/d3.tip.v0.6.3',\n",
" \"d3-plotter\": '/nbextensions/plotter_scripts/EventPlot/d3.min'\n",
" },\n",
" shim: {\n",
" \"d3-plotter\" : {\n",
" \"exports\" : \"d3\"\n",
" },\n",
" \"d3-tip\": [\"d3-plotter\"],\n",
" \"EventPlot\": {\n",
"\n",
" \"deps\": [\"d3-tip\", \"d3-plotter\" ],\n",
" \"exports\": \"EventPlot\"\n",
" }\n",
" }\n",
" });\n",
" req([\"require\", \"EventPlot\"], function() {\n",
" EventPlot.generate('fig_3a0017f427324250b414474e65e22dbb', '/nbextensions/');\n",
" });\n",
" </script>\n",
" </div>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Check tasks residency on little clsuter\n",
"trappy.plotter.plot_trace(trace)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\n",
" \"2798\": {\n",
" \"residency\": 100.0, \n",
" \"task_name\": \"rt-app\"\n",
" }, \n",
" \"2799\": {\n",
" \"residency\": 100.0, \n",
" \"task_name\": \"rt-app\"\n",
" }, \n",
" \"2800\": {\n",
" \"residency\": 100.0, \n",
" \"task_name\": \"rt-app\"\n",
" }, \n",
" \"2801\": {\n",
" \"residency\": 100.0, \n",
" \"task_name\": \"rt-app\"\n",
" }, \n",
" \"2802\": {\n",
" \"residency\": 100.0, \n",
" \"task_name\": \"rt-app\"\n",
" }, \n",
" \"2803\": {\n",
" \"residency\": 100.0, \n",
" \"task_name\": \"rt-app\"\n",
" }\n",
"}\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/derkling/Code/lisa/libs/trappy/trappy/__init__.py:48: UserWarning: The Run object is deprecated. Use trappy.FTrace instead\n",
" warnings.warn(\"The Run object is deprecated. Use trappy.FTrace instead\")\n"
]
}
],
"source": [
"# Compute and visualize tasks residencies on LITTLE clusterh CPUs\n",
"s = SchedMultiAssert(trappy.Run(trace), te.topology, execnames=\"task\")\n",
"residencies = s.getResidency('cluster', target.bl.littles, percent=True)\n",
"print json.dumps(residencies, indent=4)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Assert that ALL tasks have always executed only on LITTLE cluster\n",
"s.assertResidency('cluster', target.bl.littles,\n",
" 99.9, operator.ge, percent=True, rank=len(residencies))"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example of CPU controller usage"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Get a reference to the CPU controller\n",
"cpu = target.cgroups.controller('cpu')"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Create a big partition on that CPUS\n",
"cpu_littles = cpu.cgroup('/LITTLE')"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"LITTLE:\n",
"{\n",
" \"stat\": \"throttled_time 924635127680\", \n",
" \"cfs_period_us\": \"100000\", \n",
" \"shares\": \"1024\", \n",
" \"cfs_quota_us\": \"50000\"\n",
"}\n"
]
}
],
"source": [
"# Check the attributes available for this control group\n",
"print \"LITTLE:\\n\", json.dumps(cpu_littles.get(), indent=4)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"LITTLE:\n",
"{\n",
" \"stat\": \"throttled_time 924635127680\", \n",
" \"cfs_period_us\": \"100000\", \n",
" \"shares\": \"1024\", \n",
" \"cfs_quota_us\": \"50000\"\n",
"}\n"
]
}
],
"source": [
"# Set a 1CPU equivalent bandwidth for that CGroup\n",
"cpu_littles.set(cfs_period_us=100000, cfs_quota_us=50000)\n",
"print \"LITTLE:\\n\", json.dumps(cpu_littles.get(), indent=4)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06:42:24 INFO : WlGen - Workload execution START:\n",
"06:42:24 INFO : WlGen - /root/devlib-target/bin/cgroup_run_into.sh /LITTLE '/root/devlib-target/bin/rt-app /root/schedtest/simple_00.json'\n",
"06:44:32 INFO : WlGen - Pulling trace file into [.//simple_00.dat]...\n"
]
}
],
"source": [
"# Test execution of all these tasks into the LITTLE cluster\n",
"trace = rtapp.run(ftrace=te.ftrace, cgroup=cpu_littles.name)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<style>\n",
"/*\n",
"\n",
" * Copyright 2015-2016 ARM Limited\n",
"\n",
" *\n",
"\n",
" * Licensed under the Apache License, Version 2.0 (the \"License\");\n",
"\n",
" * you may not use this file except in compliance with the License.\n",
"\n",
" * You may obtain a copy of the License at\n",
"\n",
" *\n",
"\n",
" * http://www.apache.org/licenses/LICENSE-2.0\n",
"\n",
" *\n",
"\n",
" * Unless required by applicable law or agreed to in writing, software\n",
"\n",
" * distributed under the License is distributed on an \"AS IS\" BASIS,\n",
"\n",
" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
"\n",
" * See the License for the specific language governing permissions and\n",
"\n",
" * limitations under the License.\n",
"\n",
" */\n",
"\n",
"\n",
"\n",
".d3-tip {\n",
"\n",
" line-height: 1;\n",
"\n",
" padding: 12px;\n",
"\n",
" background: rgba(0, 0, 0, 0.6);\n",
"\n",
" color: #fff;\n",
"\n",
" border-radius: 2px;\n",
"\n",
" position: absolute !important;\n",
"\n",
" z-index: 99999;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".d3-tip:after {\n",
"\n",
" box-sizing: border-box;\n",
"\n",
" pointer-events: none;\n",
"\n",
" display: inline;\n",
"\n",
" font-size: 10px;\n",
"\n",
" width: 100%;\n",
"\n",
" line-height: 1;\n",
"\n",
" color: rgba(0, 0, 0, 0.6);\n",
"\n",
" content: \"\\25BC\";\n",
"\n",
" position: absolute !important;\n",
"\n",
" z-index: 99999;\n",
"\n",
" text-align: center;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".d3-tip.n:after {\n",
"\n",
" margin: -1px 0 0 0;\n",
"\n",
" top: 100%;\n",
"\n",
" left: 0;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".contextRect {\n",
"\n",
" fill: lightgray;\n",
"\n",
" fill-opacity: 0.5;\n",
"\n",
" stroke: black;\n",
"\n",
" stroke-width: 1;\n",
"\n",
" stroke-opacity: 1;\n",
"\n",
" pointer-events: none;\n",
"\n",
" shape-rendering: crispEdges;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".chart {\n",
"\n",
" shape-rendering: crispEdges;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".mini text {\n",
"\n",
" font: 9px sans-serif;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".main text {\n",
"\n",
" font: 12px sans-serif;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".axis line, .axis path {\n",
"\n",
" stroke: black;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".miniItem {\n",
"\n",
" stroke-width: 8;\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
".brush .extent {\n",
"\n",
"\n",
"\n",
" stroke: #000;\n",
"\n",
" fill-opacity: .125;\n",
"\n",
" shape-rendering: crispEdges;\n",
"\n",
"}\n",
"\n",
"</style>\n",
"<div id=\"fig_b97e2a6f1c344cc08deea486cf95b683\" class=\"eventplot\">\n",
" <script>\n",
" var req = require.config( {\n",
"\n",
" paths: {\n",
"\n",
" \"EventPlot\": '/nbextensions/plotter_scripts/EventPlot/EventPlot',\n",
" \"d3-tip\": '/nbextensions/plotter_scripts/EventPlot/d3.tip.v0.6.3',\n",
" \"d3-plotter\": '/nbextensions/plotter_scripts/EventPlot/d3.min'\n",
" },\n",
" shim: {\n",
" \"d3-plotter\" : {\n",
" \"exports\" : \"d3\"\n",
" },\n",
" \"d3-tip\": [\"d3-plotter\"],\n",
" \"EventPlot\": {\n",
"\n",
" \"deps\": [\"d3-tip\", \"d3-plotter\" ],\n",
" \"exports\": \"EventPlot\"\n",
" }\n",
" }\n",
" });\n",
" req([\"require\", \"EventPlot\"], function() {\n",
" EventPlot.generate('fig_b97e2a6f1c344cc08deea486cf95b683', '/nbextensions/');\n",
" });\n",
" </script>\n",
" </div>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Check tasks residency on little clsuter\n",
"trappy.plotter.plot_trace(trace)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}