Changeset 4bd7a88


Ignore:
Timestamp:
05/28/15 16:48:52 (9 years ago)
Author:
Hal Finkel <hfinkel@…>
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)
Message:

working on filtering nodes...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • memlog2dot

    rebd57f8 r4bd7a88  
    8484  } 
    8585 
    86   return sprintf("%.3f$sizes[$i]", $size); 
     86  return sprintf("%.3f $sizes[$i]", $size); 
    8787} 
    8888 
    8989printf("digraph \"memlog %s\" {\n", format_bytes($total_size)); 
    90 print("size=\"8,11\"\n"); 
     90print("size=\"8,11\";\n"); 
    9191print("node [width=0.375,height=0.25];\n"); 
    9292 
     
    121121 
    122122    $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'; 
    123129  } 
    124130 
     
    132138} 
    133139 
     140my $skip_frac = 0.01; 
     141my %skipped; 
     142 
    134143foreach my $node (@all_nodes) { 
    135144  my $name = get_name($node); 
    136145 
    137146  my $local_size = $node->{'size'}; 
     147  if ($local_size * 1.0 / $total_size < $skip_frac) { 
     148    $skipped{$node->{'pc'}} = 1; 
     149    next; 
     150  } 
    138151 
    139152  my $fs = 8.0; 
    140153  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; 
    142155  } 
    143156 
     
    148161foreach my $node (@all_nodes) { 
    149162  my $local_size = $node->{'size'}; 
     163  if ($skipped{$node->{'pc'}}) { 
     164    next; 
     165  } 
    150166 
    151167  foreach my $cpc (keys %{$node->{'child_sizes'}}) { 
     168    if ($skipped{$cpc}) { 
     169      next; 
     170    } 
     171 
    152172    my $child_size = $node->{'child_sizes'}->{$cpc}; 
    153173    my $frac = $child_size * 1.0 / $local_size; 
    154174 
    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)); 
    157177 
    158178    printf("N%s -> N%s [label=\"%s\", weight=%d, style=\"%s\"];\n", 
Note: See TracChangeset for help on using the changeset viewer.