mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 10:10:46 +00:00
Add NUMA nodes
This commit is contained in:
parent
0fa91d6c4c
commit
aa64951398
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user