mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-30 17:50:46 +00:00
Patrick Bellasi
9c9a74826a
cgroups: big refactoring to make it more generic
This patch refactors the CGroup module to support multiple controllers. The new interface is based on two main classes: .:: Controller(kind) Provides a wrapper class for a CGgroup controller of "kind". At module initialization time, all the controller available in the system are enumerated and a corresponding controller class created. A valid reference to the Controller class for a specific CGroup controller can be obtained using the controller(kind) method exposed by the module, e.g. to get a reference to the CPUSET controller: cpuset = target.cgroups.controller('cpuset') .:: CGroup(name) Provides a wrapper class for a CGroup of "name", i.e. a folder which path is "name" relative to the controller mount point. At module initialization time, the root control group for each controller is created by the controller class. A valid reference to a CGroup for a specific controller can be obtained using the cgroup(name) method exposed by the controller object, e.g. to get a reference to the "/LITTLE" cgroup of the cpuset controller: cpuset_littles = cpuset.cgroup('/LITTLE') The CGroup object exposes simple get()/set() methods which allows to read and configure all the supported attributes of a controller. For example, to set the "cpus" of a cpuset control group: cpuset_littles.set(cpus=[0,1]) NOTE: the set() method accepts a variable list of parameters which name must match a valid (writable) attribute for that controller. Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
devlib ====== ``devlib`` exposes an interface for interacting with and collecting measurements from a variety of devices (such as mobile phones, tablets and development boards) running a Linux-based operating system. Installation ------------ :: sudo -H pip install devlib Usage ----- Please refer to the "Overview" section of the documentation. License ------- This package is distributed under `Apache v2.0 License <http://www.apache.org/licenses/LICENSE-2.0>`_. Feedback, Contrubutions and Support ----------------------------------- - Please use the GitHub Issue Tracker associated with this repository for feedback. - ARM licensees may contact ARM directly via their partner managers. - We welcome code contributions via GitHub Pull requests. Please try to stick to the style in the rest of the code for your contributions.
Description
Languages
Python
96%
Shell
1.8%
C
1.4%
Java
0.5%
Dockerfile
0.3%