MCPcopy Index your code
hub / github.com/nodejs/node / GetCPUCoresRange

Method GetCPUCoresRange

deps/v8/tools/run_perf.py:1092–1102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1090
1091 @staticmethod
1092 def GetCPUCoresRange():
1093 try:
1094 with open('/sys/devices/system/cpu/present', 'r') as f:
1095 indexes = f.readline()
1096 r = list(map(int, indexes.split('-')))
1097 if len(r) == 1:
1098 return list(range(r[0], r[0] + 1))
1099 return list(range(r[0], r[1] + 1))
1100 except Exception:
1101 logging.exception('Failed to retrieve number of CPUs.')
1102 raise
1103
1104 @staticmethod
1105 def GetCPUPathForId(cpu_index):

Callers 2

GetCPUGovernorMethod · 0.80
SetCPUGovernorMethod · 0.80

Calls 6

exceptionMethod · 0.80
openFunction · 0.50
listFunction · 0.50
mapFunction · 0.50
rangeFunction · 0.50
splitMethod · 0.45

Tested by

no test coverage detected