mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
* Revert "Remove `setproctitle` (#32716)" This reverts commit 9020d1931f4cd72f8162e4402278bdf76e3746f2. * uv lock * old name old-commit-hash: 29b58d4f2fcc982d5c06ed8391e368b1b293a96c
This commit is contained in:
@@ -6,7 +6,7 @@ import numpy as np
|
||||
import cereal.messaging as messaging
|
||||
from cereal import car, log
|
||||
from pathlib import Path
|
||||
from openpilot.common.threadname import setthreadname
|
||||
from setproctitle import setproctitle
|
||||
from cereal.messaging import PubMaster, SubMaster
|
||||
from msgq.visionipc import VisionIpcClient, VisionStreamType, VisionBuf
|
||||
from openpilot.common.swaglog import cloudlog
|
||||
@@ -24,7 +24,7 @@ from openpilot.selfdrive.modeld.fill_model_msg import fill_model_msg, fill_pose_
|
||||
from openpilot.selfdrive.modeld.constants import ModelConstants
|
||||
from openpilot.selfdrive.modeld.models.commonmodel_pyx import ModelFrame, CLContext
|
||||
|
||||
THREAD_NAME = "selfdrive.modeld.modeld"
|
||||
PROCESS_NAME = "selfdrive.modeld.modeld"
|
||||
SEND_RAW_PRED = os.getenv('SEND_RAW_PRED')
|
||||
|
||||
MODEL_PATHS = {
|
||||
@@ -114,9 +114,9 @@ class ModelState:
|
||||
def main(demo=False):
|
||||
cloudlog.warning("modeld init")
|
||||
|
||||
sentry.set_tag("daemon", THREAD_NAME)
|
||||
cloudlog.bind(daemon=THREAD_NAME)
|
||||
setthreadname("modeld")
|
||||
sentry.set_tag("daemon", PROCESS_NAME)
|
||||
cloudlog.bind(daemon=PROCESS_NAME)
|
||||
setproctitle(PROCESS_NAME)
|
||||
config_realtime_process(7, 54)
|
||||
|
||||
cloudlog.warning("setting up CL context")
|
||||
@@ -290,7 +290,7 @@ if __name__ == "__main__":
|
||||
args = parser.parse_args()
|
||||
main(demo=args.demo)
|
||||
except KeyboardInterrupt:
|
||||
cloudlog.warning(f"child {THREAD_NAME} got SIGINT")
|
||||
cloudlog.warning(f"child {PROCESS_NAME} got SIGINT")
|
||||
except Exception:
|
||||
sentry.capture_exception()
|
||||
raise
|
||||
|
||||
@@ -37,26 +37,26 @@ PROCS = {
|
||||
# Baseline CPU usage by process
|
||||
"selfdrive.controls.controlsd": 32.0,
|
||||
"selfdrive.car.card": 22.0,
|
||||
"loggerd": 14.0,
|
||||
"encoderd": 17.0,
|
||||
"camerad": 14.5,
|
||||
"locationd": 11.0,
|
||||
"./loggerd": 14.0,
|
||||
"./encoderd": 17.0,
|
||||
"./camerad": 14.5,
|
||||
"./locationd": 11.0,
|
||||
"selfdrive.controls.plannerd": 11.0,
|
||||
"ui": 18.0,
|
||||
"./ui": 18.0,
|
||||
"selfdrive.locationd.paramsd": 9.0,
|
||||
"sensord": 7.0,
|
||||
"./sensord": 7.0,
|
||||
"selfdrive.controls.radard": 7.0,
|
||||
"modeld": 13.0,
|
||||
"selfdrive.modeld.modeld": 13.0,
|
||||
"selfdrive.modeld.dmonitoringmodeld": 8.0,
|
||||
"system.hardware.hardwared": 3.87,
|
||||
"selfdrive.locationd.calibrationd": 2.0,
|
||||
"selfdrive.locationd.torqued": 5.0,
|
||||
"selfdrive.ui.soundd": 3.5,
|
||||
"selfdrive.monitoring.dmonitoringd": 4.0,
|
||||
"proclogd": 1.54,
|
||||
"./proclogd": 1.54,
|
||||
"system.logmessaged": 0.2,
|
||||
"system.tombstoned": 0,
|
||||
"logcatd": 0,
|
||||
"./logcatd": 0,
|
||||
"system.micd": 5.0,
|
||||
"system.timed": 0,
|
||||
"selfdrive.pandad.pandad": 0,
|
||||
@@ -67,12 +67,12 @@ PROCS = {
|
||||
|
||||
PROCS.update({
|
||||
"tici": {
|
||||
"pandad": 4.0,
|
||||
"ubloxd": 0.02,
|
||||
"./pandad": 4.0,
|
||||
"./ubloxd": 0.02,
|
||||
"system.ubloxd.pigeond": 6.0,
|
||||
},
|
||||
"tizi": {
|
||||
"pandad": 19.0,
|
||||
"./pandad": 19.0,
|
||||
"system.qcomgpsd.qcomgpsd": 1.0,
|
||||
}
|
||||
}.get(HARDWARE.get_device_type(), {}))
|
||||
@@ -247,7 +247,8 @@ class TestOnroad:
|
||||
for pl in self.service_msgs['procLog']:
|
||||
for x in pl.procLog.procs:
|
||||
if len(x.cmdline) > 0:
|
||||
plogs_by_proc[x.name].append(x)
|
||||
n = list(x.cmdline)[0]
|
||||
plogs_by_proc[n].append(x)
|
||||
print(plogs_by_proc.keys())
|
||||
|
||||
cpu_ok = True
|
||||
@@ -257,7 +258,7 @@ class TestOnroad:
|
||||
err = ""
|
||||
exp = "???"
|
||||
cpu_usage = 0.
|
||||
x = plogs_by_proc[proc_name[-15:]]
|
||||
x = plogs_by_proc[proc_name]
|
||||
if len(x) > 2:
|
||||
cpu_time = cputime_total(x[-1]) - cputime_total(x[0])
|
||||
cpu_usage = cpu_time / dt * 100.
|
||||
@@ -309,7 +310,7 @@ class TestOnroad:
|
||||
assert max(mems) - min(mems) <= 3.0
|
||||
|
||||
def test_gpu_usage(self):
|
||||
assert self.gpu_procs == {"weston", "ui", "camerad", "modeld"}
|
||||
assert self.gpu_procs == {"weston", "ui", "camerad", "selfdrive.modeld.modeld"}
|
||||
|
||||
def test_camera_processing_time(self):
|
||||
result = "\n"
|
||||
|
||||
Reference in New Issue
Block a user