Skip to content

Commit

Permalink
bug 1512499 - handle psutil returning None for physical_cores. r=froydnj
Browse files Browse the repository at this point in the history
psutil has a bug on arm systems where it will return None for physical_cores:
giampaolo/psutil#1359

This causes us to generate invalid telemetry data which raises an error. Fix
this by simply omitting the field in this case.

Differential Revision: https://phabricator.services.mozilla.com/D14969
  • Loading branch information
luser committed Dec 19, 2018
1 parent d43c486 commit 47aaa22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/mozbuild/mozbuild/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ def get_system_info():
import psutil

info['logical_cores'] = psutil.cpu_count()
info['physical_cores'] = psutil.cpu_count(logical=False)
physical_cores = psutil.cpu_count(logical=False)
if physical_cores is not None:
info['physical_cores'] = physical_cores
# `total` on Linux is gathered from /proc/meminfo's `MemTotal`, which is the total
# amount of physical memory minus some kernel usage, so round up to the nearest GB
# to get a sensible answer.
Expand Down

0 comments on commit 47aaa22

Please sign in to comment.