56
56
PROCS .update ({
57
57
"./loggerd" : 70.0 ,
58
58
"selfdrive.controls.controlsd" : 31.0 ,
59
- "./camerad" : 36.8 ,
59
+ "./camerad" : 41.0 ,
60
60
"./_ui" : 33.0 ,
61
61
"selfdrive.controls.plannerd" : 11.7 ,
62
62
"./_dmonitoringmodeld" : 10.0 ,
@@ -106,6 +106,7 @@ def check_cpu_usage(first_proc, last_proc):
106
106
r = True
107
107
dt = (last_proc .logMonoTime - first_proc .logMonoTime ) / 1e9
108
108
for proc_name , normal_cpu_usage in PROCS .items ():
109
+ err = ""
109
110
first , last = None , None
110
111
try :
111
112
first = [p for p in first_proc .procLog .procs if proc_name in p .cmdline ][0 ]
@@ -115,15 +116,16 @@ def check_cpu_usage(first_proc, last_proc):
115
116
if cpu_usage > max (normal_cpu_usage * 1.15 , normal_cpu_usage + 5.0 ):
116
117
# cpu usage is high while playing sounds
117
118
if not (proc_name == "./_soundd" and cpu_usage < 65. ):
118
- result += f"Warning { proc_name } using more CPU than normal\n "
119
- r = False
119
+ err = "using more CPU than normal"
120
120
elif cpu_usage < min (normal_cpu_usage * 0.65 , max (normal_cpu_usage - 1.0 , 0.0 )):
121
- result += f"Warning { proc_name } using less CPU than normal\n "
122
- r = False
123
- result += f"{ proc_name .ljust (35 )} { cpu_usage :.2f} %\n "
121
+ err = "using less CPU than normal"
124
122
except IndexError :
125
- result += f"{ proc_name .ljust (35 )} NO METRICS FOUND { first = } { last = } \n "
123
+ err = f"NO METRICS FOUND { first = } { last = } \n "
124
+
125
+ result += f"{ proc_name .ljust (35 )} { cpu_usage :5.2f} % ({ normal_cpu_usage :5.2f} %) { err } \n "
126
+ if len (err ) > 0 :
126
127
r = False
128
+
127
129
result += "------------------------------------------------\n "
128
130
print (result )
129
131
return r
0 commit comments