1

Basically, I want to have a vertical line (or a flag) appear in my trace whenever method foo is called. Is this possible?

(Note that DTPerformanceSession does not appear to support iOS devices.)

William Jockusch
  • 26,513
  • 49
  • 182
  • 323

1 Answers1

0

I know this is old question, but the DTPerformanceSession framework includes a header, DTSignalFlag.h, that provides the interface for the DTSendSignalFlag function. It supports only the simulator and it doesn't appear to work when targeting iOS 7, but extremely useful in earlier version of iOS (even with Xcode 5).

You need to include the header:

#import <DTPerformanceSession/DTSignalFlag.h>

To get access to the header, though, you have to add DTPerformanceSession framework to your project, but you can then remove it to avoid linker errors (but you'll still have access to the headers), and then you can do the following:

// Point flag (just an event in time)
DTSendSignalFlag("com.mycompany.mytracepoints.app.point", DT_POINT_SIGNAL, TRUE);

// Start flag (to mark the start of something)
DTSendSignalFlag("com.mycompany.mytracepoints.app.start", DT_START_SIGNAL, TRUE);

// End flag (to mark the end of something)
DTSendSignalFlag("com.mycompany.mytracepoints.app.end", DT_END_SIGNAL, TRUE);
Rob
  • 415,655
  • 72
  • 787
  • 1,044
  • In later OS versions, we can now use "points of interest". See http://stackoverflow.com/a/39416673/1271826. – Rob Sep 09 '16 at 18:39