PHP GrindKit for reading cachegrind compatible file.
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/GrindKit
tests
README.mkd
TODO.md
composer.json
package.ini
phprelease.ini
phpunit.xml
phpunit.xml.dist

README.mkd

GrindKit

PHP GrindKit for reading cachegrind compatible file.

Usage

$grind = new GrindKit\GrindKit;
$files = $grind->scanDir();  // scan xdebug profile output by default.

$files // we got GrindKit\GrindFile object array, which is inherited from SplFileInfo.
foreach( $files as $file ) {
    $meta = $file->getMeta();

    $meta->version;  # cache grind file version
    $meta->creator;  # creator, xdebug 2.1.1... or something
    $meta->cmd;
    $meta->part;
    $meta->positions;


    $result = $file->parse();   // get parser result.


    $parser = new GrindKit\GrindParser( $file );
    $result = $parser->parse();

    $result->functions;  // function list
    $result->summary;    // summary table
    $result->headers;    // header list


    $tree = $result->getExecutionTree();
    $result->dumpExecutionTree();
}

ParserResult Methods

$result->dumpExecutionTree()

will dump the execution tree

Required PHP Extensions

Related Tools

  • webgrind
  • ct_annotate
  • xdebugtoolkit
  • kcachegrind (KDE)
  • WinCacheGrind (windows)

Reference