Missing function names when opening CacheGrind file in WinCacheGrind

1.5k views Asked by At

Hell All. I installed XDEBUG on a apache/php server as a ZEND module. It outputs profiling files but the output does not contain function names, just numbers.

I does not look like other cachegrind output files. My files have numbers instead of function/file names.

If I try to use WinCacheGrind to open a file it turns an error. Also I installed webgrind and the output shows only numbers. Some times there is a filename but it has a number in front of the file name. Clicking on it results in an error.

version: 1 creator: xdebug 2.3.2 cmd: /backup/united/public_html/member.php part: 1 positions: line

events: Time

fl=(1) php:internal
fn=(1) php::define
7 5

fl=(1)
fn=(1)
51 3

fl=(1)
fn=(1)
52 1

fl=(1)
fn=(1)
53 1

fl=(1)
fn=(1)
54 1

fl=(1)
fn=(1)
55 1

fl=(1)
fn=(1)
57 1

fl=(1)

View Webgrind image

2

There are 2 answers

1
Pamela Melissa On

I found out that Xdebug 2.3.2 has a new format that is not compatible with webgrind and other visualizers. That's why the visualization does not include function names.

However it is compatible with QCacheGrind 0.7.4 I installed it and found the source of the poor performance in a web server.

0
kenorb On

Since XDebug 2.3 the duplicated file and function names have been replaced by numbers in order to save some space, so make sure your cachegrind format supports "file name" and "function name" compression.

See: Profiling PHP Scripts at XDebug

Users of Windows can alternatively use WinCacheGrind. The functionality is different from KCacheGrind so the section that documents the use of KCacheGrind on this page doesn't apply to this program. WinCacheGrind currently does not support the file and function compression for cachegrind files that Xdebug 2.3 introduces yet.

For more details about the name compression, check Callgrind Format Specification. Here is some brief:

With the introduction of association specifications like calls it is needed to specify the same function or same file name multiple times. As absolute filenames or symbol names in C++ can be quite long, it is advantageous to be able to specify integer IDs for position specifications. Here, the term "position" corresponds to a file name (source or object file) or function name.

To support name compression, a position specification can be not only of the format "spec=name", but also "spec=(ID) name" to specify a mapping of an integer ID to a name, and "spec=(ID)" to reference a previously defined ID mapping. There is a separate ID mapping for each position specification, i.e. you can use ID 1 for both a file name and a symbol name.

Check also the status of these bug reports: