From 129d1b6112d17897e638cba3b71381fe393a2453 Mon Sep 17 00:00:00 2001 From: Chris Redpath Date: Fri, 16 Sep 2016 10:45:34 +0100 Subject: [PATCH 1/2] wlgen: Improve custom rtapp workload generation support Allow custom workloads to be defined with a filename or by supplying the configuration directly. Signed-off-by: Chris Redpath --- libs/wlgen/wlgen/rta.py | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/libs/wlgen/wlgen/rta.py b/libs/wlgen/wlgen/rta.py index 1b792ffe9..907e8ac16 100644 --- a/libs/wlgen/wlgen/rta.py +++ b/libs/wlgen/wlgen/rta.py @@ -266,7 +266,6 @@ class RTA(Workload): self.json = '{0:s}_{1:02d}.json'.format(self.name, self.exc_id) ofile = open(self.json, 'w') - ifile = open(self.params['custom'], 'r') replacements = { '__DURATION__' : str(self.duration), '__PVALUE__' : str(calibration), @@ -274,11 +273,22 @@ class RTA(Workload): '__WORKDIR__' : '"'+self.target.working_directory+'"', } + # check for inline config + if 'custom_config' in self.params['custom']: + # inline config present, turn it into a file repr so we can parse the same + tmp_json = json.dumps(self.params['custom']['custom_config'], indent=4, separators=(',', ': '), sort_keys=True) + ifile = tmp_json.split('\n') + else: + # open the supplied filename + ifile = open(self.params['custom']['custom_filename'], 'r') + for line in ifile: for src, target in replacements.iteritems(): line = line.replace(src, target) + print "line: {}".format(line) ofile.write(line) - ifile.close() + if not 'custom_config' in self.params['custom']: + ifile.close() ofile.close() return self.json @@ -472,6 +482,30 @@ class RTA(Workload): Custom workloads ---------------- + When 'kind' is 'custom', you can supply existing rt-app json either + directly or by supplying a file name. + To use a task definition stored in a file, pass the file name + as 'custom_filename' inside the 'params' member. Note that the filename + is relative to the current directory. + To supply json directly, assign the variable content to 'custom_config' + inside the 'params' member. + Only one of these will be used - if 'custom_config' is present, then + 'custom_filename' will be ignored. + + This allows you to reuse the push/run-test/pull functionality with + more complex application models not covered by the workload generator. + + For example, to create an RTA wrapper for an existing rt-app task + description stored in a file whose name is held in a variable called + 'filename': + + generated_file_name = rtapp.conf( + kind='custom', + duration=-1, + params={ + 'custom_filename' : "{}".format(filename) + }, + run_dir='/data/local/tmp' ) Profile based workloads -- GitLab From ca1522896eef160aedfafa20cd452b59ba10b50c Mon Sep 17 00:00:00 2001 From: Chris Redpath Date: Fri, 16 Sep 2016 10:47:15 +0100 Subject: [PATCH 2/2] Custom workload example Create a simulated 'performance benchmark application' using RTA which has one controller thread which triggers a configurable amount of worker threads for a configurable amount of time. This is similar to what applications like geekbench look like during their benchmark phases. Signed-off-by: Chris Redpath --- ipynb/wlgen/rtapp_custom_example.ipynb | 1312 ++++++++++++++++++++++++ 1 file changed, 1312 insertions(+) create mode 100644 ipynb/wlgen/rtapp_custom_example.ipynb diff --git a/ipynb/wlgen/rtapp_custom_example.ipynb b/ipynb/wlgen/rtapp_custom_example.ipynb new file mode 100644 index 000000000..cf52bc2c3 --- /dev/null +++ b/ipynb/wlgen/rtapp_custom_example.ipynb @@ -0,0 +1,1312 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "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.DEBUG)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Populating the interactive namespace from numpy and matplotlib\n" + ] + } + ], + "source": [ + "# Generate plots inline\n", + "%pylab inline\n", + "\n", + "import json\n", + "import os\n", + "\n", + "# Support to access the remote target\n", + "import devlib\n", + "from env import TestEnv\n", + "\n", + "# Support for FTrace events parsing and visualization\n", + "import trappy\n", + "\n", + "# Support to configure and run RTApp based workloads\n", + "from wlgen import RTA, Ramp, Step, Pulse, Periodic" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Test environment setup" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "10:17:20 INFO : Target - Using base path: /data/work/juno/lisa\n", + "10:17:20 INFO : Target - Loading custom (inline) target configuration\n", + "10:17:20 DEBUG : Target - Target configuration {'username': 'root', 'platform': 'android', 'host': '10.1.210.36', 'ftrace': {'buffsize': 10240, 'events': ['sched_switch', 'cpu_frequency']}, 'board': 'juno2', 'rtapp-calib': {'1': 124, '0': 323, '3': 319, '2': 125, '5': 315, '4': 315}, 'password': '', 'tools': ['rt-app', 'taskset', 'trace-cmd']}\n", + "10:17:20 INFO : Target - Devlib modules to load: ['bl', 'hwmon', 'cpufreq']\n", + "10:17:20 INFO : Target - Connecting Android target [10.1.210.36:5555]\n", + "10:17:20 INFO : Target - Connection settings:\n", + "10:17:20 INFO : Target - {'device': '10.1.210.36:5555'}\n", + "10:17:20 DEBUG : Target - Setup ANDROID target...\n", + "10:17:20 DEBUG : Installing module vexpress-u-boot\n", + "10:17:20 DEBUG : Installing module vexpress-dtr\n", + "10:17:20 DEBUG : Installing module vexpress-vemsd\n", + "10:17:20 DEBUG : Discovering ANDROID_HOME from adb path.\n", + "10:17:20 DEBUG : ANDROID_HOME: /work/android-sdk-linux\n", + "10:17:20 DEBUG : Using aapt for version 23.0.2\n", + "10:17:20 DEBUG : adb disconnect 10.1.210.36:5555\n", + "10:17:20 DEBUG : adb connect 10.1.210.36:5555\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"ls / > /dev/null\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell '(ls); echo \"\n", + "$?\"'\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"if [ -e '/data/local/tmp/bin' ]; then echo 1; else echo 0; fi\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"ls /data/local/tmp/bin\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"cat /proc/cpuinfo\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"getprop\"\n", + "10:17:20 DEBUG : Installing module bl\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"if [ -e '/sys/class/hwmon' ]; then echo 1; else echo 0; fi\"\n", + "10:17:20 DEBUG : Installing module hwmon\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"ls /sys/class/hwmon\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"if [ -e '/sys/class/hwmon/hwmon0/name' ]; then echo 1; else echo 0; fi\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"id\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/name'\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"ls /sys/class/hwmon/hwmon0/\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/curr1_label'\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/curr2_label'\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/curr3_label'\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/curr4_label'\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/energy1_label'\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/energy2_label'\"\n", + "10:17:20 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/energy3_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/energy4_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/in0_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/in1_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/in2_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/in3_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/in4_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/in5_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/in6_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/power1_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/power2_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/power3_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/power4_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/temp1_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/temp2_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/temp3_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/temp4_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/temp5_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/temp6_label'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"if [ -e '/sys/class/hwmon/hwmon1/name' ]; then echo 1; else echo 0; fi\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon1/name'\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"ls /sys/class/hwmon/hwmon1/\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"getprop\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"if [ -e '/sys/devices/system/cpu/cpufreq' ]; then echo 1; else echo 0; fi\"\n", + "10:17:21 DEBUG : Installing module cpufreq\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"getprop\"\n", + "10:17:21 DEBUG : Target - Checking target connection...\n", + "10:17:21 DEBUG : Target - Target info:\n", + "10:17:21 DEBUG : Target - ABI: arm64\n", + "10:17:21 DEBUG : Target - CPUs: CpuInfo(['A53', 'A72', 'A72', 'A53', 'A53', 'A53'])\n", + "10:17:21 DEBUG : Target - Clusters: [0, 1, 1, 0, 0, 0]\n", + "10:17:21 INFO : Target - Initializing target workdir:\n", + "10:17:21 INFO : Target - /data/local/tmp/devlib-target\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"mkdir -p /data/local/tmp/devlib-target\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"mkdir -p /data/local/tmp/bin\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 shell \"mount\"\n", + "10:17:21 DEBUG : adb -s 10.1.210.36:5555 push '/data/work/juno/lisa/libs/devlib/devlib/bin/arm64/busybox' '/data/local/tmp/devlib-target/busybox'\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"cp /data/local/tmp/devlib-target/busybox /data/local/tmp/bin/busybox\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"rm -rf /data/local/tmp/devlib-target/busybox\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"chmod 0777 '/data/local/tmp/bin/busybox'\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"mount\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 push '/data/work/juno/lisa/libs/devlib/devlib/bin/scripts/shutils' '/data/local/tmp/devlib-target/shutils'\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"cp /data/local/tmp/devlib-target/shutils /data/local/tmp/bin/shutils\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"rm -rf /data/local/tmp/devlib-target/shutils\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"chmod 0777 '/data/local/tmp/bin/shutils'\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"mount\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 push '/data/work/juno/lisa/tools/scripts/cgroup_run_into.sh' '/data/local/tmp/devlib-target/cgroup_run_into.sh'\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"cp /data/local/tmp/devlib-target/cgroup_run_into.sh /data/local/tmp/bin/cgroup_run_into.sh\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"rm -rf /data/local/tmp/devlib-target/cgroup_run_into.sh\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"chmod 0777 '/data/local/tmp/bin/cgroup_run_into.sh'\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 shell \"mount\"\n", + "10:17:22 DEBUG : adb -s 10.1.210.36:5555 push '/data/work/juno/lisa/tools/arm64/perf' '/data/local/tmp/devlib-target/perf'\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"cp /data/local/tmp/devlib-target/perf /data/local/tmp/bin/perf\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"rm -rf /data/local/tmp/devlib-target/perf\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"chmod 0777 '/data/local/tmp/bin/perf'\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"mount\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 push '/data/work/juno/lisa/tools/arm64/taskset' '/data/local/tmp/devlib-target/taskset'\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"cp /data/local/tmp/devlib-target/taskset /data/local/tmp/bin/taskset\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"rm -rf /data/local/tmp/devlib-target/taskset\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"chmod 0777 '/data/local/tmp/bin/taskset'\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"mount\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 push '/data/work/juno/lisa/tools/arm64/rt-app' '/data/local/tmp/devlib-target/rt-app'\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"cp /data/local/tmp/devlib-target/rt-app /data/local/tmp/bin/rt-app\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"rm -rf /data/local/tmp/devlib-target/rt-app\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"chmod 0777 '/data/local/tmp/bin/rt-app'\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"mount\"\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 push '/data/work/juno/lisa/tools/arm64/trace-cmd' '/data/local/tmp/devlib-target/trace-cmd'\n", + "10:17:23 DEBUG : adb -s 10.1.210.36:5555 shell \"cp /data/local/tmp/devlib-target/trace-cmd /data/local/tmp/bin/trace-cmd\"\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"rm -rf /data/local/tmp/devlib-target/trace-cmd\"\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"chmod 0777 '/data/local/tmp/bin/trace-cmd'\"\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"mkdir -p /data/local/tmp/devlib-target/.file-cache\"\n", + "10:17:24 DEBUG : Target - Check for module [bl]...\n", + "10:17:24 DEBUG : Target - Check for module [hwmon]...\n", + "10:17:24 DEBUG : Target - Check for module [cpufreq]...\n", + "10:17:24 INFO : Target - Topology:\n", + "10:17:24 INFO : Target - [[0, 3, 4, 5], [1, 2]]\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/online'\"\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies\"\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/online'\"\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_available_frequencies\"\n", + "10:17:24 DEBUG : Platform - Trying to load default EM from /data/work/juno/lisa/libs/utils/platforms/juno2.json\n", + "10:17:24 DEBUG : Platform - Platform descriptor initialized\n", + "{'nrg_model': None, 'clusters': {'big': [1, 2], 'little': [0, 3, 4, 5]}, 'cpus_count': 6, 'freqs': {'big': [600000, 1000000, 1200000], 'little': [450000, 800000, 950000]}, 'topology': [[0, 3, 4, 5], [1, 2]]}\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"mount\"\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 push '/data/work/juno/lisa/libs/devlib/devlib/bin/arm64/trace-cmd' '/data/local/tmp/devlib-target/trace-cmd'\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"cp /data/local/tmp/devlib-target/trace-cmd /data/local/tmp/bin/trace-cmd\"\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"rm -rf /data/local/tmp/devlib-target/trace-cmd\"\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"chmod 0777 '/data/local/tmp/bin/trace-cmd'\"\n", + "10:17:24 DEBUG : adb -s 10.1.210.36:5555 shell \"cat /sys/kernel/debug/tracing/available_events\"\n", + "10:17:24 INFO : FTrace - Enabled tracepoints:\n", + "10:17:24 INFO : FTrace - sched_switch\n", + "10:17:24 INFO : FTrace - cpu_frequency\n", + "10:17:24 WARNING : Target - Using configuration provided RTApp calibration\n", + "10:17:24 INFO : Target - Using RT-App calibration values:\n", + "10:17:24 INFO : Target - {\"0\": 323, \"1\": 124, \"2\": 125, \"3\": 319, \"4\": 315, \"5\": 315}\n", + "10:17:24 DEBUG : EnergyMeter - using default energy meter for [juno2]\n", + "10:17:24 INFO : EnergyMeter - Scanning for HWMON channels, may take some time...\n", + "10:17:24 DEBUG : Discovering available HWMON sensors...\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/energy1\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/energy2\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/energy3\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/energy4\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/curr1\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/curr2\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/curr3\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/curr4\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/temp1\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/temp2\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/temp3\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/temp4\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/temp5\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/temp6\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/power1\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/power2\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/power3\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/power4\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/in0\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/in1\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/in2\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/in3\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/in4\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/in5\n", + "10:17:24 DEBUG : \tAdding sensor scpi_sensors/in6\n", + "10:17:24 DEBUG : \tAdding sensor gpu/temp1\n", + "10:17:24 DEBUG : EnergyMeter - Enabling channels {'kinds': ['energy'], 'sites': ['BOARDLITTLE', 'BOARDBIG']}\n", + "10:17:24 INFO : EnergyMeter - Channels selected for energy sampling:\n", + "10:17:24 INFO : EnergyMeter - BOARDBIG_energy\n", + "10:17:24 INFO : EnergyMeter - BOARDLITTLE_energy\n", + "10:17:24 INFO : EnergyMeter - Using channel BOARDLITTLE as little channel\n", + "10:17:24 INFO : EnergyMeter - Using channel BOARDBIG as big channel\n", + "10:17:24 DEBUG : EnergyMeter - Results dir: /data/work/juno/lisa/results/20160916_101724\n", + "10:17:24 INFO : TestEnv - Set results folder to:\n", + "10:17:24 INFO : TestEnv - /data/work/juno/lisa/results/20160916_101724\n", + "10:17:24 INFO : TestEnv - Experiment results available also in:\n", + "10:17:24 INFO : TestEnv - /data/work/juno/lisa/results_latest\n" + ] + } + ], + "source": [ + "# Let's use the local host as a target\n", + "te = TestEnv(\n", + " # Setup a target configuration\n", + " target_conf = {\n", + " \n", + " # Define the kind of target platform to use for the experiments\n", + " \"platform\" : 'android', # Linux system, valid other options are:\n", + " # android - access via ADB\n", + " # linux - access via SSH\n", + " # host - direct access\n", + " \n", + " # Preload settings for a specific target\n", + " \"board\" : 'juno2', # load JUNO specific settings, e.g.\n", + " # - HWMON based energy sampling\n", + " # - Juno energy model\n", + " # valid options are:\n", + " # - juno - JUNO Development Board\n", + " # - tc2 - TC2 Development Board\n", + " # - oak - Mediatek MT63xx based target\n", + "\n", + " # Define devlib module to load\n", + " #\"modules\" : [\n", + " # 'bl', # enable big.LITTLE support\n", + " # 'cpufreq' # enable CPUFreq support\n", + " #],\n", + "\n", + " # Binary tools required to run this experiment\n", + " # These tools must be present in the tools/ folder for the architecture\n", + " \"tools\" : ['rt-app', 'taskset', 'trace-cmd'],\n", + " \n", + " # FTrace events end buffer configuration\n", + " \"ftrace\" : {\n", + " \"events\" : [\n", + " \"sched_switch\",\n", + " \"cpu_frequency\"\n", + " ],\n", + " \"buffsize\" : 10240\n", + " },\n", + "\n", + " # Account to access the remote target\n", + " \"host\" : '10.1.210.36',\n", + " \"username\" : 'root',\n", + " \"password\" : '',\n", + "\n", + " # Comment the following line to force rt-app calibration on your target\n", + " #\"rtapp-calib\" : {\n", + " # '0': 361, '1': 138, '2': 138, '3': 352, '4': 360, '5': 353\n", + " #}\n", + " \"rtapp-calib\" : { \"0\": 323, \"1\": 124, \"2\": 125, \"3\": 319, \"4\": 315, \"5\": 315 }\n", + "\n", + "}\n", + "\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Create a new RTA workload generator object" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The wlgen::RTA class is a workload generator which exposes an API to configure\n", + "RTApp based workload as well as to execute them on a target." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "10:17:24 INFO : WlGen - Setup new workload example\n", + "10:17:24 DEBUG : WlGen - Setup step [postrun] callback to [__postrun] function\n" + ] + } + ], + "source": [ + "# Create a new RTApp workload generator\n", + "rtapp = RTA(\n", + " \n", + " target=te.target, # Target execution on the local machine\n", + " \n", + " name='example', # This is the name of the JSON configuration file reporting\n", + " # the generated RTApp configuration\n", + " \n", + " #calibration={0: 10, 1: 11, 2: 12, 3: 13} # These are a set of fake\n", + " # # calibration values\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Initial phase and pinning parameters\n", + "#ramp = Ramp(period_ms=100, start_pct=5, end_pct=65, delta_pct=20, time_s=1,\n", + "# cpus=\"0\")\n", + "\n", + "# Following phases\n", + "#medium_slow = Periodic(duty_cycle_pct=10, duration_s=5, period_ms=100)\n", + "#high_fast = Periodic(duty_cycle_pct=60, duration_s=5, period_ms=10)\n", + "#medium_fast = Periodic(duty_cycle_pct=10, duration_s=5, period_ms=1)\n", + "#high_slow = Periodic(duty_cycle_pct=60, duration_s=5, period_ms=100)\n", + "\n", + "#Compose the task\n", + "#complex_task = ramp + medium_slow + high_fast + medium_fast + high_slow\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def build_perf_benchmark_rtapp(run_duration_ms, calibration_cpu_name, num_tasks, iterations, logdir=\"/data/local/tmp\", file_name=\"perfbench.json\"):\n", + " # static content\n", + " json_content = { \n", + " 'global': {\n", + " 'calibration': calibration_cpu_name,\n", + " 'default_policy': \"SCHED_OTHER\",\n", + " 'duration': -1,\n", + " 'logdir': logdir\n", + " },\n", + " 'tasks': {\n", + " 'controller': {\n", + " 'loop': iterations+2, \n", + " 'phases': {\n", + " 'init_delay': {\n", + " 'sleep': run_duration_ms*4\n", + " }\n", + " }\n", + " }\n", + " }\n", + " }\n", + " # dynamic content (number of tasks)\n", + " for cpu in range(0,num_tasks):\n", + " bench_thread_name = \"bench{}\".format(cpu)\n", + " # describe the worker thread\n", + " json_content['tasks'][bench_thread_name] = {\n", + " 'loop': iterations, \n", + " 'phases': {\n", + " 'go': {\n", + " 'run': run_duration_ms\n", + " }, \n", + " 'wait': {\n", + " 'suspend': bench_thread_name\n", + " }\n", + " }\n", + " }\n", + " # hook it to the controller\n", + " json_content['tasks']['controller']['phases'][\"trigger{}\".format(cpu)] = { 'resume': bench_thread_name }\n", + " \n", + " with open(file_name, 'w') as outfile:\n", + " json.dump(json_content, outfile,\n", + " sort_keys=True, indent=4, separators=(',', ': '))\n", + " return (file_name, json_content)\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "10:17:34 DEBUG : WlGen - Configuring custom workload...\n", + "10:17:34 DEBUG : RTApp - ref on cpu: 1\n", + "10:17:34 DEBUG : adb -s 10.1.210.36:5555 push 'example_00.json' '/data/local/tmp'\n", + "10:17:34 INFO : Generated RTApp JSON file:\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "tmp_json = \n", + "{\n", + " \"global\": {\n", + " \"calibration\": \"CPU1\",\n", + " \"default_policy\": \"SCHED_OTHER\",\n", + " \"duration\": -1,\n", + " \"logdir\": \"/data/local/tmp\"\n", + " },\n", + " \"tasks\": {\n", + " \"bench0\": {\n", + " \"loop\": 8,\n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " },\n", + " \"wait\": {\n", + " \"suspend\": \"bench0\"\n", + " }\n", + " }\n", + " },\n", + " \"bench1\": {\n", + " \"loop\": 8,\n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " },\n", + " \"wait\": {\n", + " \"suspend\": \"bench1\"\n", + " }\n", + " }\n", + " },\n", + " \"bench2\": {\n", + " \"loop\": 8,\n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " },\n", + " \"wait\": {\n", + " \"suspend\": \"bench2\"\n", + " }\n", + " }\n", + " },\n", + " \"bench3\": {\n", + " \"loop\": 8,\n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " },\n", + " \"wait\": {\n", + " \"suspend\": \"bench3\"\n", + " }\n", + " }\n", + " },\n", + " \"bench4\": {\n", + " \"loop\": 8,\n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " },\n", + " \"wait\": {\n", + " \"suspend\": \"bench4\"\n", + " }\n", + " }\n", + " },\n", + " \"bench5\": {\n", + " \"loop\": 8,\n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " },\n", + " \"wait\": {\n", + " \"suspend\": \"bench5\"\n", + " }\n", + " }\n", + " },\n", + " \"controller\": {\n", + " \"loop\": 10,\n", + " \"phases\": {\n", + " \"init_delay\": {\n", + " \"sleep\": 2000000\n", + " },\n", + " \"trigger0\": {\n", + " \"resume\": \"bench0\"\n", + " },\n", + " \"trigger1\": {\n", + " \"resume\": \"bench1\"\n", + " },\n", + " \"trigger2\": {\n", + " \"resume\": \"bench2\"\n", + " },\n", + " \"trigger3\": {\n", + " \"resume\": \"bench3\"\n", + " },\n", + " \"trigger4\": {\n", + " \"resume\": \"bench4\"\n", + " },\n", + " \"trigger5\": {\n", + " \"resume\": \"bench5\"\n", + " }\n", + " }\n", + " }\n", + " }\n", + "}\n", + "ifile = \n", + "['{', ' \"global\": {', ' \"calibration\": \"CPU1\",', ' \"default_policy\": \"SCHED_OTHER\",', ' \"duration\": -1,', ' \"logdir\": \"/data/local/tmp\"', ' },', ' \"tasks\": {', ' \"bench0\": {', ' \"loop\": 8,', ' \"phases\": {', ' \"go\": {', ' \"run\": 500000', ' },', ' \"wait\": {', ' \"suspend\": \"bench0\"', ' }', ' }', ' },', ' \"bench1\": {', ' \"loop\": 8,', ' \"phases\": {', ' \"go\": {', ' \"run\": 500000', ' },', ' \"wait\": {', ' \"suspend\": \"bench1\"', ' }', ' }', ' },', ' \"bench2\": {', ' \"loop\": 8,', ' \"phases\": {', ' \"go\": {', ' \"run\": 500000', ' },', ' \"wait\": {', ' \"suspend\": \"bench2\"', ' }', ' }', ' },', ' \"bench3\": {', ' \"loop\": 8,', ' \"phases\": {', ' \"go\": {', ' \"run\": 500000', ' },', ' \"wait\": {', ' \"suspend\": \"bench3\"', ' }', ' }', ' },', ' \"bench4\": {', ' \"loop\": 8,', ' \"phases\": {', ' \"go\": {', ' \"run\": 500000', ' },', ' \"wait\": {', ' \"suspend\": \"bench4\"', ' }', ' }', ' },', ' \"bench5\": {', ' \"loop\": 8,', ' \"phases\": {', ' \"go\": {', ' \"run\": 500000', ' },', ' \"wait\": {', ' \"suspend\": \"bench5\"', ' }', ' }', ' },', ' \"controller\": {', ' \"loop\": 10,', ' \"phases\": {', ' \"init_delay\": {', ' \"sleep\": 2000000', ' },', ' \"trigger0\": {', ' \"resume\": \"bench0\"', ' },', ' \"trigger1\": {', ' \"resume\": \"bench1\"', ' },', ' \"trigger2\": {', ' \"resume\": \"bench2\"', ' },', ' \"trigger3\": {', ' \"resume\": \"bench3\"', ' },', ' \"trigger4\": {', ' \"resume\": \"bench4\"', ' },', ' \"trigger5\": {', ' \"resume\": \"bench5\"', ' }', ' }', ' }', ' }', '}']\n", + "\n", + "line: {\n", + "line: \"global\": {\n", + "line: \"calibration\": \"CPU1\",\n", + "line: \"default_policy\": \"SCHED_OTHER\",\n", + "line: \"duration\": -1,\n", + "line: \"logdir\": \"/data/local/tmp\"\n", + "line: },\n", + "line: \"tasks\": {\n", + "line: \"bench0\": {\n", + "line: \"loop\": 8,\n", + "line: \"phases\": {\n", + "line: \"go\": {\n", + "line: \"run\": 500000\n", + "line: },\n", + "line: \"wait\": {\n", + "line: \"suspend\": \"bench0\"\n", + "line: }\n", + "line: }\n", + "line: },\n", + "line: \"bench1\": {\n", + "line: \"loop\": 8,\n", + "line: \"phases\": {\n", + "line: \"go\": {\n", + "line: \"run\": 500000\n", + "line: },\n", + "line: \"wait\": {\n", + "line: \"suspend\": \"bench1\"\n", + "line: }\n", + "line: }\n", + "line: },\n", + "line: \"bench2\": {\n", + "line: \"loop\": 8,\n", + "line: \"phases\": {\n", + "line: \"go\": {\n", + "line: \"run\": 500000\n", + "line: },\n", + "line: \"wait\": {\n", + "line: \"suspend\": \"bench2\"\n", + "line: }\n", + "line: }\n", + "line: },\n", + "line: \"bench3\": {\n", + "line: \"loop\": 8,\n", + "line: \"phases\": {\n", + "line: \"go\": {\n", + "line: \"run\": 500000\n", + "line: },\n", + "line: \"wait\": {\n", + "line: \"suspend\": \"bench3\"\n", + "line: }\n", + "line: }\n", + "line: },\n", + "line: \"bench4\": {\n", + "line: \"loop\": 8,\n", + "line: \"phases\": {\n", + "line: \"go\": {\n", + "line: \"run\": 500000\n", + "line: },\n", + "line: \"wait\": {\n", + "line: \"suspend\": \"bench4\"\n", + "line: }\n", + "line: }\n", + "line: },\n", + "line: \"bench5\": {\n", + "line: \"loop\": 8,\n", + "line: \"phases\": {\n", + "line: \"go\": {\n", + "line: \"run\": 500000\n", + "line: },\n", + "line: \"wait\": {\n", + "line: \"suspend\": \"bench5\"\n", + "line: }\n", + "line: }\n", + "line: },\n", + "line: \"controller\": {\n", + "line: \"loop\": 10,\n", + "line: \"phases\": {\n", + "line: \"init_delay\": {\n", + "line: \"sleep\": 2000000\n", + "line: },\n", + "line: \"trigger0\": {\n", + "line: \"resume\": \"bench0\"\n", + "line: },\n", + "line: \"trigger1\": {\n", + "line: \"resume\": \"bench1\"\n", + "line: },\n", + "line: \"trigger2\": {\n", + "line: \"resume\": \"bench2\"\n", + "line: },\n", + "line: \"trigger3\": {\n", + "line: \"resume\": \"bench3\"\n", + "line: },\n", + "line: \"trigger4\": {\n", + "line: \"resume\": \"bench4\"\n", + "line: },\n", + "line: \"trigger5\": {\n", + "line: \"resume\": \"bench5\"\n", + "line: }\n", + "line: }\n", + "line: }\n", + "line: }\n", + "line: }\n", + "{\n", + " \"global\": {\n", + " \"calibration\": \"CPU1\", \n", + " \"default_policy\": \"SCHED_OTHER\", \n", + " \"duration\": -1, \n", + " \"logdir\": \"/data/local/tmp\"\n", + " }, \n", + " \"tasks\": {\n", + " \"bench0\": {\n", + " \"loop\": 8, \n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " }, \n", + " \"wait\": {\n", + " \"suspend\": \"bench0\"\n", + " }\n", + " }\n", + " }, \n", + " \"bench1\": {\n", + " \"loop\": 8, \n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " }, \n", + " \"wait\": {\n", + " \"suspend\": \"bench1\"\n", + " }\n", + " }\n", + " }, \n", + " \"bench2\": {\n", + " \"loop\": 8, \n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " }, \n", + " \"wait\": {\n", + " \"suspend\": \"bench2\"\n", + " }\n", + " }\n", + " }, \n", + " \"bench3\": {\n", + " \"loop\": 8, \n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " }, \n", + " \"wait\": {\n", + " \"suspend\": \"bench3\"\n", + " }\n", + " }\n", + " }, \n", + " \"bench4\": {\n", + " \"loop\": 8, \n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " }, \n", + " \"wait\": {\n", + " \"suspend\": \"bench4\"\n", + " }\n", + " }\n", + " }, \n", + " \"bench5\": {\n", + " \"loop\": 8, \n", + " \"phases\": {\n", + " \"go\": {\n", + " \"run\": 500000\n", + " }, \n", + " \"wait\": {\n", + " \"suspend\": \"bench5\"\n", + " }\n", + " }\n", + " }, \n", + " \"controller\": {\n", + " \"loop\": 10, \n", + " \"phases\": {\n", + " \"init_delay\": {\n", + " \"sleep\": 2000000\n", + " }, \n", + " \"trigger0\": {\n", + " \"resume\": \"bench0\"\n", + " }, \n", + " \"trigger1\": {\n", + " \"resume\": \"bench1\"\n", + " }, \n", + " \"trigger2\": {\n", + " \"resume\": \"bench2\"\n", + " }, \n", + " \"trigger3\": {\n", + " \"resume\": \"bench3\"\n", + " }, \n", + " \"trigger4\": {\n", + " \"resume\": \"bench4\"\n", + " }, \n", + " \"trigger5\": {\n", + " \"resume\": \"bench5\"\n", + " }\n", + " }\n", + " }\n", + " }\n", + "}\n" + ] + } + ], + "source": [ + "run_duration_ms = 500000\n", + "calibration = 'CPU1'\n", + "num_tasks = 6\n", + "iterations = 8\n", + "\n", + "(filename, json_data)=build_perf_benchmark_rtapp(run_duration_ms, calibration, num_tasks, iterations)\n", + "\n", + "# Configure this RTApp instance to:\n", + "name=rtapp.conf(\n", + " # 1. generate a \"profile based\" set of tasks\n", + " #kind='profile',\n", + " kind='custom',\n", + " duration=-1, \n", + " # 2. define the \"profile\" of each task\n", + " params={\n", + " # use filename\n", + "# 'custom_filename' : \"{}\".format(filename)\n", + " # use variable directly\n", + " 'custom_config': json_data\n", + " },\n", + "\n", + " # 6. use this folder for task logfiles\n", + " run_dir='/data/local/tmp'\n", + ")\n", + "\n", + "with open('{}'.format(rtapp.json), 'r') as fh:\n", + " rtapp_json = json.load(fh, )\n", + "logging.info('Generated RTApp JSON file:')\n", + "print json.dumps(rtapp_json, indent=4, sort_keys=True)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "\n", + "\n", + "def configure_target(is_big_little=0, initial_task_util=0, num_of_cpus=6, governor=\"sched\", disabled_idle_states=[]):\n", + " # device paths\n", + " isBigLittle='/proc/sys/kernel/sched_is_big_little'\n", + " initialTaskUtil='/proc/sys/kernel/sched_initial_task_util'\n", + " cpuFreqGovernor='/sys/devices/system/cpu/cpu{}/cpufreq/scaling_governor'\n", + " cpuIdleState='/sys/devices/system/cpu/cpu{}/cpuidle/state{}/disable'\n", + " \n", + " # Configure 'is_big_little' flag\n", + " te.target.execute(\"echo {} > {}\".format(is_big_little, isBigLittle))\n", + " # Configure 'initial_task_util' flag\n", + " te.target.execute(\"echo {} > {}\".format(initial_task_util, initialTaskUtil))\n", + " # set cpufreq governors\n", + " te.target.execute(\"echo {} > {}\".format(governor, cpuFreqGovernor.format(0)))\n", + " te.target.execute(\"echo {} > {}\".format(governor, cpuFreqGovernor.format(1)))\n", + " # configure idle states\n", + " idle_states=[ 0,1,2 ]\n", + " if len(disabled_idle_states):\n", + " for state in disabled_idle_states:\n", + " idle_states.remove(state)\n", + " \n", + " for cpu in range(0, num_of_cpus):\n", + " # disable states\n", + " if len(disabled_idle_states):\n", + " for idle_state in disabled_idle_states:\n", + " te.target.execute(\"echo 0 > {}\".format(cpuIdleState.format(cpu, idle_state)))\n", + " #enable states\n", + " if len(idle_states):\n", + " for idle_state in idle_states:\n", + " te.target.execute(\"echo 1 > {}\".format(cpuIdleState.format(cpu, idle_state)))\n", + " # report\n", + " print \"sched_is_big_little: {}\".format(te.target.read_value(isBigLittle))\n", + " print \"sched_initial_task_util: {}\".format(te.target.read_value(initialTaskUtil))\n", + " print \"Little Cluster Governor: {}\".format(te.target.read_value(cpuFreqGovernor.format(0)))\n", + " print \"Big Cluster Governor: {}\".format(te.target.read_value(cpuFreqGovernor.format(1)))\n", + " idle_states=[ 0,1,2 ]\n", + " for cpu in range(0, num_of_cpus):\n", + " print \"Cpu {} Idle States:\".format(cpu)\n", + " for state in idle_states:\n", + " val = te.target.read_value(cpuIdleState.format(cpu, state))\n", + " result='disabled'\n", + " if val > 0:\n", + " result='enabled'\n", + " print \" State {} : {}\".format(state, result)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 0 > /proc/sys/kernel/sched_is_big_little\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 0 > /proc/sys/kernel/sched_initial_task_util\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo sched > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo sched > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu0/cpuidle/state0/disable\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu0/cpuidle/state1/disable\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu0/cpuidle/state2/disable\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu1/cpuidle/state0/disable\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu1/cpuidle/state1/disable\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu1/cpuidle/state2/disable\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu2/cpuidle/state0/disable\"\n", + "10:18:20 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu2/cpuidle/state1/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu2/cpuidle/state2/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu3/cpuidle/state0/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu3/cpuidle/state1/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu3/cpuidle/state2/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu4/cpuidle/state0/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu4/cpuidle/state1/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu4/cpuidle/state2/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu5/cpuidle/state0/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu5/cpuidle/state1/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 1 > /sys/devices/system/cpu/cpu5/cpuidle/state2/disable\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/proc/sys/kernel/sched_is_big_little'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/proc/sys/kernel/sched_initial_task_util'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu0/cpuidle/state0/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu0/cpuidle/state1/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu0/cpuidle/state2/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu1/cpuidle/state0/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu1/cpuidle/state1/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu1/cpuidle/state2/disable'\"\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sched_is_big_little: 0\n", + "sched_initial_task_util: 0\n", + "Little Cluster Governor: sched\n", + "Big Cluster Governor: sched\n", + "Cpu 0 Idle States:\n", + " State 0 : enabled\n", + " State 1 : enabled\n", + " State 2 : enabled\n", + "Cpu 1 Idle States:\n", + " State 0 : enabled\n", + " State 1 : enabled\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu2/cpuidle/state0/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu2/cpuidle/state1/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu2/cpuidle/state2/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu3/cpuidle/state0/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu3/cpuidle/state1/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu3/cpuidle/state2/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu4/cpuidle/state0/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu4/cpuidle/state1/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu4/cpuidle/state2/disable'\"\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " State 2 : enabled\n", + "Cpu 2 Idle States:\n", + " State 0 : enabled\n", + " State 1 : enabled\n", + " State 2 : enabled\n", + "Cpu 3 Idle States:\n", + " State 0 : enabled\n", + " State 1 : enabled\n", + " State 2 : enabled\n", + "Cpu 4 Idle States:\n", + " State 0 : enabled\n", + " State 1 : enabled\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu5/cpuidle/state0/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu5/cpuidle/state1/disable'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/devices/system/cpu/cpu5/cpuidle/state2/disable'\"\n", + "10:18:21 INFO : #### Setup FTrace\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 'echo 10240 > '\\\\''/sys/kernel/debug/tracing/buffer_size_kb'\\\\''' | su\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/kernel/debug/tracing/buffer_size_kb'\"\n", + "10:18:21 DEBUG : adb -s 10.1.210.36:5555 shell \"echo '/data/local/tmp/bin/trace-cmd reset' | su\"\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " State 2 : enabled\n", + "Cpu 5 Idle States:\n", + " State 0 : enabled\n", + " State 1 : enabled\n", + " State 2 : enabled\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "10:18:23 DEBUG : adb -s 10.1.210.36:5555 shell \"echo '/data/local/tmp/bin/trace-cmd start -e sched_switch -e cpu_frequency' | su\"\n", + "10:18:25 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 'echo TRACE_MARKER_START > '\\\\''/sys/kernel/debug/tracing/trace_marker'\\\\''' | su\"\n", + "10:18:25 DEBUG : Trace CPUFreq frequencies\n", + "10:18:25 DEBUG : adb -s 10.1.210.36:5555 shell \"echo '/data/local/tmp/bin/shutils cpufreq_trace_all_frequencies' | su\"\n", + "10:18:25 INFO : #### Start energy sampling\n", + "10:18:25 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/energy2_input'\"\n", + "10:18:25 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/energy3_input'\"\n", + "10:18:25 DEBUG : SAMPLE: {'BOARDBIG': {'total': 0, 'last': 13396.05908, 'delta': 0}, 'BOARDLITTLE': {'total': 0, 'last': 10221.74299, 'delta': 0}}\n", + "10:18:25 DEBUG : RESET: {'BOARDBIG': {'total': 0, 'last': 13396.05908, 'delta': 0}, 'BOARDLITTLE': {'total': 0, 'last': 10221.74299, 'delta': 0}}\n", + "10:18:25 INFO : #### Start RTApp execution\n", + "10:18:25 INFO : WlGen - Workload execution START:\n", + "10:18:25 INFO : WlGen - /data/local/tmp/bin/rt-app /data/local/tmp/example_00.json 2>&1\n", + "10:18:25 DEBUG : adb -s 10.1.210.36:5555 shell \"/data/local/tmp/bin/rt-app /data/local/tmp/example_00.json 2>&1\"\n", + "10:18:46 DEBUG : WlGen - Callback [postrun]...\n", + "10:18:46 DEBUG : RTApp - Pulling logfiles to [./]...\n", + "10:18:46 DEBUG : RTApp - Pulling JSON to [./]...\n", + "10:18:46 DEBUG : adb -s 10.1.210.36:5555 pull '/data/local/tmp/example_00.json' './'\n", + "10:18:46 DEBUG : RTApp - Saving output on [.//output.log]...\n", + "10:18:46 DEBUG : WlGen - Workload execution COMPLETED\n", + "10:18:46 INFO : #### Read energy consumption: /data/work/juno/lisa/results/20160916_101724/energy.json\n", + "10:18:46 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/energy2_input'\"\n", + "10:18:46 DEBUG : adb -s 10.1.210.36:5555 shell \"cat '/sys/class/hwmon/hwmon0/energy3_input'\"\n", + "10:18:46 DEBUG : SAMPLE: {'BOARDBIG': {'total': 11.246471999998903, 'last': 13407.305552, 'delta': 11.246471999998903}, 'BOARDLITTLE': {'total': 7.619081999999253, 'last': 10229.362072, 'delta': 7.619081999999253}}\n", + "10:18:46 INFO : EnergyReport - Energy [ BOARDBIG]: 11.246472\n", + "10:18:46 INFO : EnergyReport - Energy [ BOARDLITTLE]: 7.619082\n", + "10:18:46 INFO : #### Stop FTrace\n", + "10:18:46 DEBUG : Trace CPUFreq frequencies\n", + "10:18:46 DEBUG : adb -s 10.1.210.36:5555 shell \"echo '/data/local/tmp/bin/shutils cpufreq_trace_all_frequencies' | su\"\n", + "10:18:46 DEBUG : adb -s 10.1.210.36:5555 shell \"echo 'echo TRACE_MARKER_STOP > '\\\\''/sys/kernel/debug/tracing/trace_marker'\\\\''' | su\"\n", + "10:18:46 DEBUG : adb -s 10.1.210.36:5555 shell \"echo '/data/local/tmp/bin/trace-cmd stop' | su\"\n", + "10:18:46 INFO : #### Save FTrace: /data/work/juno/lisa/results/20160916_101724/trace.dat\n", + "10:18:46 DEBUG : adb -s 10.1.210.36:5555 shell \"echo '/data/local/tmp/bin/trace-cmd extract -o /data/local/tmp/devlib-target/trace.dat' | su\"\n", + "10:18:48 DEBUG : adb -s 10.1.210.36:5555 pull '/data/local/tmp/devlib-target/trace.dat' '/data/work/juno/lisa/results/20160916_101724/trace.dat'\n", + "10:18:49 INFO : #### Save platform description: /data/work/juno/lisa/results/20160916_101724/platform.json\n", + "10:18:49 DEBUG : Platform - Dump platform descriptor in [/data/work/juno/lisa/results/20160916_101724/platform.json]\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "
\n", + "\n", + "\n", + "\n", + " \n", + "
" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "configure_target(governor='sched')\n", + "\n", + "logging.info('#### Setup FTrace')\n", + "te.ftrace.start()\n", + "\n", + "logging.info('#### Start energy sampling')\n", + "te.emeter.reset()\n", + "\n", + "logging.info('#### Start RTApp execution')\n", + "rtapp.run(cgroup=\"\")\n", + "\n", + "logging.info('#### Read energy consumption: %s/energy.json', te.res_dir)\n", + "(nrg, nrg_file) = te.emeter.report(out_dir=te.res_dir)\n", + "\n", + "logging.info('#### Stop FTrace')\n", + "te.ftrace.stop()\n", + "\n", + "trace_file = os.path.join(te.res_dir, 'trace.dat')\n", + "logging.info('#### Save FTrace: %s', trace_file)\n", + "te.ftrace.get_trace(trace_file)\n", + "\n", + "logging.info('#### Save platform description: %s/platform.json', te.res_dir)\n", + "(plt, plt_file) = te.platform_dump(te.res_dir)\n", + "\n", + "# NOTE: The interactive trace visualization is available only if you run\n", + "# the workload to generate a new trace-file\n", + "trappy.plotter.plot_trace(te.res_dir)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "configure_target(1,0)\n", + "\n", + "logging.info('#### Setup FTrace')\n", + "te.ftrace.start()\n", + "\n", + "logging.info('#### Start energy sampling')\n", + "te.emeter.reset()\n", + "\n", + "logging.info('#### Start RTApp execution')\n", + "rtapp.run(cgroup=\"\")\n", + "\n", + "logging.info('#### Read energy consumption: %s/energy.json', te.res_dir)\n", + "(nrg, nrg_file) = te.emeter.report(out_dir=te.res_dir)\n", + "\n", + "logging.info('#### Stop FTrace')\n", + "te.ftrace.stop()\n", + "\n", + "trace_file = os.path.join(te.res_dir, 'trace.dat')\n", + "logging.info('#### Save FTrace: %s', trace_file)\n", + "te.ftrace.get_trace(trace_file)\n", + "\n", + "logging.info('#### Save platform description: %s/platform.json', te.res_dir)\n", + "(plt, plt_file) = te.platform_dump(te.res_dir)\n", + "\n", + "# NOTE: The interactive trace visualization is available only if you run\n", + "# the workload to generate a new trace-file\n", + "trappy.plotter.plot_trace(te.res_dir)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [], + "source": [ + "configure_target(0,1024)\n", + "\n", + "logging.info('#### Setup FTrace')\n", + "te.ftrace.start()\n", + "\n", + "logging.info('#### Start energy sampling')\n", + "te.emeter.reset()\n", + "\n", + "logging.info('#### Start RTApp execution')\n", + "rtapp.run(cgroup=\"\")\n", + "\n", + "logging.info('#### Read energy consumption: %s/energy.json', te.res_dir)\n", + "(nrg, nrg_file) = te.emeter.report(out_dir=te.res_dir)\n", + "\n", + "logging.info('#### Stop FTrace')\n", + "te.ftrace.stop()\n", + "\n", + "trace_file = os.path.join(te.res_dir, 'trace.dat')\n", + "logging.info('#### Save FTrace: %s', trace_file)\n", + "te.ftrace.get_trace(trace_file)\n", + "\n", + "logging.info('#### Save platform description: %s/platform.json', te.res_dir)\n", + "(plt, plt_file) = te.platform_dump(te.res_dir)\n", + "\n", + "# NOTE: The interactive trace visualization is available only if you run\n", + "# the workload to generate a new trace-file\n", + "trappy.plotter.plot_trace(te.res_dir)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [], + "source": [ + "configure_target(1,1024)\n", + "\n", + "logging.info('#### Setup FTrace')\n", + "te.ftrace.start()\n", + "\n", + "logging.info('#### Start energy sampling')\n", + "te.emeter.reset()\n", + "\n", + "logging.info('#### Start RTApp execution')\n", + "rtapp.run(cgroup=\"\")\n", + "\n", + "logging.info('#### Read energy consumption: %s/energy.json', te.res_dir)\n", + "(nrg, nrg_file) = te.emeter.report(out_dir=te.res_dir)\n", + "\n", + "logging.info('#### Stop FTrace')\n", + "te.ftrace.stop()\n", + "\n", + "trace_file = os.path.join(te.res_dir, 'trace.dat')\n", + "logging.info('#### Save FTrace: %s', trace_file)\n", + "te.ftrace.get_trace(trace_file)\n", + "\n", + "logging.info('#### Save platform description: %s/platform.json', te.res_dir)\n", + "(plt, plt_file) = te.platform_dump(te.res_dir)\n", + "\n", + "# NOTE: The interactive trace visualization is available only if you run\n", + "# the workload to generate a new trace-file\n", + "trappy.plotter.plot_trace(te.res_dir)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} -- GitLab