mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
cgroups: keep track if a controller is mounted with noprefix option
CGroups controller can be mounted by specifying a "noprefix" option, in which case attribute names are named as: <mountpoint>/<attribute_name> instead of the (more recent) naming schema using: <mountpoint>/<contoller_name>.<attribute_name> For example, Android uses the old format for backward compatibility with user-space. Thus, it's possible in general to work on a target system where some controller are mounted "noprefix" while others not. This patchset adds a set of updates which allows to use the proper attributes naming schema based on how the controller has been mounted. This first patch keeps track of whatever a controller has been mounted using the noprefix option. Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
parent
28739397c0
commit
15f9c03b45
@ -34,6 +34,7 @@ class Controller(object):
|
|||||||
self.mount_name = 'devlib_'+kind
|
self.mount_name = 'devlib_'+kind
|
||||||
self.kind = kind
|
self.kind = kind
|
||||||
self.target = None
|
self.target = None
|
||||||
|
self._noprefix = False
|
||||||
|
|
||||||
self.logger = logging.getLogger('cgroups.'+self.kind)
|
self.logger = logging.getLogger('cgroups.'+self.kind)
|
||||||
self.mount_point = None
|
self.mount_point = None
|
||||||
@ -68,8 +69,15 @@ class Controller(object):
|
|||||||
self.mount_point),
|
self.mount_point),
|
||||||
as_root=True)
|
as_root=True)
|
||||||
|
|
||||||
self.logger.debug('Controller %s mounted under: %s',
|
# Check if this controller uses "noprefix" option
|
||||||
self.kind, self.mount_point)
|
output = target.execute('mount | grep "{} "'.format(self.mount_name))
|
||||||
|
if 'noprefix' in output:
|
||||||
|
self._noprefix = True
|
||||||
|
# self.logger.debug('Controller %s using "noprefix" option',
|
||||||
|
# self.kind)
|
||||||
|
|
||||||
|
self.logger.debug('Controller %s mounted under: %s (noprefix=%s)',
|
||||||
|
self.kind, self.mount_point, self._noprefix)
|
||||||
|
|
||||||
# Mark this contoller as available
|
# Mark this contoller as available
|
||||||
self.target = target
|
self.target = target
|
||||||
|
Loading…
x
Reference in New Issue
Block a user