Write profiling result after running

old-commit-hash: 079c9e714b5286d197cd0ba3f49340e6b0ae101a
This commit is contained in:
Willem Melching
2020-04-30 16:18:52 -07:00
parent 2087fb940b
commit 1a825681b3
4 changed files with 16 additions and 8 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e19acadcb1eb0b3cb611d5a0e1ba42a6e66dd8154b2253eaca6fdf8a5dc50dd6
size 2015
oid sha256:94e2c66a6fa302e7647173231d4216d592804d511959ebce167ee9fa1aecfeb0
size 2037
Generated
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eff5186468aa27655069d55973dcacdaddd5140b37a5758f58180de6359446f7
size 164191
oid sha256:b54f699108a7a9df59fd5b98f505426c8b81860dbe3a6b1a50d55729deb24079
size 164420
+1
View File
@@ -0,0 +1 @@
*.kgrind
+11 -4
View File
@@ -1,5 +1,9 @@
#!/usr/bin/env python3
import cProfile
import pyprof2calltree
from tools.lib.logreader import LogReader
from selfdrive.controls.controlsd import controlsd_thread
from selfdrive.test.profiling.lib import SubMaster, PubMaster, SubSocket, ReplayDone
@@ -18,7 +22,10 @@ if __name__ == "__main__":
sm = SubMaster(msgs, 'can', ['thermal', 'health', 'liveCalibration', 'dMonitoringState', 'plan', 'pathPlan', 'model'])
can_sock = SubSocket(msgs, 'can')
try:
controlsd_thread(sm, pm, can_sock)
except ReplayDone:
pass
with cProfile.Profile() as pr:
try:
controlsd_thread(sm, pm, can_sock)
except ReplayDone:
pass
pyprof2calltree.convert(pr.getstats(), 'controlsd.kgrind')