Changeset c4f89cf
- Timestamp:
- 05/28/15 17:09:31 (9 years ago)
- Branches:
- master
- Children:
- 6520ef5
- Parents:
- 4bd7a88
- git-author:
- Hal Finkel <hfinkel@…> (05/28/15 17:09:31)
- git-committer:
- Hal Finkel <hfinkel@…> (05/28/15 17:09:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
memlog2dot
r4bd7a88 rc4f89cf 5 5 my $total_size = 0; 6 6 my %roots; 7 my @all_nodes;7 my %all_nodes; 8 8 foreach my $line ( <STDIN> ) { 9 9 chomp($line); … … 46 46 # print STDERR "parsed: $file_name, $proc_name, $off, $pc, $relpc\n"; 47 47 48 if (!exists $all_nodes{$pc}) { 49 $all_nodes{$pc}->{'file_name'} = $file_name; 50 $all_nodes{$pc}->{'proc_name'} = $proc_name; 51 $all_nodes{$pc}->{'off'} = $off; 52 $all_nodes{$pc}->{'pc'} = $pc; 53 $all_nodes{$pc}->{'relpc'} = $relpc; 54 } 55 48 56 if (!exists $parent->{$pc}) { 49 $parent->{$pc}->{'file_name'} = $file_name; 50 $parent->{$pc}->{'proc_name'} = $proc_name; 51 $parent->{$pc}->{'off'} = $off; 52 $parent->{$pc}->{'pc'} = $pc; 53 $parent->{$pc}->{'relpc'} = $relpc; 54 55 push(@all_nodes, $parent->{$pc}); 57 $parent->{$pc} = $all_nodes{$pc}; 56 58 } 57 59 … … 141 143 my %skipped; 142 144 143 foreach my $node (@all_nodes) { 145 foreach my $pc (keys %all_nodes) { 146 my $node = $all_nodes{$pc}; 144 147 my $name = get_name($node); 145 148 146 149 my $local_size = $node->{'size'}; 147 150 if ($local_size * 1.0 / $total_size < $skip_frac) { 148 $skipped{$ node->{'pc'}} = 1;151 $skipped{$pc} = 1; 149 152 next; 150 153 } … … 156 159 157 160 printf("N%s [label=\"%s\\n%s\", shape=box,fontsize=%.1f%s];\n", 158 $ node->{'pc'}, $name, format_bytes($local_size), $fs);161 $pc, $name, format_bytes($local_size), $fs); 159 162 } 160 163 161 foreach my $node (@all_nodes) { 164 foreach my $pc (keys %all_nodes) { 165 my $node = $all_nodes{$pc}; 166 162 167 my $local_size = $node->{'size'}; 163 if ($skipped{$ node->{'pc'}}) {168 if ($skipped{$pc}) { 164 169 next; 165 170 } … … 177 182 178 183 printf("N%s -> N%s [label=\"%s\", weight=%d, style=\"%s\"];\n", 179 $ node->{'pc'}, $cpc, format_bytes($child_size), $weight, $style);184 $pc, $cpc, format_bytes($child_size), $weight, $style); 180 185 } 181 186 }
Note: See TracChangeset
for help on using the changeset viewer.