synthetics_example


Synthetic test example


In [1]:
import logging
from lisa.utils import setup_logging
setup_logging()


2019-02-25 18:48:50,380 INFO    : root         : Using LISA logging configuration:
2019-02-25 18:48:50,380 INFO    : root         :   lisa/remove_testenv/logging.conf

Target configuration


In [2]:
from lisa.target import Target, TargetConf

In [3]:
# target = Target(
#     kind='linux',
#     name='myhikey960',    
#     host='192.168.0.1',
#     username='root',
#     password='root',
# )
# Uses settings from target_conf.yml
target = Target.from_default_conf()


2019-02-25 18:48:50,919 INFO    : lisa.target.Target : Creating result directory: lisa/remove_testenv/results/Target-myhikey960-20190225_184850.919127
2019-02-25 18:48:50,921 INFO    : lisa.target.Target : linux myhikey960 target connection settings:
2019-02-25 18:48:50,921 INFO    : lisa.target.Target :   username : root
2019-02-25 18:48:50,922 INFO    : lisa.target.Target :       port : 22
2019-02-25 18:48:50,923 INFO    : lisa.target.Target :       host : pwrsft-hikey960-1
2019-02-25 18:48:50,923 INFO    : lisa.target.Target :   password : root
2019-02-25 18:48:50,930 INFO    : lisa.target.Target : Devlib modules to load: bl, cgroups, cpufreq, cpuidle, devfreq, fastboot, gem5stats, gpufreq, hotplug, hwmon, mbed-fan, odroidxu3-fan, sched, thermal
2019-02-25 18:48:55,551 WARNING : LinuxTarget  : Module devfreq is not supported by the target
2019-02-25 18:48:55,553 WARNING : LinuxTarget  : Module fastboot is not supported by the target
2019-02-25 18:48:55,554 WARNING : LinuxTarget  : Module gem5stats is not supported by the target
2019-02-25 18:48:55,718 WARNING : LinuxTarget  : Module gpufreq is not supported by the target
2019-02-25 18:48:56,410 WARNING : LinuxTarget  : Module odroidxu3-fan is not supported by the target
2019-02-25 18:48:58,336 INFO    : CGroups      : Available controllers:
2019-02-25 18:48:58,837 INFO    : CGroups      :   cpuset       : /root/devlib-target/cgroups/devlib_cgh1
2019-02-25 18:48:59,341 INFO    : CGroups      :   cpu          : /root/devlib-target/cgroups/devlib_cgh1
2019-02-25 18:48:59,841 INFO    : CGroups      :   cpuacct      : /root/devlib-target/cgroups/devlib_cgh1
2019-02-25 18:49:00,343 INFO    : CGroups      :   blkio        : /root/devlib-target/cgroups/devlib_cgh1
2019-02-25 18:49:00,845 INFO    : CGroups      :   memory       : /root/devlib-target/cgroups/devlib_cgh1
2019-02-25 18:49:01,348 INFO    : CGroups      :   devices      : /root/devlib-target/cgroups/devlib_cgh1
2019-02-25 18:49:01,851 INFO    : CGroups      :   freezer      : /root/devlib-target/cgroups/devlib_cgh1
2019-02-25 18:49:02,352 INFO    : CGroups      :   perf_event   : /root/devlib-target/cgroups/devlib_cgh1
2019-02-25 18:49:02,853 INFO    : CGroups      :   hugetlb      : /root/devlib-target/cgroups/devlib_cgh1
2019-02-25 18:49:03,354 INFO    : CGroups      :   pids         : /root/devlib-target/cgroups/devlib_cgh1
2019-02-25 18:49:03,521 WARNING : lisa.target.Target : Failed to initialized "devfreq" devlib Module
2019-02-25 18:49:03,523 WARNING : lisa.target.Target : Failed to initialized "fastboot" devlib Module
2019-02-25 18:49:03,523 WARNING : lisa.target.Target : Failed to initialized "gem5stats" devlib Module
2019-02-25 18:49:03,524 WARNING : lisa.target.Target : Failed to initialized "gpufreq" devlib Module
2019-02-25 18:49:03,524 WARNING : lisa.target.Target : Failed to initialized "mbed-fan" devlib Module
2019-02-25 18:49:03,525 WARNING : lisa.target.Target : Failed to initialized "odroidxu3-fan" devlib Module
2019-02-25 18:49:03,526 INFO    : lisa.platforms.platinfo.PlatformInfo : Attempting to read energy model from target
2019-02-25 18:49:04,186 INFO    : lisa.energy_model.EnergyModel.EMReader : Attempting to load EM using from_debugfsEM_target
2019-02-25 18:49:09,844 INFO    : lisa.target.Target : Effective platform information:
|- abi from target (str): arm64
|- cpu-capacities from target (dict): {0: 462, 1: 462, 2: 462, 3: 462, 4: 1024, 5: 1024, 6: 1024, 7: 1024}
|- cpus-count from target (int): 8
|- freq-domains from target (list): [[0, 1, 2, 3], [4, 5, 6, 7]]
|- freqs from target (dict): {0: [533000, 999000, 1402000, 1709000, 1844000], 1: [533000, 999000, 1402000, 1709000, 1844000], 2: [533000, 999000, 1402000, 1709000, 1844000], 3: [533000, 999000, 1402000, 1709000, 1844000], 4: [903000, 1421000, 1805000, 2112000, 2362000], 5: [903000, 1421000, 1805000, 2112000, 2362000], 6: [903000, 1421000, 1805000, 2112000, 2362000], 7: [903000, 1421000, 1805000, 2112000, 2362000]}
+- kernel:
    |- config from target (TypedKernelConfig): <kernel config>
    |- version from target (KernelVersion): 5.0.0-rc6 27 SMP PREEMPT Tue Feb 19 17:28:19 GMT 2019
|- name from target-conf (str): myhikey960
|- nrg-model from target (EnergyModel): <lisa.energy_model.EnergyModel object at 0x7f1a4e2ce7b8>
|- os from target (str): linux
+- rtapp:
    |- calib from target (DeferredValue): <lazy value of RTA.get_cpu_calibrations>
|- capacity-classes from target(platform-info/cpu-capacities) (list): [[0, 1, 2, 3], [4, 5, 6, 7]]

Live target experimentation


In [4]:
from lisa.tests.scheduler.eas_behaviour import EnergyModelWakeMigration

We want to create a TestBundle from a live target, so we can use the from_target alternative constructor:


In [5]:
bundle = EnergyModelWakeMigration.from_target(target)


2019-02-25 18:49:10,599 INFO    : lisa.target.Target : Creating result directory: lisa/remove_testenv/results/Target-myhikey960-20190225_184850.919127/EnergyModelWakeMigration-20190225_184910.599696
2019-02-25 18:49:23,489 INFO    : lisa.wlgen.rta.RTA : CPU0 calibration...
2019-02-25 18:49:23,801 INFO    : lisa.wlgen.rta.RTA : Calibration value: CPU0
2019-02-25 18:49:23,802 INFO    : lisa.wlgen.rta.RTA : Default policy: SCHED_OTHER
2019-02-25 18:49:23,803 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:49:23,804 INFO    : lisa.wlgen.rta.RTA : task [task1], sched: using default policy
2019-02-25 18:49:23,805 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:49:23,806 INFO    : lisa.wlgen.rta.RTA :  | loops count: 1
2019-02-25 18:49:23,807 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:49:23,808 INFO    : lisa.wlgen.rta.Phase :  | batch 0.001000 [s]
2019-02-25 18:49:23,995 INFO    : lisa.wlgen.rta.RTA : Execution start: /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_cpu0.json 2>&1
2019-02-25 18:49:30,503 INFO    : lisa.wlgen.rta.RTA : Execution complete
2019-02-25 18:49:30,695 INFO    : lisa.wlgen.rta.RTA : CPU1 calibration...
2019-02-25 18:49:31,008 INFO    : lisa.wlgen.rta.RTA : Calibration value: CPU1
2019-02-25 18:49:31,009 INFO    : lisa.wlgen.rta.RTA : Default policy: SCHED_OTHER
2019-02-25 18:49:31,009 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:49:31,010 INFO    : lisa.wlgen.rta.RTA : task [task1], sched: using default policy
2019-02-25 18:49:31,011 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:49:31,011 INFO    : lisa.wlgen.rta.RTA :  | loops count: 1
2019-02-25 18:49:31,012 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:49:31,013 INFO    : lisa.wlgen.rta.Phase :  | batch 0.001000 [s]
2019-02-25 18:49:31,207 INFO    : lisa.wlgen.rta.RTA : Execution start: /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_cpu1.json 2>&1
2019-02-25 18:49:38,781 INFO    : lisa.wlgen.rta.RTA : Execution complete
2019-02-25 18:49:38,963 INFO    : lisa.wlgen.rta.RTA : CPU2 calibration...
2019-02-25 18:49:39,275 INFO    : lisa.wlgen.rta.RTA : Calibration value: CPU2
2019-02-25 18:49:39,277 INFO    : lisa.wlgen.rta.RTA : Default policy: SCHED_OTHER
2019-02-25 18:49:39,278 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:49:39,280 INFO    : lisa.wlgen.rta.RTA : task [task1], sched: using default policy
2019-02-25 18:49:39,281 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:49:39,281 INFO    : lisa.wlgen.rta.RTA :  | loops count: 1
2019-02-25 18:49:39,282 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:49:39,282 INFO    : lisa.wlgen.rta.Phase :  | batch 0.001000 [s]
2019-02-25 18:49:39,461 INFO    : lisa.wlgen.rta.RTA : Execution start: /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_cpu2.json 2>&1
2019-02-25 18:49:45,968 INFO    : lisa.wlgen.rta.RTA : Execution complete
2019-02-25 18:49:46,153 INFO    : lisa.wlgen.rta.RTA : CPU3 calibration...
2019-02-25 18:49:46,465 INFO    : lisa.wlgen.rta.RTA : Calibration value: CPU3
2019-02-25 18:49:46,466 INFO    : lisa.wlgen.rta.RTA : Default policy: SCHED_OTHER
2019-02-25 18:49:46,466 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:49:46,467 INFO    : lisa.wlgen.rta.RTA : task [task1], sched: using default policy
2019-02-25 18:49:46,468 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:49:46,468 INFO    : lisa.wlgen.rta.RTA :  | loops count: 1
2019-02-25 18:49:46,469 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:49:46,470 INFO    : lisa.wlgen.rta.Phase :  | batch 0.001000 [s]
2019-02-25 18:49:46,661 INFO    : lisa.wlgen.rta.RTA : Execution start: /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_cpu3.json 2>&1
2019-02-25 18:49:53,170 INFO    : lisa.wlgen.rta.RTA : Execution complete
2019-02-25 18:49:53,363 INFO    : lisa.wlgen.rta.RTA : CPU4 calibration...
2019-02-25 18:49:53,677 INFO    : lisa.wlgen.rta.RTA : Calibration value: CPU4
2019-02-25 18:49:53,679 INFO    : lisa.wlgen.rta.RTA : Default policy: SCHED_OTHER
2019-02-25 18:49:53,681 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:49:53,683 INFO    : lisa.wlgen.rta.RTA : task [task1], sched: using default policy
2019-02-25 18:49:53,685 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:49:53,686 INFO    : lisa.wlgen.rta.RTA :  | loops count: 1
2019-02-25 18:49:53,688 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:49:53,690 INFO    : lisa.wlgen.rta.Phase :  | batch 0.001000 [s]
2019-02-25 18:49:53,881 INFO    : lisa.wlgen.rta.RTA : Execution start: /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_cpu4.json 2>&1
2019-02-25 18:50:01,255 INFO    : lisa.wlgen.rta.RTA : Execution complete
2019-02-25 18:50:01,450 INFO    : lisa.wlgen.rta.RTA : CPU5 calibration...
2019-02-25 18:50:01,763 INFO    : lisa.wlgen.rta.RTA : Calibration value: CPU5
2019-02-25 18:50:01,763 INFO    : lisa.wlgen.rta.RTA : Default policy: SCHED_OTHER
2019-02-25 18:50:01,764 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:50:01,765 INFO    : lisa.wlgen.rta.RTA : task [task1], sched: using default policy
2019-02-25 18:50:01,766 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:50:01,767 INFO    : lisa.wlgen.rta.RTA :  | loops count: 1
2019-02-25 18:50:01,768 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:50:01,769 INFO    : lisa.wlgen.rta.Phase :  | batch 0.001000 [s]
2019-02-25 18:50:01,957 INFO    : lisa.wlgen.rta.RTA : Execution start: /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_cpu5.json 2>&1
2019-02-25 18:50:09,334 INFO    : lisa.wlgen.rta.RTA : Execution complete
2019-02-25 18:50:09,522 INFO    : lisa.wlgen.rta.RTA : CPU6 calibration...
2019-02-25 18:50:09,835 INFO    : lisa.wlgen.rta.RTA : Calibration value: CPU6
2019-02-25 18:50:09,836 INFO    : lisa.wlgen.rta.RTA : Default policy: SCHED_OTHER
2019-02-25 18:50:09,837 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:50:09,838 INFO    : lisa.wlgen.rta.RTA : task [task1], sched: using default policy
2019-02-25 18:50:09,840 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:50:09,841 INFO    : lisa.wlgen.rta.RTA :  | loops count: 1
2019-02-25 18:50:09,843 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:50:09,844 INFO    : lisa.wlgen.rta.Phase :  | batch 0.001000 [s]
2019-02-25 18:50:10,024 INFO    : lisa.wlgen.rta.RTA : Execution start: /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_cpu6.json 2>&1
2019-02-25 18:50:17,401 INFO    : lisa.wlgen.rta.RTA : Execution complete
2019-02-25 18:50:17,597 INFO    : lisa.wlgen.rta.RTA : CPU7 calibration...
2019-02-25 18:50:17,909 INFO    : lisa.wlgen.rta.RTA : Calibration value: CPU7
2019-02-25 18:50:17,911 INFO    : lisa.wlgen.rta.RTA : Default policy: SCHED_OTHER
2019-02-25 18:50:17,912 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:50:17,913 INFO    : lisa.wlgen.rta.RTA : task [task1], sched: using default policy
2019-02-25 18:50:17,915 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:50:17,916 INFO    : lisa.wlgen.rta.RTA :  | loops count: 1
2019-02-25 18:50:17,917 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:50:17,919 INFO    : lisa.wlgen.rta.Phase :  | batch 0.001000 [s]
2019-02-25 18:50:18,108 INFO    : lisa.wlgen.rta.RTA : Execution start: /root/devlib-target/bin/rt-app /root/devlib-target/rta_calib_cpu7.json 2>&1
2019-02-25 18:50:25,485 INFO    : lisa.wlgen.rta.RTA : Execution complete
2019-02-25 18:50:25,684 INFO    : lisa.wlgen.rta.RTA : Target RT-App calibration: {0: 305, 1: 305, 2: 302, 3: 302, 4: 137, 5: 137, 6: 137, 7: 137}
2019-02-25 18:50:28,750 INFO    : lisa.wlgen.rta.RTA : Calibration value: 137
2019-02-25 18:50:28,751 INFO    : lisa.wlgen.rta.RTA : Default policy: SCHED_OTHER
2019-02-25 18:50:28,751 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:50:28,752 INFO    : lisa.wlgen.rta.RTA : task [emwm_0], sched: using default policy
2019-02-25 18:50:28,752 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:50:28,753 INFO    : lisa.wlgen.rta.RTA :  | loops count: 2
2019-02-25 18:50:28,754 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:50:28,754 INFO    : lisa.wlgen.rta.Phase :  | duration 2.000000 [s] (125 loops)
2019-02-25 18:50:28,755 INFO    : lisa.wlgen.rta.Phase :  |  period    16000 [us], duty_cycle   9 %
2019-02-25 18:50:28,755 INFO    : lisa.wlgen.rta.Phase :  |  run_time   1440 [us], sleep_time  14560 [us]
2019-02-25 18:50:28,756 INFO    : lisa.wlgen.rta.RTA :  + phase_000002
2019-02-25 18:50:28,756 INFO    : lisa.wlgen.rta.Phase :  | duration 2.000000 [s] (125 loops)
2019-02-25 18:50:28,757 INFO    : lisa.wlgen.rta.Phase :  |  period    16000 [us], duty_cycle  70 %
2019-02-25 18:50:28,757 INFO    : lisa.wlgen.rta.Phase :  |  run_time  11200 [us], sleep_time   4800 [us]
2019-02-25 18:50:28,758 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:50:28,758 INFO    : lisa.wlgen.rta.RTA : task [emwm_1], sched: using default policy
2019-02-25 18:50:28,759 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:50:28,759 INFO    : lisa.wlgen.rta.RTA :  | loops count: 2
2019-02-25 18:50:28,760 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:50:28,760 INFO    : lisa.wlgen.rta.Phase :  | duration 2.000000 [s] (125 loops)
2019-02-25 18:50:28,761 INFO    : lisa.wlgen.rta.Phase :  |  period    16000 [us], duty_cycle   9 %
2019-02-25 18:50:28,762 INFO    : lisa.wlgen.rta.Phase :  |  run_time   1440 [us], sleep_time  14560 [us]
2019-02-25 18:50:28,762 INFO    : lisa.wlgen.rta.RTA :  + phase_000002
2019-02-25 18:50:28,763 INFO    : lisa.wlgen.rta.Phase :  | duration 2.000000 [s] (125 loops)
2019-02-25 18:50:28,763 INFO    : lisa.wlgen.rta.Phase :  |  period    16000 [us], duty_cycle  70 %
2019-02-25 18:50:28,764 INFO    : lisa.wlgen.rta.Phase :  |  run_time  11200 [us], sleep_time   4800 [us]
2019-02-25 18:50:28,764 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:50:28,765 INFO    : lisa.wlgen.rta.RTA : task [emwm_2], sched: using default policy
2019-02-25 18:50:28,765 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:50:28,765 INFO    : lisa.wlgen.rta.RTA :  | loops count: 2
2019-02-25 18:50:28,766 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:50:28,766 INFO    : lisa.wlgen.rta.Phase :  | duration 2.000000 [s] (125 loops)
2019-02-25 18:50:28,767 INFO    : lisa.wlgen.rta.Phase :  |  period    16000 [us], duty_cycle   9 %
2019-02-25 18:50:28,767 INFO    : lisa.wlgen.rta.Phase :  |  run_time   1440 [us], sleep_time  14560 [us]
2019-02-25 18:50:28,768 INFO    : lisa.wlgen.rta.RTA :  + phase_000002
2019-02-25 18:50:28,768 INFO    : lisa.wlgen.rta.Phase :  | duration 2.000000 [s] (125 loops)
2019-02-25 18:50:28,768 INFO    : lisa.wlgen.rta.Phase :  |  period    16000 [us], duty_cycle  70 %
2019-02-25 18:50:28,769 INFO    : lisa.wlgen.rta.Phase :  |  run_time  11200 [us], sleep_time   4800 [us]
2019-02-25 18:50:28,770 INFO    : lisa.wlgen.rta.RTA : ------------------------
2019-02-25 18:50:28,770 INFO    : lisa.wlgen.rta.RTA : task [emwm_3], sched: using default policy
2019-02-25 18:50:28,770 INFO    : lisa.wlgen.rta.RTA :  | start delay: 0.000000 [s]
2019-02-25 18:50:28,771 INFO    : lisa.wlgen.rta.RTA :  | loops count: 2
2019-02-25 18:50:28,771 INFO    : lisa.wlgen.rta.RTA :  + phase_000001
2019-02-25 18:50:28,772 INFO    : lisa.wlgen.rta.Phase :  | duration 2.000000 [s] (125 loops)
2019-02-25 18:50:28,772 INFO    : lisa.wlgen.rta.Phase :  |  period    16000 [us], duty_cycle   9 %
2019-02-25 18:50:28,773 INFO    : lisa.wlgen.rta.Phase :  |  run_time   1440 [us], sleep_time  14560 [us]
2019-02-25 18:50:28,773 INFO    : lisa.wlgen.rta.RTA :  + phase_000002
2019-02-25 18:50:28,774 INFO    : lisa.wlgen.rta.Phase :  | duration 2.000000 [s] (125 loops)
2019-02-25 18:50:28,774 INFO    : lisa.wlgen.rta.Phase :  |  period    16000 [us], duty_cycle  70 %
2019-02-25 18:50:28,775 INFO    : lisa.wlgen.rta.Phase :  |  run_time  11200 [us], sleep_time   4800 [us]
2019-02-25 18:50:29,033 INFO    : lisa.trace.FtraceCollector : Ftrace configuration:
|- buffer-size from default (int): 10240
|- events from RTATestBundle (list): ['sched_switch']
|- functions from default (list): []
2019-02-25 18:50:34,982 INFO    : lisa.target.Target : Freezing all tasks except: init,systemd,dbus,sh,ssh,rsyslogd,jbd2
2019-02-25 18:50:36,522 INFO    : lisa.wlgen.rta.RTA : Execution start: /root/devlib-target/bin/rt-app /root/devlib-target/rta_energymodelwakemigration.json 2>&1
2019-02-25 18:50:44,777 INFO    : lisa.wlgen.rta.RTA : Execution complete
2019-02-25 18:50:45,753 INFO    : lisa.target.Target : Un-freezing userspace tasks

We now have a Target instance. We're free to play around with its data, more specifically to execute some tests related to this data:


In [6]:
print(bundle.test_slack())


PASSED: emwm_2 delayed activations=1.2 %, emwm_0 delayed activations=1.2 %, emwm_1 delayed activations=1.2 %, emwm_3 delayed activations=1.2 %
lisa/remove_testenv/lisa/perf_analysis.py:133: FutureWarning: read_table is deprecated, use read_csv instead.
  'Slack', 'CRun', 'CPeriod', 'WKPLatency'

Whenever possible, we want to expose test margins to the end user. Here, we can change the failure threshold, and for the sake of demonstration we'll set it way too low (and expect a failure)


In [7]:
print(bundle.test_slack(negative_slack_allowed_pct=1))


FAILED: emwm_2 delayed activations=1.2 %, emwm_0 delayed activations=1.2 %, emwm_1 delayed activations=1.2 %, emwm_3 delayed activations=1.2 %

This test also produces a plot, let's run it and have a look


In [8]:
print(bundle.test_task_placement())


PASSED: estimated energy=11747.642996651268 bogo-joules, energy threshold=12697.384476751002 bogo-joules

In [9]:
bundle.trace.df_all_events()

In [11]:
import os
from IPython.display import Image

In [12]:
image_path = os.path.join(bundle.res_dir, "expected_placement.png")
Image(image_path)


Out[12]:

Offline replaying

Say someone executed some tests, and ran into some issues. They can create an archive of the results directory and send it your way, and you'll be able to reload it automagically. This also works if you are working on the test code itself, and don't want to re-execute the workload every single time you change the code.


In [13]:
# Let's just reuse what was generated in the previous run
archive_dir = bundle.res_dir

In [14]:
reloaded_bundle = EnergyModelWakeMigration.from_dir(archive_dir)

In [15]:
# Just to prove we're not cheating!
reloaded_bundle == bundle


Out[15]:
False

In [16]:
print(reloaded_bundle.test_task_placement())


PASSED: estimated energy=11747.642996651268 bogo-joules, energy threshold=12697.384476751002 bogo-joules