diff --git a/Pipfile b/Pipfile index 62adf6b4e6..a6c8b183b2 100644 --- a/Pipfile +++ b/Pipfile @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e19acadcb1eb0b3cb611d5a0e1ba42a6e66dd8154b2253eaca6fdf8a5dc50dd6 -size 2015 +oid sha256:94e2c66a6fa302e7647173231d4216d592804d511959ebce167ee9fa1aecfeb0 +size 2037 diff --git a/Pipfile.lock b/Pipfile.lock index f7811556c6..e9869c8320 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eff5186468aa27655069d55973dcacdaddd5140b37a5758f58180de6359446f7 -size 164191 +oid sha256:b54f699108a7a9df59fd5b98f505426c8b81860dbe3a6b1a50d55729deb24079 +size 164420 diff --git a/selfdrive/test/profiling/.gitignore b/selfdrive/test/profiling/.gitignore new file mode 100644 index 0000000000..e1b18fc52d --- /dev/null +++ b/selfdrive/test/profiling/.gitignore @@ -0,0 +1 @@ +*.kgrind diff --git a/selfdrive/test/profiling/controlsd.py b/selfdrive/test/profiling/controlsd.py index 11d7c1361b..9c54024747 100755 --- a/selfdrive/test/profiling/controlsd.py +++ b/selfdrive/test/profiling/controlsd.py @@ -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')