mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
Patrick Bellasi
b569a561a4
cgroups: add support for multi-controller hierarchies
Some systems mount multiple CGroup controllers in the same hierarchy, this happens in desktop systems using systemd but it's also the default for systems using CGroups v2. Unfortunately the current CGroup modules can mount only single-controller hierarchies, thus failing when a controller is already mounted with others in a single hierarchy. This patch fixes this issue by: - keeping track of which controllers are mounted in each hierarchy - muting hierarchies instead of controllers - creating Controller objects which reference the hierarchy they belong to Thus, the new constructor of the Controller object requires to specify the hierarchy ID as well as the list of controller which have to be mounted in that hierarchy. The hierarchy ID is used to create a single mount point for all the controllers in that hierarchy. This single mount points are now named: <CGMOUNT>/devlib_cgh<ID> where "cgh" stands for "CGroup Hierarchy" and <ID> is the specified numerical identified of that hierarchy. This patch removes also the Controller::__new__() method, which seems not to have sense anymore, as well as the Controller::probe() method, which is not more used. Indeed, all and only the available hierarchies are pre-mounted at module initialization time. 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%