3

Time Profiler seems to only show function calls sorted by their CPU time ranking. However, sometimes I'd like to see call sequence (multithreaded) during a particular run.

Do I need a custom instrument to achieve that instead?

I played around with the checkboxes that Time Profiler provided in its UI, but nothing helped. I had to resort to the good old logging, which is obviously inefficient.

kakyo
  • 10,460
  • 14
  • 76
  • 140

2 Answers2

3

It's a sampling profiler, so it only shows you the calls that were executing when it sampled; you can't see every call that happened over a period of time. That said, you can see the call-stack that leads up to every call, if you show the 'Extended Detail Pane' over on the right, which may give you a good idea what happened. See the Apple documentation.

As an alternative solution, see How to log all methods used in iOS app

Community
  • 1
  • 1
Bryan
  • 11,398
  • 3
  • 53
  • 78
  • Thank you for the link to the logging question. I can see the accepted "objc_msgSend" trick was all about ObjC methods. Is it possible to do similar to pure C/C++ code? – kakyo Mar 02 '14 at 21:11
  • + Yay! Finally a stack-sampling profiler that lets you actually see stack samples! It doesn't appear to show line numbers, but that should be simple. What is harder to get across is that samples should happen during I/O or other blockage, and that high frequency is not necessary, because a) if the problem is I/O then the samples will show it, and b) any problem worth solving happens a healthy percent of the time, like 10%, and it will appear on that percent of samples. If it is 10%, 20-30 samples will easily display it. – Mike Dunlavey Mar 03 '14 at 01:33
  • @MikeDunlavey, thanks for your message. I'm not tackling a performance issue, just a laundry list like: at Time X, function A (with callstack) was called; at Time X+1, ..... – kakyo Mar 03 '14 at 02:35
2

There is a tool that analyses instruments trace files and does what you're describing at: http://timeanalyzer.excelsis.com

Currently, it only works on the main thread, and only for the first 30 seconds of profiling. It shows a function call stack waterfall: X axis is time, Y axis is the call stack.

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
Factory21
  • 21
  • 1