PHPackages                             pounard/xtrace2fg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. pounard/xtrace2fg

ActiveProject

pounard/xtrace2fg
=================

Converts XDebug TRACE files to https://github.com/brendangregg/FlameGraph compatible input

2.0.0(4y ago)320MITPHP

Since Oct 5Pushed 4y ago1 watchersCompare

[ Source](https://github.com/pounard/xtrace2fg)[ Packagist](https://packagist.org/packages/pounard/xtrace2fg)[ RSS](/packages/pounard-xtrace2fg/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

XDebug TRACE files to FlameGraph converter
==========================================

[](#xdebug-trace-files-to-flamegraph-converter)

From a given Xdebug generated trace file, outputs text suitable for  flamegraph generator.

This requires `xdebug.trace_format` setting to be set to `1`.

Prerequisites
-------------

[](#prerequisites)

- You need  to be installed somewhere.
- `xdebug.trace_format` setting must be `1` in PHP configuration.

Usage
-----

[](#usage)

This will output a trace file using time relative cost for each function:

```
xtrace2fg TRACE_FILE | flamegraph.pl > OUTPUT.svg
```

And this will output a trace file using memory relative cost for each function:

```
xtrace2fg memory TRACE_FILE | flamegraph.pl --color=mem > OUTPUT.svg
```

Where:

- FILE is the Xdebug TRACE file (generated using xdebug.trace\_format=1)
- OUTPUT.svg if the output filename

You can load the SVG output file into any recent browser to benefit from browsing capabilities in the flame graph.

Warning, memory support is experimental, and is NOT doing what you'd expect because it will revert all functions that actually free memory to 0. You will see functions that consume memory without freeing it, but it not necessarily mean it's a leak, since it could be garbage collected somewhere else.

Generated sample trace file
---------------------------

[](#generated-sample-trace-file)

```
XDEBUG_MODE=trace XDEBUG_TRIGGER=1 php -d'xdebug.trace_format=1' -f samples/test.php
cp /tmp/trace.XXXXXX.xt samples/test.xt

./xtrace2fg samples/test.xt > samples/test.cost.output
cat samples/test.cost.output | ~/FlameGraph/flamegraph.pl > samples/test.cost.svg

./xtrace2fg memory samples/test.xt > samples/test.memory.output
cat samples/test.memory.output | ~/FlameGraph/flamegraph.pl --color=mem > samples/test.memory.svg
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1385 days

Total

2

Last Release

1753d ago

Major Versions

1.0.0 → 2.0.02021-07-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/69252826f3a70a19fc5dcefb7ef9d26d465bb300245641abb4dd89d0ec391a66?d=identicon)[pounard](/maintainers/pounard)

---

Top Contributors

[![pounard](https://avatars.githubusercontent.com/u/341855?v=4)](https://github.com/pounard "pounard (8 commits)")

### Embed Badge

![Health badge](/badges/pounard-xtrace2fg/health.svg)

```
[![Health](https://phpackages.com/badges/pounard-xtrace2fg/health.svg)](https://phpackages.com/packages/pounard-xtrace2fg)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
