learnvst
learnvst

Reputation: 16195

Profiling C++ code running on iOS device using instruments

I am trying to profile some signal processing code running on device using instruments. The code is written in C++. Below is the output ater profiling for a few seconds . . .

enter image description here

It is clear that the calls to powf are taking up the majority of the CPU time, however, I cannot find how to determine which calls to powf are the biggest offenders in my code. I swear that when I used to use shark, it was really easy to get line numbers for the calls in the source. All I can get from instruments is machine code nonsense.

Expanding the powf triangle gives the following . . . .

enter image description here

Upvotes: 1

Views: 1058

Answers (1)

Paul R
Paul R

Reputation: 212979

It would appear that the code containing calls to powf is part of a callback function which you are passing to CoreAudio. Instruments seems to be unable to symbolicate the call chain for the callback, so you are just seeing raw addresses in the code. It might be possible to identify these addresses using a suitable tool (e.g. otool, or similar), but a better strategy in the long run would be to implement a test harness which calls your callback code in a loop with dummy data - this will most likely repay itself when you use it for future debugging and profiling activities. Note that for convenience you could just build the test harness as a Mac OS X executable for profiling/debugging, as bugs and performance bottlenecks will most likely be similar on both platforms, at least to a first approximation.

Upvotes: 1

Related Questions