Changeset 4bd7a88
- Timestamp:
- 05/28/15 16:48:52 (9 years ago)
- Branches:
- master
- Children:
- c4f89cf
- Parents:
- ebd57f8
- git-author:
- Hal Finkel <hfinkel@…> (05/28/15 16:48:52)
- git-committer:
- Hal Finkel <hfinkel@…> (05/28/15 16:48:52)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
memlog2dot
rebd57f8 r4bd7a88 84 84 } 85 85 86 return sprintf("%.3f $sizes[$i]", $size);86 return sprintf("%.3f $sizes[$i]", $size); 87 87 } 88 88 89 89 printf("digraph \"memlog %s\" {\n", format_bytes($total_size)); 90 print("size=\"8,11\" \n");90 print("size=\"8,11\";\n"); 91 91 print("node [width=0.375,height=0.25];\n"); 92 92 … … 121 121 122 122 $ret .= $func . '\n' . $loc . '\n'; 123 } elsif ($node->{'proc_name'} ne '?') { 124 my $proc_name = $node->{'proc_name'}; 125 $proc_name = `c++filt '$proc_name'`; 126 chomp($proc_name); 127 128 $ret .= $proc_name . '\n'; 123 129 } 124 130 … … 132 138 } 133 139 140 my $skip_frac = 0.01; 141 my %skipped; 142 134 143 foreach my $node (@all_nodes) { 135 144 my $name = get_name($node); 136 145 137 146 my $local_size = $node->{'size'}; 147 if ($local_size * 1.0 / $total_size < $skip_frac) { 148 $skipped{$node->{'pc'}} = 1; 149 next; 150 } 138 151 139 152 my $fs = 8.0; 140 153 if ($local_size > 0) { 141 $fs = 50.0 * sqrt(abs($local_size * 1.0 / $total_size));154 $fs = 50.0 * (abs($local_size * 1.0 / $total_size))**0.125; 142 155 } 143 156 … … 148 161 foreach my $node (@all_nodes) { 149 162 my $local_size = $node->{'size'}; 163 if ($skipped{$node->{'pc'}}) { 164 next; 165 } 150 166 151 167 foreach my $cpc (keys %{$node->{'child_sizes'}}) { 168 if ($skipped{$cpc}) { 169 next; 170 } 171 152 172 my $child_size = $node->{'child_sizes'}->{$cpc}; 153 173 my $frac = $child_size * 1.0 / $local_size; 154 174 155 my $weight = 100.0 * $frac;156 my $style = sprintf("setlinewidth(%f)", 3.0 * $frac);175 my $weight = 100.0 * sqrt($frac); 176 my $style = sprintf("setlinewidth(%f)", 3.0 * sqrt($frac)); 157 177 158 178 printf("N%s -> N%s [label=\"%s\", weight=%d, style=\"%s\"];\n",
Note: See TracChangeset
for help on using the changeset viewer.