From 2f754f6df4f0d66b782351f4042a24d370b6a067 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 5 Oct 2020 20:48:23 -0700 Subject: [PATCH] don't want to profile that old-commit-hash: 67091060253a94d921460ad2bb4d8c5f2685dc07 --- selfdrive/test/profiling/profiler.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/selfdrive/test/profiling/profiler.py b/selfdrive/test/profiling/profiler.py index 54f722af2b..92884a65f8 100755 --- a/selfdrive/test/profiling/profiler.py +++ b/selfdrive/test/profiling/profiler.py @@ -42,8 +42,7 @@ def profile(proc, func, car='toyota'): os.environ['FINGERPRINT'] = fingerprint - def run(): - sm, pm, can_sock = get_inputs(msgs, proc) + def run(sm, pm, can_sock): try: if can_sock is not None: func(sm, pm, can_sock) @@ -53,13 +52,15 @@ def profile(proc, func, car='toyota'): pass # Statistical + sm, pm, can_sock = get_inputs(msgs, proc) with pprofile.StatisticalProfile()(period=0.00001) as pr: - run() + run(sm, pm, can_sock) pr.dump_stats(f'cachegrind.out.{proc}_statistical') # Deterministic + sm, pm, can_sock = get_inputs(msgs, proc) with cProfile.Profile() as pr: - run() + run(sm, pm, can_sock) pyprof2calltree.convert(pr.getstats(), f'cachegrind.out.{proc}_deterministic')