Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Devel::NYTProf only generates two graphviz dot files, linked from the main profile page. Each sub page in the profile has a link to "Call graph for these subroutines as a Graphviz dot language file" but the files don't exist. Does anyone know why these links are broken and how to enable them? Thank you

Replies are listed 'Best First'.
Re: NYTProf missing dot files
by choroba (Cardinal) on May 21, 2024 at 09:26 UTC
    I can confirm the files are not being created. Have you ever seen them in older versions of Devel::NYTProf? The best thing would be to raise a new issue at GitHub.

    Update: I've found the files in a project I haven't touched since 2012. I was using Perl 5.14.2 at that time.

    Update 2: It seems that negating this condition makes the dot files appear.

    our %dot_file_generated; if (! $dot_file_generated{$dot_file}++) { # just once for +line/block/sub # ~

    Update 3: Reported.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      Wow that was an easy fix! Thank you for spending the time to find it choroba. For anyone who does not know, these files are used to generate lovely images of subroutine calls. Installing graphviz gives you a bunch of binaries to generate different kinds of graphs like:
      neato -Tpng /path/to/nytprof/PerlModule-pm.dot -o some.png
      Layout engines include: dot, neato, fdp, sfdp, circo, twopi, osage, patchwork

      > Have you ever seen them in older versions of Devel::NYTProf?

      I do not recall ever seeing them, but only recently began to check :-)

      The NYTProf graphs are intense but callGraph is more pretty and easier to grok: github.com/koknat/callGraph