diff --git a/selfdrive/debug/live_cpu_and_temp.py b/selfdrive/debug/live_cpu_and_temp.py index 6e10296204..8322e9108c 100755 --- a/selfdrive/debug/live_cpu_and_temp.py +++ b/selfdrive/debug/live_cpu_and_temp.py @@ -49,7 +49,7 @@ if __name__ == "__main__": if sm.updated['thermal']: t = sm['thermal'] - last_temp = np.mean([t.cpu0, t.cpu1, t.cpu2, t.cpu3]) / 10. + last_temp = np.mean(t.cpu) last_mem = t.memUsedPercent if sm.updated['procLog']: diff --git a/selfdrive/tombstoned.py b/selfdrive/tombstoned.py index fbebddbd72..e43f983712 100755 --- a/selfdrive/tombstoned.py +++ b/selfdrive/tombstoned.py @@ -17,10 +17,12 @@ def get_tombstones(): files = [] for folder in ["/data/tombstones/", "/var/crash/"]: if os.path.exists(folder): - for fn in os.listdir(folder): - if fn.startswith("tombstone") or fn.endswith(".crash"): - path = os.path.join(folder, fn) - files.append((path, int(os.stat(path).st_ctime))) + with os.scandir(folder) as d: + + # Loop over first 1000 directory entries + for _, f in zip(range(1000), d): + if f.name.startswith("tombstone") or f.name.endswith(".crash"): + files.append((f.path, int(f.stat().st_ctime))) return files