Author: tim.bunce
Date: Fri Jul 17 08:05:21 2009
New Revision: 836

Modified:
    trunk/bin/nytprofhtml
    trunk/demo/demo-run.pl

Log:
Just a little polish.


Modified: trunk/bin/nytprofhtml
==============================================================================
--- trunk/bin/nytprofhtml       (original)
+++ trunk/bin/nytprofhtml       Fri Jul 17 08:05:21 2009
@@ -674,8 +674,8 @@
      }

      print OUT q{<br/>You can view subroutines as treemap of <a  
href="subs-treemap-excl.html">exclusive</a> or <a  
href="subs-treemap-incl.html">inclusive</a> time, grouped by package.<br/>};
-    print OUT q{<br/>Subroutine call graph as a <a  
href="subs-callgraph.html">radial graph</a>,
-        or Graphviz <a href="subs-callgraph.dot">dot file</a> <br/>};
+    print OUT q{<br/>View the subroutine call graph as a <a  
href="subs-callgraph.html">radial graph</a>,
+        or Graphviz <a href="subs-callgraph.dot">dot file</a>.<br/>};

      print OUT file_table($profile, $stats, 1);

@@ -1211,7 +1211,16 @@
      open(OUT, '>', "$opt{out}/$filename")
          or croak "Unable to open file $opt{out}/$filename: $!";

+    my $inc_path_regex = get_abs_paths_alternation_regex([$profile->inc],  
qr/^|\[/);
+    my $dotnode = sub {
+        my $name = shift;
+        $name =~ s/$inc_path_regex//;
+        $name =~ s/"/\\"/g;
+        return '"'.$name.'"';
+    };
+
      print OUT "digraph {\n"; # }
+    print OUT "graph [overlap=false]\n"; # target="???", URL="???"

      # output nodes and gather link info
      my %sub2called;
@@ -1227,7 +1236,7 @@
          }

          # node_stmt: node_id [ attr_list ]
-        print OUT qq{"$subname";\n};
+        printf OUT qq{%s;\n}, $dotnode->($subname);

          $sub2called{$subname} = $called_by_subnames;
      }
@@ -1243,8 +1252,8 @@
          for my $called_by (keys %$called_by_subnames) {
              # edge_stmt : (node_id | subgraph) edgeRHS [ attr_list ]
              # edgeRHS   : edgeop (node_id | subgraph) [ edgeRHS ]
-            printf OUT qq{"%s" -> "%s";\n},
-                $called_by, $subname;
+            printf OUT qq{%s -> %s;\n},
+                $dotnode->($called_by), $dotnode->($subname);
          }

      }

Modified: trunk/demo/demo-run.pl
==============================================================================
--- trunk/demo/demo-run.pl      (original)
+++ trunk/demo/demo-run.pl      Fri Jul 17 08:05:21 2009
@@ -10,7 +10,7 @@
          NYTPROF => 'start=begin:optimize=0',
      },
      start_check => {
-        skip => 1,
+        skip => 0,
          NYTPROF => 'start=init:optimize=0',
      },
      start_end => {

--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to