PHPackages                             ilnytskyi/xtc - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. ilnytskyi/xtc

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

ilnytskyi/xtc
=============

xDebug to Chromium Google Trace Event Format converter

v1.0.2(1y ago)17363[2 issues](https://github.com/ilnytskyi/xdebug-to-chromium-trace-converter/issues)MITPHPPHP &gt;=8.1

Since Nov 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ilnytskyi/xdebug-to-chromium-trace-converter)[ Packagist](https://packagist.org/packages/ilnytskyi/xtc)[ RSS](/packages/ilnytskyi-xtc/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

xDebug Chromium Trace Converter
===============================

[](#xdebug-chromium-trace-converter)

This is a tool for converting xDebug traces into Chromium format that can be visualized in browser's performance tab. [![PHP trace dump as timeline view for Magento 2 in Chrome performance tab](./docs/images/timeline.png)](./docs/images/timeline.png)

Features
--------

[](#features)

- Converts xDebug trace files into the JSON format used by Chromium
- Command-line interface for easy integration into automated workflows

Requirements
------------

[](#requirements)

- PHP 8.1 or later
- xDebug 3+ with `xdebug.trace_format=1` INI setting

Installation via Composer
-------------------------

[](#installation-via-composer)

- Using composer

```
composer require ilnytskyi/xtc

```

- As dev only dependency

```
composer require --dev ilnytskyi/xtc

```

Installation from git
---------------------

[](#installation-from-git)

1. Clone or download this repository to your local machine
2. Add `xtc` script to suitable location of your project or link globally

```
ln -s $(pwd)/xtc /usr/local/bin/xtc

```

3. Use `xtc` script commands to convert your xDebug traces

Usage
-----

[](#usage)

For CLI scripts it's recommended to wrap call into `trace` command:

```
./vendor/bin/xtc trace --cmd="script.php"

```

To see exact wrapper command use `--debug` flag. Try to do self check

```
./vendor/bin/xtc trace --debug --cmd="./vendor/bin/xtc --help"

```

The xtc wraps call with correct xDebug params. The output should be like this:

```
www@3f62bf5fbb1d:~$ ./vendor/bin/xtc trace --debug --cmd="./xtc --help"
Tracing: ./vendor/bin/xtc --help

/app_root/vendor/bin/xtc:564:
string(255) "XDEBUG_MODE=trace XDEBUG_TRIGGER=PHPSTORM /usr/bin/php8.1 -d xdebug.collect_return=0 -d xdebug.collect_params=0 -d xdebug.collect_assignments=0 -d xdebug.trace_format=1 -d xdebug.trigger_value="PHPSTORM" -d xdebug.trace_output_name=xtc_trace.%t xtc --help"

Unknown command: --help
Available commands: trace, convert, watch

Converting /app_root/var/xdebug_dumps/xtc_trace.1699803846.xt

The trace file:                   /app_root/var/xdebug_dumps/xtc_trace.1699803846.xt
Will be processed to:             /app_root/var/xdebug_dumps/xtc_trace.1699803846.xt.json
With following convertOptions
 Show internal PHP functions:     0
 Show arguments:                  0
 Sampling:                        0 μs
Trace is processed successfully /app_root/var/xdebug_dumps/xtc_trace.1699803846.xt.json

```

Now the `/app_root/var/xdebug_dumps/xtc_trace.1699803846.xt.json` file can be visualized in a trace viewer.

Generate xDebug traces manually

```
XDEBUG_MODE=trace XDEBUG_TRIGGER=PHPSTORM php {script.php}

#to capture functions return values
XDEBUG_MODE=trace XDEBUG_TRIGGER=PHPSTORM php -d xdebug.collect_return=1 {script.php}

```

To convert an xDebug trace file, use the `xtc` command and specify the input:

```
./vendor/bin/xtc convert --file=xdebug/dumps/{trace.file}

```

To automatically move converted JSON traces specify the `--out` options with filename or folder

```
./vendor/bin/xtc convert --file=xdebug/dumps/{trace.file} --out=destination/folder/my_trace.json
#OR
./vendor/bin/xtc convert --file=xdebug/dumps/{trace.file} --out=destination/folder/

```

To watch specific directory

```
./vendor/bin/xtc watch --dir=xdebug/dumps/

```

Use same parameters as in `convert` command to apply to profiles.

### Arguments and Return values:

[](#arguments-and-return-values)

xDebug trace file might collect return values of functions is running with `xdebug.collect_return=1` INI setting.
The arguments can also be collected with `xdebug.collect_params=1` INI setting.
When trace is converted with `--args=1` option you can see the values were passed to function and returned.
Timeline visualization might be extremely useful for debugging or reverse engineering

```
./vendor/bin/xtc convert --file=xdebug/dumps/{trace.file} --args=1

```

[![PHP trace dump with captured arguments values and return values](./docs/images/arguments.png)](./docs/images/arguments.png)

Use `--help` option to see more details about command

```
./vendor/bin/xtc convert --help
./vendor/bin/xtc watch --help

```

Notice about performance measurement:
-------------------------------------

[](#notice-about-performance-measurement)

- Tracing with xDebug add significant overhead and might increase script execution time by x10!

Here is an example of tracing of same script:

- with xDebug ~10s [![xDebug trace dump of bin/magento](./docs/images/xdebug_trace.png)](./docs/images/xdebug_trace.png)
- with SPX ~1s [![PHP-SPX trace dump of bin/magento](./docs/images/spx_trace.png)](./docs/images/spx_trace.png)

Although the visualized traces of both profilers look similar, it's noticeable that xDebug took about x10 to execute.

- If your goal is to analyze performance it's recommended to use profiler with lower overhead than xDebug.
- If you need more information like arguments/returns values during the execution, you can use xDebug and convert the trace with `./vendor/bin/xtc` for more convenient analysis.
- xDebug also collects all calls of php internal functions, but they are excluded by `./vendor/bin/xtc` by default. Use `--internal=1` if you want to see them on timeline.

Visualisation
-------------

[](#visualisation)

1. Chrome DevTools Performance Tab `Ctr+Shift+J -> Performance`
2.
3.
4. Any other Chromium trace (Google Trace Event Format) viewers

Inspired By
-----------

[](#inspired-by)

-
-

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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 ~203 days

Total

3

Last Release

512d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10c48905823d0697967efb7710e953953eb7bb78e817e8bcdbc4ccf16ecb045b?d=identicon)[ilnytskyi](/maintainers/ilnytskyi)

---

Top Contributors

[![ilnytskyi](https://avatars.githubusercontent.com/u/3192770?v=4)](https://github.com/ilnytskyi "ilnytskyi (6 commits)")[![Yi-pixel](https://avatars.githubusercontent.com/u/31845646?v=4)](https://github.com/Yi-pixel "Yi-pixel (1 commits)")

---

Tags

flamegraphperformancephpprofilingtimeline-viewtracingxdebug

### Embed Badge

![Health badge](/badges/ilnytskyi-xtc/health.svg)

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

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)[beyondcode/helo-laravel

HELO Laravel debug helper

90360.1k](/packages/beyondcode-helo-laravel)

PHPackages © 2026

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