timbunce / devel-nytprof

Devel::NYTProf is a powerful feature-rich source code profiler for Perl. (Mostly in maintenance mode, so PRs are much more likely to be acted upon than Issues.)
http://blog.timbunce.org/tag/nytprof/
67 stars 50 forks source link

Call graph dot files missing #219

Open choroba opened 2 months ago

choroba commented 2 months ago

When running nytprofhtml, only two dot files are created: packages-callgraph.dot and subs-callgraph.dot. All other pages contain links to additional dot files, but they don't exist.

I've found an abandoned project from 2012 where the dot files existed in the nytprof/ directory. The files claim to be produced by NYTProf 4.09.

It's interesting that changing the following condition starts creating the files - but 4.09 had the same condition as the current version.

diff --git a/bin/nytprofhtml b/bin/nytprofhtml
index 0f87ecb..861ac01 100755
--- a/bin/nytprofhtml
+++ b/bin/nytprofhtml
@@ -450,7 +450,7 @@ $reporter->set_param(
             };

             our %dot_file_generated;
-            if ($dot_file_generated{$dot_file}++) { # just once for line/block/sub
+            if (! $dot_file_generated{$dot_file}++) { # just once for line/block/sub
                 my $subs_in_file = $profile->subs_defined_in_file($filestr, 0);
                 # include subs defined in this file
                 # and/or called from subs defined in this file

Originally reported at PerlMonks.