"Total Inclusive Cost" is always 0 #29

zbuc opened this Issue Nov 11, 2011 · 3 comments


None yet
2 participants

zbuc commented Nov 11, 2011

I have a few XDebug-generated cachegrind files and they all show 0 in all rows for "Total Inclusive Cost".

I saw this issue: http://groups.google.com/group/webgrind-general/browse_thread/thread/89a695623076dbce but it seemed to only be a problem with cachegrind files that did not contain a "summary" line. All of my cachegrind files have "summary" lines and the "Total Self Cost" column is populated correctly for all rows.

I am running the latest webgrind from git trunk and XDebug 2.2.0

Example cachegrind files here:


EDIT: It seems to be something to deal with this line:

        $result['summedInclusiveCost'] = $this->formatCost($result['summedInclusiveCost']);

as $result['summedInclusiveCost'] is set prior to the execution of that line, but not afterwards.

EDIT2: This is only an issue when using "millisecond" view, it has to do with the rounding at line 241 of Reader.php:

    if ($format == 'msec') {
        return round($cost/1000, 0);

EDIT3: I'm thinking there may actually be an issue somewhere in the Preprocessor.php because the getFunctionInfo method in Reader.php is retrieving values with Inclusive Cost greater than Self Cost, which doesn't make sense.

EDIT4: (wow, a lot of edits)

I'm now thinking the binary .webgrind file might be corrupted. I'm seeing weird function names like " ���� � �������������������������������������������� �!�"��#�$�%�&��'�(�)�*�+�,�-��.�/�0�1��2��3�4�5��6�7�8�9��:�;�<���=�>�?�@��A�B�C�D��E�F��G�H�I�J�K�L�M�N" appear and seeing a lot of errors in my PHP log like:

[11-Nov-2011 17:35:27] PHP Warning:  json_encode() [<a href='function.json-encode'>function.json-encode</a>]: Invalid UTF-8 sequence in argument in /Users/chrisczub/repos/webgrind/index.php on line 120
[11-Nov-2011 17:35:27] PHP Stack trace:
[11-Nov-2011 17:35:27] PHP   1. {main}() /Users/chrisczub/repos/webgrind/index.php:0
[11-Nov-2011 17:35:27] PHP   2. json_encode() /Users/chrisczub/repos/webgrind/index.php:120

[11-Nov-2011 17:35:27] PHP Notice:  Undefined offset: 33554432 in /Users/chrisczub/repos/webgrind/library/Reader.php on line 109
[11-Nov-2011 17:35:27] PHP Stack trace:
[11-Nov-2011 17:35:27] PHP   1. {main}() /Users/chrisczub/repos/webgrind/index.php:0
[11-Nov-2011 17:35:27] PHP   2. Webgrind_Reader->getFunctionInfo() /Users/chrisczub/repos/webgrind/index.php:115

oetting commented Nov 14, 2011

Confirmed. A commit by me has broken webgrind. Will look into it soon.

@oetting oetting added a commit that referenced this issue Nov 14, 2011

@oetting oetting Implements changes in Preprocessor required by new reader that includ…
…es line number information in debug versions greater than 2.1.

Fixes #30 and #29

oetting closed this Nov 14, 2011


oetting commented Nov 14, 2011

Fixed. Please verify if you can.

zbuc commented Nov 14, 2011

Confirmed fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment