Custom setproctitle (#32667)

* add custom setproctitle

* add test

* Update poetry.lock

* fix lint

* support only Linux

* test only Linux

* final lint

* Update test_setproctitle.py

* Update setproctitle.py

* convert to threadnames

* delete proctitles

* Check str len and use PR_GET_NAME

* fix poetry.lock

* lint fix

* Update common/threadname.py

---------

Co-authored-by: reddyn12 <nikhilr.ssm@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 3365ed5effa48d34ffe0e2e9bbe9f6941336bed5
This commit is contained in:
schlimeszn
2024-06-10 21:59:01 -04:00
committed by GitHub
parent 50dd024081
commit afea57ae2a
8 changed files with 42 additions and 16 deletions

View File

@@ -3,7 +3,7 @@ import os
import time
import numpy as np
from multiprocessing import Process
from setproctitle import setproctitle
from openpilot.common.threadname import setthreadname
def waste(core):
os.sched_setaffinity(0, [core,])
@@ -16,7 +16,7 @@ def waste(core):
j = 0
while 1:
if (i % 100) == 0:
setproctitle("%3d: %8d" % (core, i))
setthreadname("%3d: %8d" % (core, i))
lt = time.monotonic()
print("%3d: %8d %f %.2f" % (core, i, lt-st, j))
st = lt