grindkit/grindkit

There is no license information available for the latest version (dev-master) of this package.

PHP GrindKit for reading cachegrind compatible files.

dev-master 2013-03-25 14:53 UTC

This package is auto-updated.

Last update: 2024-10-29 04:09:17 UTC


README

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