johnno1962 / Xtrace

Trace Objective-C method calls by class or instance
MIT License
1.83k stars 132 forks source link

How to profile only the required functions? #14

Closed winster closed 8 years ago

winster commented 8 years ago

I know the dumpProfile function which lists the top 100 (depends on the count you give) functions that took most elapsed time.

Can I specify the exact functions to which the profiling has to run?

johnno1962 commented 8 years ago

Look at these methods:

// property methods filtered out by default

// include/exclude methods matching pattern

// trace class down to NSObject

// trace class down to "levels" of superclases

// trace all classes in app/bundle/framework

// "kitchen sink" trace all classes matching pattern

// trace instance but only for methods in aClass

winster commented 8 years ago

    [Xtrace includeMethods:@"^simple"];
    [Xtrace traceClass:[XRAppDelegate class]];

Above worked for me. Thanks :)