How to profile only the required functions?
Closed this issue · 2 comments
winster commented
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
Look at these methods:
// property methods filtered out by default
- (void)includeProperties:(BOOL)include;
// include/exclude methods matching pattern
- (BOOL)includeMethods:(NSString *)pattern;
- (BOOL)excludeMethods:(NSString *)pattern;
- (BOOL)excludeTypes:(NSString *)pattern;
// trace class down to NSObject
- (void)traceClass:(Class)aClass;
// trace class down to "levels" of superclases
- (void)traceClass:(Class)aClass levels:(int)levels;
// trace all classes in app/bundle/framework
- (void)traceBundleContainingClass:(Class)aClass;
// "kitchen sink" trace all classes matching pattern
- (void)traceClassPattern:(NSString *)pattern excluding:(NSString *)exclusions;
// trace instance but only for methods in aClass
- (void)traceInstance:(id)instance class:(Class)aClass;
winster commented
[Xtrace includeMethods:@"^simple"];
[Xtrace traceClass:[XRAppDelegate class]];
Above worked for me. Thanks :)