1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

target: Add Target.read_systcl()

Add a getter to query systcl values.
This commit is contained in:
Douglas Raillard 2023-10-18 18:35:23 +01:00 committed by Marc Bonnici
parent 5104002f1a
commit 18d2a343c7

View File

@ -1178,6 +1178,17 @@ fi
await self.execute.asyn('rm -rf -- {}'.format(quote(path)), as_root=as_root)
# misc
@asyn.asyncf
async def read_sysctl(self, parameter):
"""
Returns the value of the given sysctl parameter as a string.
"""
path = target.path.join('proc', 'sys', *parameter.split('.'))
try:
return await self.read_value.asyn(path)
except FileNotFoundError as e:
raise ValueError(f'systcl parameter {parameter} was not found: {e}')
def core_cpus(self, core):
return [i for i, c in enumerate(self.core_names) if c == core]