Uftrace timing profiler - UPBGE/upbge GitHub Wiki
UPBGE can be profiled using uftrace (https://github.com/namhyung/uftrace). But you need to compile with special gcc flags:
-finstrument-functions -finstrument-functions-exclude-file-list=xmmintrin,emmintrin
These flags allow instrumentation of the code and also disable instrumentation for SSE inline functions.
After this you can record your test case:
uftrace record blender file
and report/replay/graph the output.