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

Add NUMA nodes

This commit is contained in:
Peter Puhov 2019-11-22 10:05:03 -05:00 committed by Marc Bonnici
parent 0fa91d6c4c
commit aa64951398

View File

@ -160,6 +160,27 @@ class Target(object):
num_cpus += 1
return num_cpus
@property
@memoized
def number_of_nodes(self):
num_nodes = 0
nodere = re.compile(r'^\s*node\d+\s*$')
output = self.execute('ls /sys/devices/system/node', as_root=self.is_rooted)
for entry in output.split():
if nodere.match(entry):
num_nodes += 1
return num_nodes
@property
@memoized
def list_nodes_cpus(self):
nodes_cpus = []
for node in range(self.number_of_nodes):
path = self.path.join('/sys/devices/system/node/node{}/cpulist'.format(node))
output = self.read_value(path)
nodes_cpus.append(ranges_to_list(output))
return nodes_cpus
@property
@memoized
def config(self):