blob: cc8fbe391cacc29e35498c2806c41b1956bebf65 [file] [log] [blame]
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import logging\n",
"from conf import LisaLogging\n",
"LisaLogging.setup()"
]
},
{
"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": [
"%pylab inline\n",
"\n",
"import datetime\n",
"import devlib\n",
"import os\n",
"import json\n",
"import pandas as pd\n",
"import re\n",
"import subprocess\n",
"import trappy\n",
"from trappy.plotter.Utils import get_trace_event_data\n",
"\n",
"import matplotlib.gridspec as gridspec\n",
"import matplotlib.pyplot as plt\n",
"\n",
"# Support to access the remote target\n",
"#import devlib\n",
"#from env import TestEnv\n",
"\n",
"from env import TestEnv\n",
"from executor import Executor"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Target Configuration"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06:16:08 INFO : Target - Using base path: /home/bjackman/sources/lisa\n",
"06:16:08 INFO : Target - Loading custom (inline) target configuration\n",
"06:16:08 INFO : Target - Devlib modules to load: ['bl', 'cpufreq']\n",
"06:16:08 INFO : Target - Connecting linux target:\n",
"06:16:08 INFO : Target - username : brendan\n",
"06:16:08 INFO : Target - host : 192.168.0.1\n",
"06:16:08 INFO : Target - password : \n",
"06:16:08 INFO : Target - Connection settings:\n",
"06:16:08 INFO : Target - {'username': 'brendan', 'host': '192.168.0.1', 'password': ''}\n",
"06:16:14 INFO : Target - Initializing target workdir:\n",
"06:16:14 INFO : Target - /home/brendan/devlib-target\n",
"06:16:18 INFO : Target - Topology:\n",
"06:16:18 INFO : Target - [[0, 3, 4, 5], [1, 2]]\n",
"06:16:23 INFO : FTrace - Enabled tracepoints:\n",
"06:16:23 INFO : FTrace - sched_switch\n",
"06:16:23 INFO : FTrace - sched_wakeup\n",
"06:16:23 INFO : FTrace - sched_wakeup_new\n",
"06:16:23 INFO : FTrace - cpu_frequency\n",
"06:16:23 WARNING : TestEnv - Wipe previous contents of the results folder:\n",
"06:16:23 WARNING : TestEnv - /home/bjackman/sources/lisa/results/ExecutorExample\n",
"06:16:23 INFO : TestEnv - Set results folder to:\n",
"06:16:23 INFO : TestEnv - /home/bjackman/sources/lisa/results/ExecutorExample\n",
"06:16:23 INFO : TestEnv - Experiment results available also in:\n",
"06:16:23 INFO : TestEnv - /home/bjackman/sources/lisa/results_latest\n"
]
}
],
"source": [
"# Setup a target configuration\n",
"env = TestEnv({\n",
" \n",
" # Target platform and board\n",
" \"platform\" : 'linux',\n",
" \"board\" : 'aboard',\n",
" \n",
" # Target board IP/MAC address\n",
" \"host\" : '192.168.0.1',\n",
" \n",
" # Login credentials\n",
" \"username\" : 'brendan',\n",
" \"password\" : '',\n",
" \n",
" # Folder where all the results will be collected\n",
" \"results_dir\" : \"ExecutorExample\",\n",
" \n",
" # FTrace events to collect for all the tests configuration which have\n",
" # the \"ftrace\" flag enabled\n",
" \"ftrace\" : {\n",
" \"events\" : [\n",
" \"sched_switch\",\n",
" \"sched_wakeup\",\n",
" \"sched_wakeup_new\",\n",
" \"cpu_frequency\",\n",
" ],\n",
" \"buffsize\" : 80 * 1024,\n",
" },\n",
" \n",
" # Tools required by the experiments\n",
" \"tools\" : [ 'trace-cmd', 'perf' ],\n",
" \n",
" # Modules required by these experiments\n",
" \"modules\" : [ 'bl', 'cpufreq' ],\n",
"\n",
"})"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Tests Configuration"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06:16:23 INFO : Target - Loading custom (inline) test configuration\n",
"06:16:23 INFO : \n",
"06:16:23 INFO : ################################################################################\n",
"06:16:23 INFO : Executor - Experiments configuration\n",
"06:16:23 INFO : ################################################################################\n",
"06:16:23 INFO : Executor - Configured to run:\n",
"06:16:23 INFO : Executor - 2 target configurations:\n",
"06:16:23 INFO : Executor - base, eas\n",
"06:16:23 INFO : Executor - 2 workloads (1 iterations each)\n",
"06:16:23 INFO : Executor - rta, perf\n",
"06:16:23 INFO : Executor - Total: 4 experiments\n",
"06:16:23 INFO : Executor - Results will be collected under:\n",
"06:16:23 INFO : Executor - /home/bjackman/sources/lisa/results/ExecutorExample\n"
]
}
],
"source": [
"executor = Executor(env, {\n",
" # Platform configurations to test\n",
" \"confs\" : [\n",
" {\n",
" \"tag\" : \"base\",\n",
" \"flags\" : \"ftrace\", # Enable FTrace events\n",
" \"sched_features\" : \"NO_ENERGY_AWARE\", # Disable EAS\n",
" \"cpufreq\" : { # Use PERFORMANCE CpuFreq\n",
" \"governor\" : \"performance\",\n",
" },\n",
" },\n",
" {\n",
" \"tag\" : \"eas\",\n",
" \"flags\" : \"ftrace\", # Enable FTrace events\n",
" \"sched_features\" : \"ENERGY_AWARE\", # Enable EAS\n",
" \"cpufreq\" : { # Use PERFORMANCE CpuFreq\n",
" \"governor\" : \"performance\",\n",
" },\n",
" },\n",
" ],\n",
" \n",
" # Workloads to run (on each platform configuration)\n",
" \"wloads\" : {\n",
" # Run hackbench with 1 group using pipes\n",
" \"perf\" : {\n",
" \"type\" : \"perf_bench\",\n",
" \"conf\" : {\n",
" \"class\" : \"messaging\",\n",
" \"params\" : {\n",
" \"group\" : 1,\n",
" \"loop\" : 10,\n",
" \"pipe\" : True,\n",
" \"thread\": True,\n",
" }\n",
" }\n",
" },\n",
" # Run a 20% duty-cycle periodic task\n",
" \"rta\" : {\n",
" \"type\" : \"rt-app\",\n",
" \"loadref\" : \"big\",\n",
" \"conf\" : {\n",
" \"class\" : \"profile\",\n",
" \"params\" : {\n",
" \"p20\" : {\n",
" \"kind\" : \"Periodic\",\n",
" \"params\" : {\n",
" \"duty_cycle_pct\" : 20,\n",
" },\n",
" },\n",
" },\n",
" },\n",
" },\n",
" },\n",
" \n",
" # Number of iterations for each workload\n",
" \"iterations\" : 1,\n",
"})"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Tests execution"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06:16:23 INFO : \n",
"06:16:23 INFO : ################################################################################\n",
"06:16:23 INFO : Executor - Experiments execution\n",
"06:16:23 INFO : ################################################################################\n",
"06:16:23 INFO : \n",
"06:16:23 INFO : ================================================================================\n",
"06:16:23 INFO : TargetConfig - configuring target for [base] experiments\n",
"06:16:25 INFO : SchedFeatures - Set scheduler feature: NO_ENERGY_AWARE\n",
"06:16:26 INFO : CPUFreq - Configuring all CPUs to use [performance] governor\n",
"06:16:27 INFO : WlGen - Setup new workload rta\n",
"06:16:27 INFO : RTApp - Workload duration defined by longest task\n",
"06:16:27 INFO : RTApp - Default policy: SCHED_OTHER\n",
"06:16:27 INFO : RTApp - ------------------------\n",
"06:16:27 INFO : RTApp - task [task_p200], sched: using default policy\n",
"06:16:27 INFO : RTApp - | calibration CPU: 1\n",
"06:16:27 INFO : RTApp - | loops count: 1\n",
"06:16:27 INFO : RTApp - + phase_000001: duration 1.000000 [s] (10 loops)\n",
"06:16:27 INFO : RTApp - | period 100000 [us], duty_cycle 20 %\n",
"06:16:27 INFO : RTApp - | run_time 20000 [us], sleep_time 80000 [us]\n",
"06:16:28 INFO : WlGen - Setup new workload perf\n",
"06:16:28 INFO : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
"06:16:28 INFO : Executor - Experiment 0/4, [base:rta] 1/1\n",
"06:16:28 WARNING : Executor - FTrace events collection enabled\n",
"06:16:36 INFO : WlGen - Workload execution START:\n",
"06:16:36 INFO : WlGen - /home/brendan/devlib-target/bin/rt-app /home/brendan/devlib-target/run_dir/rta_00.json 2>&1\n",
"06:16:44 INFO : Executor - Collected FTrace binary trace:\n",
"06:16:44 INFO : Executor - <res_dir>/rtapp:base:rta/1/trace.dat\n",
"06:16:44 INFO : Executor - Collected FTrace function profiling:\n",
"06:16:44 INFO : Executor - <res_dir>/rtapp:base:rta/1/trace_stat.json\n",
"06:16:44 INFO : --------------------------------------------------------------------------------\n",
"06:16:44 INFO : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
"06:16:44 INFO : Executor - Experiment 1/4, [base:perf] 1/1\n",
"06:16:44 WARNING : Executor - FTrace events collection enabled\n",
"06:16:52 INFO : WlGen - Workload execution START:\n",
"06:16:52 INFO : WlGen - /home/brendan/devlib-target/bin/perf bench sched messaging --pipe --thread --group 1 --loop 10\n",
"06:16:53 INFO : PerfBench - Completion time: 0.007000, Performance 142.857143\n",
"06:16:58 INFO : Executor - Collected FTrace binary trace:\n",
"06:16:58 INFO : Executor - <res_dir>/perf_bench_messaging:base:perf/1/trace.dat\n",
"06:16:58 INFO : Executor - Collected FTrace function profiling:\n",
"06:16:58 INFO : Executor - <res_dir>/perf_bench_messaging:base:perf/1/trace_stat.json\n",
"06:16:58 INFO : --------------------------------------------------------------------------------\n",
"06:16:58 INFO : \n",
"06:16:58 INFO : ================================================================================\n",
"06:16:58 INFO : TargetConfig - configuring target for [eas] experiments\n",
"06:17:00 INFO : SchedFeatures - Set scheduler feature: ENERGY_AWARE\n",
"06:17:01 INFO : CPUFreq - Configuring all CPUs to use [performance] governor\n",
"06:17:02 INFO : WlGen - Setup new workload rta\n",
"06:17:02 INFO : RTApp - Workload duration defined by longest task\n",
"06:17:02 INFO : RTApp - Default policy: SCHED_OTHER\n",
"06:17:02 INFO : RTApp - ------------------------\n",
"06:17:02 INFO : RTApp - task [task_p200], sched: using default policy\n",
"06:17:02 INFO : RTApp - | calibration CPU: 1\n",
"06:17:02 INFO : RTApp - | loops count: 1\n",
"06:17:02 INFO : RTApp - + phase_000001: duration 1.000000 [s] (10 loops)\n",
"06:17:02 INFO : RTApp - | period 100000 [us], duty_cycle 20 %\n",
"06:17:02 INFO : RTApp - | run_time 20000 [us], sleep_time 80000 [us]\n",
"06:17:03 INFO : WlGen - Setup new workload perf\n",
"06:17:03 INFO : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
"06:17:03 INFO : Executor - Experiment 0/4, [base:rta] 1/1\n",
"06:17:03 WARNING : Executor - FTrace events collection enabled\n",
"06:17:11 INFO : WlGen - Workload execution START:\n",
"06:17:11 INFO : WlGen - /home/brendan/devlib-target/bin/rt-app /home/brendan/devlib-target/run_dir/rta_00.json 2>&1\n",
"06:17:19 INFO : Executor - Collected FTrace binary trace:\n",
"06:17:19 INFO : Executor - <res_dir>/rtapp:base:rta/1/trace.dat\n",
"06:17:19 INFO : Executor - Collected FTrace function profiling:\n",
"06:17:19 INFO : Executor - <res_dir>/rtapp:base:rta/1/trace_stat.json\n",
"06:17:19 INFO : --------------------------------------------------------------------------------\n",
"06:17:19 INFO : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
"06:17:19 INFO : Executor - Experiment 1/4, [base:perf] 1/1\n",
"06:17:19 WARNING : Executor - FTrace events collection enabled\n",
"06:17:27 INFO : WlGen - Workload execution START:\n",
"06:17:27 INFO : WlGen - /home/brendan/devlib-target/bin/perf bench sched messaging --pipe --thread --group 1 --loop 10\n",
"06:17:28 INFO : PerfBench - Completion time: 0.034000, Performance 29.411765\n"
]
}
],
"source": [
"executor.run()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[01;34m/home/brejac01/sources/lisa/results/ExecutorExample\u001b[00m\r\n",
"├── \u001b[01;34mperf_bench_messaging:base:perf\u001b[00m\r\n",
"│   ├── \u001b[01;34m1\u001b[00m\r\n",
"│   │   ├── output.log\r\n",
"│   │   ├── performance.json\r\n",
"│   │   └── trace.dat\r\n",
"│   ├── kernel.config\r\n",
"│   ├── kernel.version\r\n",
"│   └── platform.json\r\n",
"├── \u001b[01;34mperf_bench_messaging:eas:perf\u001b[00m\r\n",
"│   ├── \u001b[01;34m1\u001b[00m\r\n",
"│   │   ├── output.log\r\n",
"│   │   ├── performance.json\r\n",
"│   │   └── trace.dat\r\n",
"│   ├── kernel.config\r\n",
"│   ├── kernel.version\r\n",
"│   └── platform.json\r\n",
"├── \u001b[01;34mrtapp:base:rta\u001b[00m\r\n",
"│   ├── \u001b[01;34m1\u001b[00m\r\n",
"│   │   ├── output.log\r\n",
"│   │   ├── rta_00.json\r\n",
"│   │   ├── rt-app-task_p200-0.log\r\n",
"│   │   └── trace.dat\r\n",
"│   ├── kernel.config\r\n",
"│   ├── kernel.version\r\n",
"│   └── platform.json\r\n",
"└── \u001b[01;34mrtapp:eas:rta\u001b[00m\r\n",
" ├── \u001b[01;34m1\u001b[00m\r\n",
" │   ├── output.log\r\n",
" │   ├── rta_00.json\r\n",
" │   ├── rt-app-task_p200-0.log\r\n",
" │   └── trace.dat\r\n",
" ├── kernel.config\r\n",
" ├── kernel.version\r\n",
" └── platform.json\r\n",
"\r\n",
"8 directories, 26 files\r\n"
]
}
],
"source": [
"!tree {executor.te.res_dir}"
]
}
],
"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
}