Changeset 5206

Show
Ignore:
Timestamp:
01/30/08 05:35:03 (5 months ago)
Author:
morris
Message:

Add a parser for Windows sampler.exe style reports

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Tuna/trunk/English.lproj/MainMenu.nib/classes.nib

    r3931 r5206  
    1 
    2     IBClasses = ( 
    3         { 
    4             ACTIONS = { 
    5                 focusPackage = id;  
    6                 focusSub = id;  
    7                 getInfo = id;  
    8                 removeCallstackWithSub = id;  
    9                 restore = id;  
    10                 restoreAll = id;  
    11             };  
    12             CLASS = FirstResponder;  
    13             LANGUAGE = ObjC;  
    14             SUPERCLASS = NSObject;  
    15         },  
    16         { 
    17             ACTIONS = {manual = id; newDocument = id; };  
    18             CLASS = TNMainController;  
    19             LANGUAGE = ObjC;  
    20             SUPERCLASS = WIObject;  
    21         },  
    22         { 
    23             ACTIONS = {orderFrontReleaseNotesWindow = id; };  
    24             CLASS = WIApplication;  
    25             LANGUAGE = ObjC;  
    26             OUTLETS = {"_releaseNotesTextView" = NSTextView; "_releaseNotesWindow" = NSWindow; };  
    27             SUPERCLASS = NSApplication;  
    28         },  
    29         {CLASS = WIObject; LANGUAGE = ObjC; SUPERCLASS = NSObject; } 
    30     );  
    31     IBVersion = 1;  
    32 
     1<?xml version="1.0" encoding="UTF-8"?> 
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
     3<plist version="1.0"> 
     4<dict> 
     5        <key>IBClasses</key> 
     6        <array> 
     7                <dict> 
     8                        <key>ACTIONS</key> 
     9                        <dict> 
     10                                <key>focusLibrary</key> 
     11                                <string>id</string> 
     12                                <key>focusSymbol</key> 
     13                                <string>id</string> 
     14                                <key>getInfo</key> 
     15                                <string>id</string> 
     16                                <key>removeCallstackWithSymbol</key> 
     17                                <string>id</string> 
     18                                <key>restore</key> 
     19                                <string>id</string> 
     20                                <key>restoreAll</key> 
     21                                <string>id</string> 
     22                        </dict> 
     23                        <key>CLASS</key> 
     24                        <string>FirstResponder</string> 
     25                        <key>LANGUAGE</key> 
     26                        <string>ObjC</string> 
     27                        <key>SUPERCLASS</key> 
     28                        <string>NSObject</string> 
     29                </dict> 
     30                <dict> 
     31                        <key>ACTIONS</key> 
     32                        <dict> 
     33                                <key>manual</key> 
     34                                <string>id</string> 
     35                                <key>newDocument</key> 
     36                                <string>id</string> 
     37                        </dict> 
     38                        <key>CLASS</key> 
     39                        <string>TNMainController</string> 
     40                        <key>LANGUAGE</key> 
     41                        <string>ObjC</string> 
     42                        <key>SUPERCLASS</key> 
     43                        <string>WIObject</string> 
     44                </dict> 
     45                <dict> 
     46                        <key>CLASS</key> 
     47                        <string>WIObject</string> 
     48                        <key>LANGUAGE</key> 
     49                        <string>ObjC</string> 
     50                        <key>SUPERCLASS</key> 
     51                        <string>NSObject</string> 
     52                </dict> 
     53                <dict> 
     54                        <key>ACTIONS</key> 
     55                        <dict> 
     56                                <key>orderFrontReleaseNotesWindow</key> 
     57                                <string>id</string> 
     58                        </dict> 
     59                        <key>CLASS</key> 
     60                        <string>WIApplication</string> 
     61                        <key>LANGUAGE</key> 
     62                        <string>ObjC</string> 
     63                        <key>OUTLETS</key> 
     64                        <dict> 
     65                                <key>_releaseNotesTextView</key> 
     66                                <string>NSTextView</string> 
     67                                <key>_releaseNotesWindow</key> 
     68                                <string>NSWindow</string> 
     69                        </dict> 
     70                        <key>SUPERCLASS</key> 
     71                        <string>NSApplication</string> 
     72                </dict> 
     73        </array> 
     74        <key>IBVersion</key> 
     75        <string>1</string> 
     76</dict> 
     77</plist> 
  • Tuna/trunk/English.lproj/MainMenu.nib/info.nib

    r3931 r5206  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
    33<plist version="1.0"> 
    44<dict> 
    5         <key>IBDocumentLocation</key> 
    6         <string>578 280 356 240 0 0 1280 1002 </string> 
    7         <key>IBEditorPositions</key> 
    8         <dict> 
    9                 <key>29</key> 
    10                 <string>721 756 359 44 0 0 1280 1002 </string> 
    11         </dict> 
    125        <key>IBFramework Version</key> 
    13         <string>443.0</string> 
     6        <string>629</string> 
     7        <key>IBLastKnownRelativeProjectPath</key> 
     8        <string>../../Tuna.xcodeproj</string> 
     9        <key>IBOldestOS</key> 
     10        <integer>5</integer> 
    1411        <key>IBOpenObjects</key> 
    1512        <array> 
    16                 <integer>29</integer> 
     13                <integer>215</integer> 
    1714        </array> 
    1815        <key>IBSystem Version</key> 
    19         <string>8H14</string> 
     16        <string>9B18</string> 
     17        <key>targetFramework</key> 
     18        <string>IBCocoaFramework</string> 
    2019</dict> 
    2120</plist> 
  • Tuna/trunk/English.lproj/ReleaseNotes.rtf

    r4995 r5206  
    1 {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420 
    2 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fnil\fcharset77 Monaco; 
    3 
     1{\rtf1\ansi\ansicpg1252\cocoartf949 
     2{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;} 
    43{\colortbl;\red255\green255\blue255;\red50\green100\blue255;\red227\green211\blue34;} 
    54\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 
    65 
    76\f0\b\fs36 \cf2 Tuna 1.0.2 Release Notes 
    8 \f1\b0\fs24 \ 
     7\b0\fs24 \ 
    98\ 
    109\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 
    1110 
    12 \f0\b\fs28 \cf2 Contact\cf0 \ 
     11\b\fs28 \cf2 Contact\cf0 \ 
    1312\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 
    1413 
    15 \f1\b0\fs24 \cf0 \ 
     14\b0\fs24 \cf0 \ 
    1615Axel Andersson\ 
    1716\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 
     
    1918\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 
    2019{\field{\*\fldinst{HYPERLINK "http://www.zankasoftware.com/"}}{\fldrslt \cf0 http://www.zankasoftware.com/}} 
    21 \f0\b\fs28 \ 
     20\b\fs28 \ 
    2221\ 
    2322\ 
    2423\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 
    2524\cf2 Version History 
    26 \f1\b0\fs24 \cf3 \ 
     25\b0\fs24 \cf3 \ 
    2726\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 
    2827 
    29 \f0\b \cf3 \ 
     28\b \cf3 \ 
    3029\cf2 1.0.2 
    31 \f1\b0 \cf0 \ 
    32 -
     30\b0 \cf0 \ 
     31- Stability fixes
    3332 
    34 \f0\b \cf2 \ 
     33\b \cf2 \ 
    35341.0.1 
    36 \f1\b0 \cf0 \ 
     35\b0 \cf0 \ 
    3736- Performance improvements for opening profiles\ 
    3837- Use proper "\'b5s" time unit\ 
     
    4039\ 
    4140 
    42 \f0\b \cf2 1.0 
    43 \f1\b0 \cf0 \ 
     41\b \cf2 1.0 
     42\b0 \cf0 \ 
    4443- Initial release\ 
    4544\ 
     
    4746\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 
    4847 
    49 \f0\b\fs28 \cf2 License 
    50 \f1\b0\fs24 \cf0 \ 
     48\b\fs28 \cf2 License 
     49\b0\fs24 \cf0 \ 
    5150\ 
    5251\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 
    5352 
    54 \f2\fs20 \cf0 Copyright \'a9 2005-2007 Axel Andersson\ 
     53\f1\fs20 \cf0 Copyright \'a9 2005-2008 Axel Andersson\ 
    5554All rights reserved.\ 
    5655\ 
  • Tuna/trunk/English.lproj/Session.nib/classes.nib

    r3409 r5206  
    1 
    2     IBClasses = ( 
    3         {CLASS = NSObject; LANGUAGE = ObjC; },  
    4         { 
    5             ACTIONS = {cancelSheet = id; submitSheet = id; };  
    6             CLASS = NSWindowController;  
    7             LANGUAGE = ObjC;  
    8             SUPERCLASS = NSResponder;  
    9         },  
    10         { 
    11             ACTIONS = { 
    12                 colorByPackage = id;  
    13                 hideWeight = id;  
    14                 hideWeightPercent = id;  
    15                 statsDisplayMode = id;  
    16             };  
    17             CLASS = TNSessionController;  
    18             LANGUAGE = ObjC;  
    19             OUTLETS = { 
    20                 "_dataMiningTextField" = NSTextField;  
    21                 "_frequencyTextField" = NSTextField;  
    22                 "_infoPanel" = NSPanel;  
    23                 "_packageTableColumn" = NSTableColumn;  
    24                 "_selfTableColumn" = NSTableColumn;  
    25                 "_subTableColumn" = NSTableColumn;  
    26                 "_systemTimeTextField" = NSTextField;  
    27                 "_totalTableColumn" = NSTableColumn;  
    28                 "_treeOutlineView" = WIOutlineView;  
    29                 "_userTimeTextField" = NSTextField;  
    30                 "_versionTextField" = NSTextField;  
    31                 "_wallclockTimeTextField" = NSTextField;  
    32                 "_weightTextField" = NSTextField;  
    33             };  
    34             SUPERCLASS = WIWindowController;  
    35         },  
    36         { 
    37             ACTIONS = {showViewOptions = id; };  
    38             CLASS = WIOutlineView;  
    39             LANGUAGE = ObjC;  
    40             SUPERCLASS = NSOutlineView;  
    41         },  
    42         { 
    43             CLASS = WIWindowController;  
    44             LANGUAGE = ObjC;  
    45             SUPERCLASS = NSWindowController;  
    46         } 
    47     );  
    48     IBVersion = 1;  
    49 
     1<?xml version="1.0" encoding="UTF-8"?> 
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
     3<plist version="1.0"> 
     4<dict> 
     5        <key>IBClasses</key> 
     6        <array> 
     7                <dict> 
     8                        <key>ACTIONS</key> 
     9                        <dict> 
     10                                <key>cancelSheet</key> 
     11                                <string>id</string> 
     12                                <key>submitSheet</key> 
     13                                <string>id</string> 
     14                        </dict> 
     15                        <key>CLASS</key> 
     16                        <string>NSWindowController</string> 
     17                        <key>LANGUAGE</key> 
     18                        <string>ObjC</string> 
     19                        <key>SUPERCLASS</key> 
     20                        <string>NSResponder</string> 
     21                </dict> 
     22                <dict> 
     23                        <key>CLASS</key> 
     24                        <string>NSObject</string> 
     25                        <key>LANGUAGE</key> 
     26                        <string>ObjC</string> 
     27                </dict> 
     28                <dict> 
     29                        <key>ACTIONS</key> 
     30                        <dict> 
     31                                <key>colorByLibrary</key> 
     32                                <string>id</string> 
     33                                <key>colorByPackage</key> 
     34                                <string>id</string> 
     35                                <key>hideWeight</key> 
     36                                <string>id</string> 
     37                                <key>hideWeightPercent</key> 
     38                                <string>id</string> 
     39                                <key>statsDisplayMode</key> 
     40                                <string>id</string> 
     41                        </dict> 
     42                        <key>CLASS</key> 
     43                        <string>TNSessionController</string> 
     44                        <key>LANGUAGE</key> 
     45                        <string>ObjC</string> 
     46                        <key>OUTLETS</key> 
     47                        <dict> 
     48                                <key>_dataMiningTextField</key> 
     49                                <string>NSTextField</string> 
     50                                <key>_libraryTableColumn</key> 
     51                                <string>NSTableColumn</string> 
     52                                <key>_packageTableColumn</key> 
     53                                <string>NSTableColumn</string> 
     54                                <key>_perlFrequencyTextField</key> 
     55                                <string>NSTextField</string> 
     56                                <key>_perlInfoPanel</key> 
     57                                <string>NSPanel</string> 
     58                                <key>_perlSystemTimeTextField</key> 
     59                                <string>NSTextField</string> 
     60                                <key>_perlUserTimeTextField</key> 
     61                                <string>NSTextField</string> 
     62                                <key>_perlVersionTextField</key> 
     63                                <string>NSTextField</string> 
     64                                <key>_perlWallclockTimeTextField</key> 
     65                                <string>NSTextField</string> 
     66                                <key>_selfTableColumn</key> 
     67                                <string>NSTableColumn</string> 
     68                                <key>_subTableColumn</key> 
     69                                <string>NSTableColumn</string> 
     70                                <key>_symbolTableColumn</key> 
     71                                <string>NSTableColumn</string> 
     72                                <key>_totalTableColumn</key> 
     73                                <string>NSTableColumn</string> 
     74                                <key>_treeOutlineView</key> 
     75                                <string>WIOutlineView</string> 
     76                                <key>_weightTextField</key> 
     77                                <string>NSTextField</string> 
     78                        </dict> 
     79                        <key>SUPERCLASS</key> 
     80                        <string>WIWindowController</string> 
     81                </dict> 
     82                <dict> 
     83                        <key>CLASS</key> 
     84                        <string>WIWindowController</string> 
     85                        <key>LANGUAGE</key> 
     86                        <string>ObjC</string> 
     87                        <key>SUPERCLASS</key> 
     88                        <string>NSWindowController</string> 
     89                </dict> 
     90                <dict> 
     91                        <key>ACTIONS</key> 
     92                        <dict> 
     93                                <key>showViewOptions</key> 
     94                                <string>id</string> 
     95                        </dict> 
     96                        <key>CLASS</key> 
     97                        <string>WIOutlineView</string> 
     98                        <key>LANGUAGE</key> 
     99                        <string>ObjC</string> 
     100                        <key>SUPERCLASS</key> 
     101                        <string>NSOutlineView</string> 
     102                </dict> 
     103        </array> 
     104        <key>IBVersion</key> 
     105        <string>1</string> 
     106</dict> 
     107</plist> 
  • Tuna/trunk/English.lproj/Session.nib/info.nib

    r3409 r5206  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
    33<plist version="1.0"> 
    44<dict> 
    5         <key>IBDocumentLocation</key> 
    6         <string>541 89 356 240 0 0 1280 1002 </string> 
    75        <key>IBFramework Version</key> 
    8         <string>443.0</string> 
     6        <string>629</string> 
     7        <key>IBLastKnownRelativeProjectPath</key> 
     8        <string>../../Tuna.xcodeproj</string> 
     9        <key>IBOldestOS</key> 
     10        <integer>5</integer> 
    911        <key>IBOpenObjects</key> 
    10         <array> 
    11                 <integer>5</integer> 
    12                 <integer>64</integer> 
    13         </array> 
     12        <array/> 
    1413        <key>IBSystem Version</key> 
    15         <string>8F46</string> 
     14        <string>9B18</string> 
     15        <key>targetFramework</key> 
     16        <string>IBCocoaFramework</string> 
    1617</dict> 
    1718</plist> 
  • Tuna/trunk/Info.plist

    r3931 r5206  
    1111                        <array> 
    1212                                <string>out</string> 
     13                                <string>txt</string> 
    1314                        </array> 
    1415                        <key>CFBundleTypeIconFile</key> 
  • Tuna/trunk/TNDocument.h

    r4995 r5206  
    3131@interface TNDocument : NSDocument { 
    3232        NSString                                *_string; 
    33         TNTree                                  *_tree; 
    34          
    35         unsigned int                    _session; 
     33        id                                              _tree; 
     34        NSUInteger                              _session; 
    3635} 
    3736 
  • Tuna/trunk/TNDocument.m

    r4995 r5206  
    3030#import "TNParser.h" 
    3131#import "TNSessionController.h" 
    32 #import "TNTree.h" 
    3332 
    3433@implementation TNDocument 
    3534 
    36 + (unsigned int)session { 
    37         static unsigned int           session; 
     35+ (NSUInteger)session { 
     36        static NSUInteger             session; 
    3837         
    3938        return ++session; 
     
    8685                return NO; 
    8786         
    88         if(![_string hasPrefix:@"#fOrTyTwO"]) 
    89                 return NO
    90          
    91         _tree = [TNParser parseWithString:_string]; 
     87        if([_string hasPrefix:@"#fOrTyTwO"]) 
     88                _tree = [[TNPerlParser parseString:_string] retain]
     89        else if([_string hasPrefix:@"Start time: "] || [_string hasPrefix:@"200"]) 
     90               _tree = [[TNObjCParser parseString:_string] retain]; 
    9291         
    9392        if(_tree) 
  • Tuna/trunk/TNFunction.h

    r4995 r5206  
    2727 */ 
    2828 
    29 @interface TNSub : WIObject <NSCopying> { 
     29@interface TNFunction : WIObject <NSCopying> { 
    3030@public 
    31         NSString                                        *_package
    32         NSString                                        *_name
     31        NSString                                        *_library
     32        NSString                                        *_symbol
    3333        NSColor                                         *_color; 
    3434} 
    3535 
     36- (id)initWithLibrary:(NSString *)library symbol:(NSString *)symbol color:(NSColor *)color; 
    3637 
    37 - (id)initWithPackage:(NSString *)package name:(NSString *)name color:(NSColor *)color
     38- (BOOL)isEqualToFunction:(TNFunction *)function
    3839 
    39 - (BOOL)isEqualToSub:(TNSub *)sub; 
    40  
    41 - (NSString *)package; 
    42 - (NSString *)name; 
     40- (NSString *)library; 
     41- (NSString *)symbol; 
    4342- (NSColor *)color; 
    4443 
    4544@end 
     45 
     46 
     47@interface TNObjCFunction : TNFunction 
     48 
     49@end 
  • Tuna/trunk/TNFunction.m

    r4995 r5206  
    2727 */ 
    2828 
    29 #import "TNSub.h" 
     29#import "TNFunction.h" 
    3030 
    31 @implementation TNSub 
     31@implementation TNFunction 
    3232 
    33 - (id)initWithPackage:(NSString *)package name:(NSString *)name color:(NSColor *)color { 
     33- (id)initWithLibrary:(NSString *)library symbol:(NSString *)symbol color:(NSColor *)color { 
    3434        self = [super init]; 
    3535         
    36         _package       = [package retain]; 
    37         _name          = [name retain]; 
     36        _library       = [library retain]; 
     37        _symbol                = [symbol retain]; 
    3838        _color          = [color retain]; 
    3939         
     
    4444 
    4545- (void)dealloc { 
    46         [_package release]; 
    47         [_name release]; 
     46        [_library release]; 
     47        [_symbol release]; 
    4848        [_color release]; 
    4949         
     
    6363#pragma mark - 
    6464 
    65 - (BOOL)isEqualToSub:(TNSub *)sub { 
    66         return (self == sub); 
     65- (BOOL)isEqualToFunction:(TNFunction *)function { 
     66        return ([_library isEqualToString:function->_library] && 
     67                        [_symbol isEqualToString:function->_symbol]); 
    6768} 
    6869 
     
    7071 
    7172- (NSString *)description { 
    72         return [NSSWF:@"%@::%@", _package, _name]; 
     73        return [NSSWF:@"%@ %@", _library, _symbol]; 
    7374} 
    7475 
     
    7778#pragma mark - 
    7879 
    79 - (NSString *)package
    80         return _package
     80- (NSString *)library
     81        return _library
    8182} 
    8283 
    8384 
    8485 
    85 - (NSString *)name
    86         return _name
     86- (NSString *)symbol
     87        return _symbol
    8788} 
    8889 
     
    9495 
    9596@end 
     97 
     98 
     99 
     100@implementation TNObjCFunction 
     101 
     102- (id)initWithLibrary:(NSString *)library symbol:(NSString *)symbol color:(NSColor *)color { 
     103        NSString                *image, *class, *category, *selector, *method; 
     104        NSRange                 range, searchRange; 
     105        NSUInteger              searchLength; 
     106        BOOL                    isInstance, isClass; 
     107         
     108        // --- scan library image 
     109        image = [library lastPathComponent]; 
     110        range = [image rangeOfString:@" (base="]; 
     111         
     112        if(range.location != NSNotFound) 
     113                image = [image substringToIndex:range.location]; 
     114         
     115        range = [image rangeOfString:@"\\" options:NSBackwardsSearch]; 
     116         
     117        if(range.location != NSNotFound) 
     118                image = [image substringFromIndex:range.location + 1]; 
     119         
     120        range = [image rangeOfString:@":" options:NSBackwardsSearch]; 
     121         
     122        if(range.location != NSNotFound) 
     123                image = [image substringToIndex:range.location]; 
     124         
     125        // --- scan Objective-C signature of function 
     126        method = symbol; 
     127        isInstance = [symbol hasPrefix:@"_i_"]; 
     128        isClass = [symbol hasPrefix:@"_c_"]; 
     129         
     130        if(isInstance || isClass) { 
     131                searchRange.location = 3; 
     132                searchRange.length = [symbol length] - searchRange.location; 
     133                 
     134                class = category = selector = NULL; 
     135                 
     136                range = [symbol rangeOfString:@"_" options:0 range:searchRange]; 
     137                 
     138                if(range.location != NSNotFound) { 
     139                        searchLength = range.location - searchRange.location; 
     140 
     141                        class = [symbol substringWithRange:NSMakeRange(searchRange.location, searchLength)]; 
     142                 
     143                        searchRange.location += searchLength + range.length; 
     144                        searchRange.length -= searchLength + range.length; 
     145                } 
     146                 
     147                range = [symbol rangeOfString:@"_" options:0 range:searchRange]; 
     148                 
     149                if(range.location != NSNotFound) { 
     150                        searchLength = range.location - searchRange.location; 
     151 
     152                        if(searchLength) 
     153                                category = [symbol substringWithRange:NSMakeRange(searchRange.location, searchLength)]; 
     154                 
     155                        searchRange.location += searchLength + range.length; 
     156                        searchRange.length -= searchLength + range.length; 
     157                } 
     158                 
     159                selector = [[symbol substringFromIndex:searchRange.location] 
     160                        stringByReplacingOccurencesOfString:@"_" withString:@":"]; 
     161                 
     162                if(class && selector) { 
     163                        category = category ? [NSSWF:@"(%@)", category] : @""; 
     164                        method = [NSSWF:@"%@[%@%@ %@]", isInstance ? @"-" : @"+", class, category, selector]; 
     165                } 
     166        } 
     167         
     168        return [super initWithLibrary:image     symbol:method color:color]; 
     169} 
     170 
     171@end 
  • Tuna/trunk/TNNode.h

    r4995 r5206  
    2727 */ 
    2828 
    29 @class TNSub
     29@class TNFunction
    3030 
    3131@interface TNNode : WIObject <NSCopying> { 
    3232@public 
    3333        NSMutableArray          *_children; 
    34         TNNode                         *_parent; 
     34        id                                     _parent; 
    3535         
    36         TNSub                          *_sub
     36        TNFunction                     *_function
    3737         
    3838        BOOL                            _leaf; 
    3939         
    40         unsigned int            _calls; 
    41         double                          _time, _cumulativeTime; 
     40        NSUInteger                      _calls; 
    4241        double                          _percent, _cumulativePercent; 
    4342} 
    4443 
    45  
    46 - (id)initWithParent:(TNNode *)node sub:(TNSub *)sub; 
     44- (id)initWithParent:(TNNode *)node function:(TNFunction *)function; 
    4745 
    4846- (BOOL)isEqualToNode:(TNNode *)node; 
    4947 
     48- (NSComparisonResult)compareValue:(TNNode *)node; 
     49- (NSComparisonResult)compareCumulativeValue:(TNNode *)node; 
     50- (NSComparisonResult)comparePercent:(TNNode *)node; 
     51- (NSComparisonResult)compareCumulativePercent:(TNNode *)node; 
     52- (NSComparisonResult)compareLibrary:(TNNode *)node; 
     53- (NSComparisonResult)compareSymbol:(TNNode *)node; 
     54 
    5055- (void)addChild:(TNNode *)node; 
    51 - (unsigned int)children; 
    52 - (TNNode *)childAtIndex:(unsigned int)index; 
     56- (NSUInteger)children; 
     57- (TNNode *)childAtIndex:(NSUInteger)index; 
    5358- (TNNode *)lastChild; 
    54 - (TNNode *)childWithSub:(TNSub *)sub; 
     59- (id)childWithFunction:(TNFunction *)function; 
     60- (id)childWithFunctionIdenticalTo:(TNFunction *)function; 
    5561- (TNNode *)parent; 
    5662- (BOOL)isLeaf; 
     
    6066- (void)sortUsingSelector:(SEL)selector; 
    6167 
    62 - (NSArray *)nodesMatchingPackage:(NSString *)package
     68- (NSArray *)nodesMatchingLibrary:(NSString *)library
    6369- (void)discardNodesWithCumulativePercentLessThan:(double)percent; 
    6470 
    65 - (void)addTime:(double)time; 
    6671- (void)refreshPercent; 
    6772 
    68 - (TNSub *)sub
     73- (TNFunction *)function
    6974- (NSColor *)color; 
    70 - (unsigned int)calls; 
    71 - (double)time; 
    72 - (double)cumulativeTime; 
     75- (NSUInteger)calls; 
    7376- (double)percent; 
    7477- (double)cumulativePercent; 
    7578 
    7679@end 
     80 
     81 
     82@interface TNPerlNode : TNNode { 
     83@public 
     84        NSTimeInterval          _time, _cumulativeTime; 
     85} 
     86 
     87- (void)addTime:(double)time; 
     88 
     89- (NSTimeInterval)time; 
     90- (NSTimeInterval)cumulativeTime; 
     91 
     92@end 
     93 
     94 
     95@interface TNObjCNode : TNNode { 
     96@public 
     97        NSUInteger                      _totalCalls; 
     98} 
     99 
     100@end 
  • Tuna/trunk/TNNode.m

    r4995 r5206  
    2727 */ 
    2828 
     29#import "TNFunction.h" 
    2930#import "TNNode.h" 
    30 #import "TNSub.h" 
    3131 
    3232@interface TNNode(Private) 
     
    3434- (void)joinWithNode:(TNNode *)node; 
    3535 
    36 - (void)addNodesMatchingPackage:(NSString *)package toArray:(NSMutableArray *)array; 
    37  
    38 - (void)refreshPercentForTotalTime:(double)time; 
     36- (void)addNodesMatchingLibrary:(NSString *)library toArray:(NSMutableArray *)array; 
    3937 
    4038@end 
     
    4341@implementation TNNode 
    4442 
    45 - (id)initWithParent:(TNNode *)parent sub:(TNSub *)sub
     43- (id)initWithParent:(TNNode *)parent function:(TNFunction *)function
    4644        self = [super init]; 
    4745         
    4846        _parent         = parent; 
    49         _sub           = [sub retain]; 
     47        _function      = [function retain]; 
    5048        _leaf           = YES; 
    5149        _calls          = 1; 
     
    5755 
    5856- (void)dealloc { 
    59         [_sub release]; 
     57        [_function release]; 
    6058        [_children release]; 
    6159         
     
    6967- (id)copyWithZone:(NSZone *)zone { 
    7068        TNNode                  *node; 
    71         unsigned int  i, count; 
    72          
    73         node = [[TNNode allocWithZone:zone] init]; 
     69        NSUInteger            i, count; 
     70         
     71        node = [[[self class] allocWithZone:zone] init]; 
    7472        node->_children = [_children deepMutableCopyWithZone:zone]; 
    7573        node->_parent = _parent; 
     
    8078                ((TNNode *) [node->_children objectAtIndex:i])->_parent = node; 
    8179         
    82         node->_sub = [_sub copyWithZone:zone]; 
     80        node->_function = [_function copyWithZone:zone]; 
    8381         
    8482        node->_leaf = _leaf; 
    8583         
    8684        node->_calls = _calls; 
    87         node->_time = _time; 
    88         node->_cumulativeTime = _cumulativeTime; 
    8985        node->_percent = _percent; 
    9086        node->_cumulativePercent = _cumulativePercent; 
     
    9894 
    9995- (BOOL)isEqualToNode:(TNNode *)node { 
    100         return [_sub isEqualToSub:node->_sub]
     96        return (_function == node->_function)
    10197} 
    10298 
     
    104100 
    105101- (NSString *)description { 
    106         return [NSSWF:@"%.1f%% %.1f%% %@", _percent, _cumulativePercent, _sub]; 
    107 
    108  
    109  
    110  
    111 - (NSComparisonResult)compareTime:(TNNode *)node { 
    112         if(_time < node->_time) 
    113                 return NSOrderedAscending; 
    114         else if(_time > node->_time) 
    115                 return NSOrderedDescending; 
    116          
    117         return NSOrderedSame; 
    118 
    119  
    120  
    121  
    122 - (NSComparisonResult)compareCumulativeTime:(TNNode *)node { 
    123         if(_cumulativeTime < node->_cumulativeTime) 
    124                 return NSOrderedAscending; 
    125         else if(_cumulativeTime > node->_cumulativeTime) 
    126                 return NSOrderedDescending; 
    127          
     102        return [NSSWF:@"%.1f%% %.1f%% %@", _percent, _cumulativePercent, _function]; 
     103
     104 
     105 
     106 
     107- (NSComparisonResult)compareValue:(TNNode *)node { 
     108        return NSOrderedSame; 
     109
     110 
     111 
     112 
     113- (NSComparisonResult)compareCumulativeValue:(TNNode *)node { 
    128114        return NSOrderedSame; 
    129115} 
     
    153139 
    154140 
    155 - (NSComparisonResult)comparePackage:(TNNode *)node { 
    156         return [_sub->_package compare:node->_sub->_package options:NSCaseInsensitiveSearch]; 
    157 } 
    158  
    159  
    160  
    161 - (NSComparisonResult)compareSub:(TNNode *)node { 
    162         return [_sub->_name compare:node->_sub->_name options:NSCaseInsensitiveSearch]; 
     141- (NSComparisonResult)compareLibrary:(TNNode *)node {