If the question is how to profile the specific driver then I would be inclined to add specific logging/instrumentation to the driver methods to see what's taking most time.
If you mean profiling the whole of openocd then I'm not really sure how best to do that unfortunately. However it sounds like any previou latencies might be at/below your driver level so that the best place to start and focus on? ________________________________ From: Ooi, Cinly <cinly....@intel.com> Sent: Tuesday, May 18, 2021 3:51:56 PM To: OpenOCD <OpenOCD-devel@lists.sourceforge.net> Subject: Profiling Tool for OpenOCD Hi Does anyone has experience profiling OpenOCD and can share the experience, i.e. tools etc? The reason for asking is the driver that I am developing, aji_client (https://github.com/intel/aji_openocd) is slow under some circumstances. Good news is those circumstances are consistently reproducible. I want to use profiling tool to identify the bottleneck and where I have to make improvement to my driver. The conventional wisdom is to run a profiling tool over the workload to get a picture of which functions take the longest time, the bottleneck etc instead of stabbing in the dark for solution. I tried gprof (1) and sprof (2) and are having issues with them. See notes. Many thanks in advance and best regards Cinly Note: 1. gprof might be the wrong tool to use as my driver calls shared library libaji_client.so (https://github.com/intel/libaji_client), which for this task I need to profile as well. Chatter on the internet says gprof cannot handle shared library 2. sprof is giving me problems. I did not manage to get it to work for anything more complex than a simple toy program.