Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Extensible Xdebug trace file analyzers.
PHP
Branch: master
Failed to load latest commit information.
bin
scripts Added boilerplate that has been sitting for a long time.
src Minor tweaks
test/Tests Added boilerplate that has been sitting for a long time.
.gitignore Initial checkin.
API Added more of the metaphing stub files.
COPYING-MIT.txt Added more of the metaphing stub files.
CREDITS Added more of the metaphing stub files.
README.md fixed spelling
README.pear
RELEASE Added more of the metaphing stub files.
build.xml Initial checkin.
composer.json Added composer.json.
config.doxy
project.properties

README.md

XdebugUtils

This provides a library and various command-line utilities for working with Xdebug output.

Scripts included:

  • trace4func: Given a function name, give stack traces for all cases where the function was called.
  • whatisincluded: Find all of the files that were included on a given run
  • whocalls: Given a function, print info about the calling function. For example, find all functions that call file_exists(_)).

Installation

To collect data, you must have Xdebug installed, and you must be able to configure it to generate traces.

To use these tools, you will need PHP 5.2 or later.

To get started:

  1. Clone the Git repository
  2. Use any of the included command line tools.

Usage

  1. You will need trace file to work with. Consult the Xdebug documentation. Make sure you set the trace output to generate machine-readable output.
  2. Run any of the provided scripts to analyze trace output.

Collecting Data with Xdebug

Example php.ini config for Xdebug:

xdebug.auto_trace = 1
xdebug.trace_format = 1
xdebug.trace_output_name = php-trace.%t

The second one is the most important: Set the tracing format to 1.

More information

You can easily extend this suite. See API (included here) to get started, or simply take a look at some of the tools in this package. Nothing is really that sophisticated.

Related Projects


XdebugUtils by mbutcher (2010)

Thanks to Derick Rethans, who posted a simple PHP tool for parsing Xdebug trace files.

Something went wrong with that request. Please try again.