<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Target Connectivity
Configurable logging system
All LISA modules have been updated to use a more consistent logging which can be configured using a single configuraton file
Step1:  Each module has a unique name which can be used to assign a priority level for messages generated by that module.
Step2:  The default logging level for a notebook can also be easily configured using this few lines
Step3:  Removed Juno/Juno2 distinction
Juno R0 and Juno R2 boards are now accessible by specifying "juno" in the target configuration.
The previous distinction was required because of a different way for the two boards to report HWMON channels.
This distinction is not there anymore and thus Juno boards can now be connected using the same platform data.
Step4:  Executor Module
Simplified tests definition using in-code configurations
Automated LISA tests previously configured the Executor using JSON files. This is still possible, but the existing tests now use Python dictionaries directly in the code. In the short term, this allows de-duplicating configuration elements that are shared between multiple tests. It will later allow more flexible test configuration.
See tests/eas/acceptance.py for an example of how this is currently used.
Support to write files from Executor configuration
https
Step5:  can be used to run a test where the platform is configured to
- disable the "sched_is_big_little" flag (if present)
- set to 50ms the "sched_migration_cost_ns"
Nortice that a value written in a file is verified only if the file path is
prefixed by a '/'. Otherwise, the write never fails, e.g. if the file does not exists.
Support to freeze user-space across a test
https
Step6:  Android Support
Added support for Pixel Phones
A new platform definition file has been added which allows to easily setup
a connection with an Pixel device
Step7:  Added UiBench workload
A new Android benchmark has been added to run UiBench provided tests.
Here is a notebook which provides an example of how to run this test on your
android target
Step8:  This folder is configured to be ignored by git, thus it's the best place to place your work-in-progress notebooks.
Example notebook restructoring
Example notebooks has been consolidated and better organized by topic
<ASSISTANT_TASK:>
Python Code:
!head -n12 $LISA_HOME/logging.conf
Explanation: Target Connectivity
Configurable logging system
All LISA modules have been updated to use a more consistent logging which can be configured using a single configuraton file:
End of explanation
!head -n30 $LISA_HOME/logging.conf | tail -n5
Explanation: Each module has a unique name which can be used to assign a priority level for messages generated by that module.
End of explanation
import logging
from conf import LisaLogging
LisaLogging.setup(level=logging.INFO)
Explanation: The default logging level for a notebook can also be easily configured using this few lines
End of explanation
from env import TestEnv
te = TestEnv({
        'platform'     : 'linux',
        'board'        : 'juno',
        'host'         : '10.1.210.45',
        'username'     : 'root'
    })
target = te.target
Explanation: Removed Juno/Juno2 distinction
Juno R0 and Juno R2 boards are now accessible by specifying "juno" in the target configuration.
The previous distinction was required because of a different way for the two boards to report HWMON channels.
This distinction is not there anymore and thus Juno boards can now be connected using the same platform data.
End of explanation
tests_conf = {
    "confs" : [
        {
            "tag"            : "base",
            "flags"          : "ftrace",
            "sched_features" : "NO_ENERGY_AWARE",
            "cpufreq"        : {
                "governor" : "performance",
            },
            "files"          : {
                '/proc/sys/kernel/sched_is_big_little'           : '0',
                '!/proc/sys/kernel/sched_migration_cost_ns'      : '500000'
            },
        }
    ]
}
Explanation: Executor Module
Simplified tests definition using in-code configurations
Automated LISA tests previously configured the Executor using JSON files. This is still possible, but the existing tests now use Python dictionaries directly in the code. In the short term, this allows de-duplicating configuration elements that are shared between multiple tests. It will later allow more flexible test configuration.
See tests/eas/acceptance.py for an example of how this is currently used.
Support to write files from Executor configuration
https://github.com/ARM-software/lisa/pull/209
A new "files" attribute can be added to Executor configurations which allows
to specify a list files (e.g. sysfs and procfs) and values to be written to that files.
For example, the following test configuration:
End of explanation
from trace import Trace
import json
with open('/home/patbel01/Code/lisa/results/LisaInANutshell_Backup/platform.json', 'r') as fh:
    platform = json.load(fh)
trace = Trace('/home/patbel01/Code/lisa/results/LisaInANutshell_Backup/trace.dat',
    ['sched_switch'], platform
))
logging.info("%d tasks loaded from trace", len(trace.getTasks()))
logging.info("The rt-app task in this trace has these PIDs:")
logging.info("  %s", trace.getTasks()['rt-app'])
Explanation: can be used to run a test where the platform is configured to
- disable the "sched_is_big_little" flag (if present)
- set to 50ms the "sched_migration_cost_ns"
Nortice that a value written in a file is verified only if the file path is
prefixed by a '/'. Otherwise, the write never fails, e.g. if the file does not exists.
Support to freeze user-space across a test
https://github.com/ARM-software/lisa/pull/227
Executor learned the "freeze_userspace" conf flag. When this flag is present, LISA uses the devlib freezer to freeze as much of userspace as possible while the experiment workload is executing, in order to reduce system noise.
The Executor example notebook:
https://github.com/ARM-software/lisa/blob/master/ipynb/examples/utils/executor_example.ipynb
gives an example of using this feature.
Trace module
Tasks name pre-loading
When the Trace module is initialized, by default all the tasks in that trace are identified and exposed via the usual getTask() method:
End of explanation
!cat $LISA_HOME/libs/utils/platforms/pixel.json
from env import TestEnv
te = TestEnv({
        'platform'     : 'android',
        'board'        : 'pixel',
        'ANDROID_HOME' : '/home/patbel01/Code/lisa/tools/android-sdk-linux/'
    }, force_new=True)
target = te.target
Explanation: Android Support
Added support for Pixel Phones
A new platform definition file has been added which allows to easily setup
a connection with an Pixel device:
End of explanation
!tree -L 1 ~/Code/lisa/ipynb
Explanation: Added UiBench workload
A new Android benchmark has been added to run UiBench provided tests.
Here is a notebook which provides an example of how to run this test on your
android target:
https://github.com/ARM-software/lisa/blob/master/ipynb/examples/android/benchmarks/Android_UiBench.ipynb
Tests
Intial version of the preliminary tests
Preliminary tests aim at verifying some basic support required for a
complete functional EAS solution.
A initial version of these preliminary tests is now available:
https://github.com/ARM-software/lisa/blob/master/tests/eas/preliminary.py
and it will be extended in the future to include more and more tests.
Capacity capping test
A new test has been added to verify that capacity capping is working
as expected:
https://github.com/ARM-software/lisa/blob/master/tests/eas/capacity_capping.py
Acceptance tests reworked
The EAS acceptace test collects a set of platform independent tests to verify
basic EAS beahviours.
This test has been cleaned up and it's now avaiable with a detailed documentation:
https://github.com/ARM-software/lisa/blob/master/tests/eas/acceptance.py
Notebooks
Added scratchpad notebooks
A new scratchpad folder has been added under the ipynb folder which collects the available notebooks:
End of explanation
!tree -L 1 ~/Code/lisa/ipynb/examples
Explanation: This folder is configured to be ignored by git, thus it's the best place to place your work-in-progress notebooks.
Example notebook restructoring
Example notebooks has been consolidated and better organized by topic:
End of explanation
<END_TASK>