| OLD | NEW |
| 1 #!/usr/bin/perl | 1 #!/usr/bin/perl |
| 2 | 2 |
| 3 # | 3 # |
| 4 # Blame callstacks for each memory allocation. | 4 # Blame callstacks for each memory allocation. |
| 5 # Similar to memprof.pl, will also try to filter out unuseful stacks. | 5 # Similar to memprof.pl, will also try to filter out unuseful stacks. |
| 6 # TODO: better describe how these tools differ. | 6 # TODO: better describe how these tools differ. |
| 7 # | 7 # |
| 8 # Usage: | 8 # Usage: |
| 9 # | 9 # |
| 10 # memtrace.pl <logfile> | 10 # memtrace.pl <logfile> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 if ($filename =~ m/stringbuffer.h/) { | 95 if ($filename =~ m/stringbuffer.h/) { |
| 96 next; | 96 next; |
| 97 } | 97 } |
| 98 if ($filename =~ m/fastmalloc.h/) { | 98 if ($filename =~ m/fastmalloc.h/) { |
| 99 next; | 99 next; |
| 100 } | 100 } |
| 101 if ($filename =~ m/microsoft visual studio 8/) { | 101 if ($filename =~ m/microsoft visual studio 8/) { |
| 102 next; | 102 next; |
| 103 } | 103 } |
| 104 if ($filename =~ m/platformsdk_win2008_6_1/) { | 104 if ($filename =~ m/platformsdk_vista_6_0/) { |
| 105 next; | 105 next; |
| 106 } | 106 } |
| 107 if ($location_blame eq "") { | 107 if ($location_blame eq "") { |
| 108 # use this to blame the line | 108 # use this to blame the line |
| 109 $location_blame = $line; | 109 $location_blame = $line; |
| 110 | 110 |
| 111 # use this to blame the file. | 111 # use this to blame the file. |
| 112 # $location_blame = $filename; | 112 # $location_blame = $filename; |
| 113 | 113 |
| 114 #print("blaming $location_blame\n"); | 114 #print("blaming $location_blame\n"); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 | 135 |
| 136 # ----- Main ------------------------------------------------ | 136 # ----- Main ------------------------------------------------ |
| 137 | 137 |
| 138 # Get the command line argument | 138 # Get the command line argument |
| 139 my $filename = shift; | 139 my $filename = shift; |
| 140 | 140 |
| 141 # Process the file. | 141 # Process the file. |
| 142 process_raw($filename); | 142 process_raw($filename); |
| OLD | NEW |