php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58655 issue with view Callgraph
Submitted: 2009-04-28 14:55 UTC Modified: 2009-05-18 16:49 UTC
From: alex dot ilichev at gmail dot com Assigned:
Status: Closed Package: xhprof (PECL)
PHP Version: 5.2.5 OS: CentOS5.1
Private report: No CVE-ID: None
 [2009-04-28 14:55 UTC] alex dot ilichev at gmail dot com
Description:
------------
Using the xhprof UI (through http://domain.name/callgraph.php?run=49f74baf89433&source=xhprof_foo&all=1), seeing errors like:

Error: either we can not find profile data for run_id 49f74baf89433 or the threshold 0.01 is too small or you do not have 'dot' image generation utility installed.

Any errors in the apache error_log.
Also http://domain.name/index.php?run=49f74baf89433&source=xhprof_foo
works perfect

Issue only with Callgraph


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-18 16:49 UTC] kannan@php.net
Alex: Do you have "dot" installed? 

Cut-pasting from documentation: <<The callgraph image visualization ([View Callgraph]) feature relies on the presence of Graphviz "dot" utility in your path. "dot" is a utility to draw/generate an image for a directed graph. >>

Closing this as not a bug. If you have "dot" installed, but it still does not work, please feel free to reopen then bug.
 [2010-07-11 16:19 UTC] p dot chapman dot uk+pecl at gmail dot com
I am having the same problem, with when trying to use the callgraph.php

"Error: either we can not find profile data for run_id xxxxx or the threshold 0.01 is too small or you do not have 'dot' image generation utility installed."

I do have dot installed.. dot - graphviz version 2.26.3 (20100126.1600) 

I am using Centos 5.5 (Final), kernel 2.6.18-194.8.1.el5

The problem is intermittent. If I run my cmdline php application and shut it down after a short period, I am able to view a callgraph image 

If I leave it running for > 20 seconds or so, then attempting to view the callgraph for that run, generates the dot threshold error

My application uses a constant event loop, so maybe its something to do with it constantly looping.

I am also running profiling with
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);

Thanks
 [2011-02-08 20:33 UTC] tao at starbow dot net
I was getting this error message, and it turned out that my 
graphviz did not have support for exporting png's. You can 
check by typing "dot -T?", and checking the list of types. I 
am using CentOS, so I ended up doing a "yum install graphviz-
gd" to get png support.
The error message could be improved.
 [2011-03-02 13:42 UTC] daan at netnav dot nl
Had the same error PNG support wasn't te problem for me

Don't know what the cause is, anyway my solution was to patch function xhprof_generate_image_by_dot in 
/pecl-xhprof-0.9.2/xhprof_lib/utils/callgraph_utils.php

Function:
function xhprof_generate_image_by_dot($dot_script, $type) {
  $descriptorspec = array(
       // stdin is a pipe that the child will read from
       0 => array("pipe", "r"),
       // stdout is a pipe that the child will write to
       1 => array("pipe", "w"),
       // stderr is a file to write to
       2 => array("file", "/dev/null", "a")
       );

  $cmd = "dot -T".$type;
  
  $tmpFileName = '/tmp/'.md5($dot_script);
  
  if(file_put_contents($tmpFileName, $dot_script)){
    $output = `$cmd $tmpFileName`;   
    unset($tmpFileName);
    return $output; 
  }
  
  print "failed to shell execute cmd=\"$cmd\"\n";
  exit();
}
 [2011-12-01 11:44 UTC] valthebald at gmail dot com
Referred 'dot' image generation utility is graphviz. Probably error message should be more clear.
 [2012-06-20 18:53 UTC] yuantaotao at gmail dot com
I ran into the same error with a working well "dot" installed.

Then I found there are some non-ISO extended encoding characters in the output 
file of xhprof. 

Try use linux command "file" on your xhprof output file for determine weather 
there is a encoding issue in it.

If it's output looks like "Non-ISO extended-ASCII text, with very long lines, 
with NEL line terminators", you should do iconv in the callgraph_utils.php

eg:
$dot_script = iconv("UTF-8", "ASCII//IGNORE", $dot_script);

It works for me.
 [2013-02-21 23:03 UTC] rob dot w dot knox at gmail dot com
Also ensure that your php configuration does not have the 'proc_open' function 
disabled.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC